I am using wrap to display some images, the direction of Wrap is set to Axis.horizontal. When it runs out of horizontal space, it is creating new row. As long as there is enough space vertically, everything is getting displayed as it should. But the moment there are a lot of images, it is giving a Bottom Overflow.
I tried wrapping the Wrap widget inside SingleChildScrollView, ListView and Expanded but nothing seems to work. Here is my code:
@override
Widget build(BuildContext context) {
return Wrap(
direction: Axis.horizontal,
spacing: 8,
runSpacing: 12,
children: [
_buildImageCard('abc'),
_buildImageCard('def'),
_buildImageCard('ghi'),
_buildImageCard('jkl'),
],
);
}
}
and the _buildImageCard
Widget _buildImageCard(String imagePath) {
return SizedBox(
width: 500,
height: 400,
child: Card(
elevation: 5,
),
);
}
The result is:

