1
0
mirror of https://github.com/go-vikunja/app synced 2024-05-29 00:36:49 +00:00
app-mirror-github/lib/utils/priority.dart
Denys Vitali 056b2d72c9
chore: format code with dart format (#71)
This PR formats all code with dart format and adds a step to the CI so that it will be checked on every push and PR.
2024-04-05 22:36:56 +02:00

38 lines
648 B
Dart

priorityToString(int? priority) {
switch (priority) {
case 0:
return 'Unset';
case 1:
return 'Low';
case 2:
return 'Medium';
case 3:
return 'High';
case 4:
return 'Urgent';
case 5:
return 'DO NOW';
default:
return "";
}
}
// FIXME: Move the following two functions to an extra class or type.
priorityFromString(String? priority) {
switch (priority) {
case 'Low':
return 1;
case 'Medium':
return 2;
case 'High':
return 3;
case 'Urgent':
return 4;
case 'DO NOW':
return 5;
default:
// unset
return 0;
}
}