I am trying to go though this list of strings and get a box colored at each color, is it possible in any other way I am missing?
List<String> myColors = [
"blue",
"red",
"green",
"orange",
"purple",
"yellow",
"pink",
"black"
];
----------------------------------
ListView.builder(
shrinkWrap: true,
padding: const EdgeInsets.only(left: 5, right: 5),
itemCount: myColors.length,
itemBuilder: (BuildContext context, int index) {
final currentColor = [myColors[index]];
final coloring = "Colors.$currentColor";
return Container(
height:30,
width: 160,
color: coloring,
child: Text(coloring),
);
},
),