I am trying to use ListTiles as items of the horizontal ListView.
final brandsWidget = SizedBox(
height: 200,
child: ListView(
scrollDirection: Axis.horizontal,
children: [
ListTile(
leading: Image.asset('img_1.png'),
title: Text('Product 1'),
subtitle: Text('\$5'),
),
ListTile(
leading: Image.asset('img_1.png),
title: Text('Product 2'),
subtitle: Text('\$3'),
)
],
),
);
I got the following error:
Another exception was thrown: BoxConstraints forces an infinite width.
Exception caught by rendering library.
BoxConstraints forces an infinite width.
The relevant error-causing widget was ListTile