Why does AspectRatio not preserve my aspect ratio when it is placed in a ListView?
Unexpected behaviour (doesn't preserve aspect ratio in a ListView)
return ListView(
children: [
Container(
height: 200,
child: AspectRatio(
aspectRatio: 1 / 2,
child: Container(
color: Colors.red,
),
),
),
],
);
Expected behaviour (works outside of a ListView)
return Container(
height: 200,
child: AspectRatio(
aspectRatio: 1 / 2,
child: Container(
color: Colors.red,
),
),
);