getColorFromString function
Implementation
MaterialColor getColorFromString(color) {
switch (color) {
case 'red':
return Colors.red;
case 'pink':
return Colors.pink;
case 'purple':
return Colors.purple;
case 'deepPurple':
return Colors.deepPurple;
case 'indigo':
return Colors.indigo;
case 'blue':
return Colors.blue;
case 'lightBlue':
return Colors.lightBlue;
case 'cyan':
return Colors.cyan;
case 'teal':
return Colors.teal;
case 'green':
return Colors.green;
case 'lightGreen':
return Colors.lightGreen;
case 'lime':
return Colors.lime;
case 'yellow':
return Colors.yellow;
case 'amber':
return Colors.amber;
case 'orange':
return Colors.orange;
case 'deepOrange':
return Colors.deepOrange;
case 'brown':
return Colors.brown;
case 'blueGrey':
return Colors.blueGrey;
default:
return Colors.grey;
}
}