fromString static method
Convert a string to its corresponding AAJourneyMode enum value
Implementation
static AAJourneyMode fromString(String modeString) {
try {
return AAJourneyMode.values.firstWhere(
(mode) {
return mode.mode == modeString;
}
);
} catch (e) {
print('Error: No matching AAJourneyMode for string: $modeString');
throw ArgumentError('No matching AAJourneyMode for string: $modeString');
}
}