listColor function

Color listColor(
  1. int? index
)

Implementation

Color listColor(int? index) {
  // retur color by index
  if (index == null) {
    return Colors.grey;
  } else {
    final colors = [
      Colors.blue,
      Colors.green,
      Colors.red,
      Colors.orange,
      Colors.purple,
      Colors.teal,
      Colors.amber,
      Colors.deepPurple,
      Colors.indigo,
      Colors.lightBlue,
      Colors.lime,
      Colors.yellow,
      Colors.cyan,
      Colors.deepOrange,
      Colors.pink,
      Colors.blueGrey,
    ];
    return colors[index % colors.length];
  }
}