There are two items in Column. Column must be "wrap content" (does not fill all available width). First item in column must fill space.
My code now:
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: ListView(children: [
_item(context, '123456', '123456789000000'),
_item(context, '1234567890000000', '1234567')
]));
}
Widget _item(BuildContext context, String firstLine, String secondLine) {
final theme = Theme.of(context);
return Container(
alignment: Alignment.topLeft,
child: Padding(
padding: const EdgeInsets.all(24),
child: ColoredBox(
color: Colors.black12,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container( // This container's width must be not less than container below
color: Colors.blueGrey,
child: Text(firstLine, style: theme.textTheme.headline4)),
Container(
color: Colors.cyan,
child: Text(secondLine, style: theme.textTheme.headline4)),
]),
),
),
);
}
}
When I add crossAxisAlignment: CrossAxisAlignment.stretch
to Column, then it cause stretching on all screen width instead just fit available width (see arrow on screenshot).