-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Description
Try this sample:
runApp(new Align(
alignment: FractionalOffset.topCenter,
child: new SizedBox(
height: 50.0,
child: new Transform(
transform: new Matrix4.identity()
..scale(1.0, 0.5),
child: new Column(
children: <Widget>[
new Flexible(flex: null, child: new Container(decoration: new BoxDecoration(backgroundColor: Colors.green[500]), height: 2.0*20.0)),
new Flexible(flex: null, child: new Container(decoration: new BoxDecoration(backgroundColor: Colors.white), height: 2.0*30.0)),
]
)
)
)
));
The Transform has a 100px high child, which it scales to 50px high. This should fit fine inside the SizedBox, but the SizedBox paints an angry red overflow indicator on the bottom half of its child. If the SizedBox instead has an untransformed 50px child, everything is fine. It seems the SizedBox applies its constraints to the child before the transform is applied.
Metadata
Metadata
Assignees
Labels
No labels