added fallback option for non existing colors
This commit is contained in:
parent
a2f1ccae7b
commit
e40760a07a
@ -27,7 +27,7 @@ class TimetableColors {
|
||||
}
|
||||
|
||||
static Color getColorFromString(String color){
|
||||
return getDisplayOptions(CustomTimetableColors.values.firstWhere((element) => element.name == color)).color;
|
||||
return getDisplayOptions(CustomTimetableColors.values.firstWhere((element) => element.name == color, orElse: () => CustomTimetableColors.orange)).color;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user