here is the code .i need help in switch case. I watched this video but I need more examples to completely understand switch case..
How can i use switch case to change bg color of listview .I want to add 10 different types of colors in listview
ListView.builder(
itemBuilder: (BuildContext context, int index) {
return Container(
color: (index % 10 == 0) ? Colors.red : Colors.green,
child: ListTile(
title: ...
),
);
},
)