getColor static method
Implementation
static Color getColor(
Map? data,
String key, {
Color defaultValue = Colors.red,
}) {
try {
String color =
Methods.getString(data, key, defaultValue: ''); //default COLOR _BLUE
if (color == '') {
return defaultValue;
}
return HexColor.fromHex(color);
} catch (ex) {
return defaultValue;
}
}