24 lines
528 B
Dart
24 lines
528 B
Dart
enum ReminderAction {
|
|
archive('archive'),
|
|
snooze10m('snooze10m');
|
|
|
|
const ReminderAction(this.value);
|
|
|
|
final String value;
|
|
|
|
static ReminderAction fromValue(String raw) {
|
|
switch (raw) {
|
|
case 'archive':
|
|
case 'cancel':
|
|
case 'auto_archive':
|
|
return ReminderAction.archive;
|
|
case 'snooze10m':
|
|
case 'snooze_10m':
|
|
case 'timeout_30s':
|
|
return ReminderAction.snooze10m;
|
|
default:
|
|
throw ArgumentError.value(raw, 'raw', 'Unsupported reminder action');
|
|
}
|
|
}
|
|
}
|