When I put a Row in the ConstrainedBox with Flutter, the display is out of the way. Is this a Flutter bug?
//Does not Stick out Pattern
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: ScreenUtil.getFullWidth(context) * 0.8),
child: Container(
decoration: const BoxDecoration(color: Colors.red),
width: 300,
height: 100,
)),
//Stick out Pattern
ConstrainedBox(
constraints: BoxConstraints(
maxWidth: ScreenUtil.getFullWidth(context) * 0.8),
child: Row(
children: [
Container(
decoration: const BoxDecoration(color: Colors.green),
width: 300,
height: 100,
)
])),
CodePudding user response:
do your ConstrainedBox is inside of a scaffold widget?
That is sometimes required.