I want to show some items by category. I can do this with Map but they all depend on a single scrollController. Since there is no fixed number of categories, I cannot do it statically.
How can I create scrollController dynamically in Map.
These two lines give me error.
ScrollController scrollName = 'scrollName'+extra.id.toString();
ScrollController scrollName = new ScrollController();
My code
Column(
children: order!.extraOrders!.map((extra) {
ScrollController scrollName = 'scrollName'+extra.id.toString();
ScrollController scrollName = new ScrollController();
return SingleChildScrollView(
scrollDirection: Axis.horizontal,
controller: 'dymanicNameWillBe',
child: Row(
children: extra.items!.map((e) {
return Padding(
padding: const EdgeInsets.only(
right: 10.0,
bottom: 10,
top: 30,
left: 10),
...