added fallback option for non existing colors

This commit is contained in:
Lars Neuhaus 2024-03-17 17:08:43 +01:00
parent a2f1ccae7b
commit e40760a07a

View File

@ -27,7 +27,7 @@ class TimetableColors {
} }
static Color getColorFromString(String color){ 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;
} }
} }