abf1cc3f7d
- Introduced BoardService and BoardRepository for managing board-related data. - Updated app routes to reflect the new board screen structure. - Added new board-related assets to the asset manager. - Refactored BoardScreen navigation to utilize the new provider structure.
30 lines
646 B
Dart
30 lines
646 B
Dart
enum TaskStatus { toDo, inProgress, done }
|
|
|
|
extension TaskStatusExtension on TaskStatus {
|
|
// تبدیل enum به string
|
|
String get value => name;
|
|
|
|
// تبدیل string به enum
|
|
static TaskStatus fromString(String? status) {
|
|
if (status == null) {
|
|
return TaskStatus.toDo;
|
|
}
|
|
|
|
return TaskStatus.values.firstWhere(
|
|
(e) => e.name == status,
|
|
orElse: () => TaskStatus.toDo,
|
|
);
|
|
}
|
|
|
|
String get displayNameEn {
|
|
switch (this) {
|
|
case TaskStatus.toDo:
|
|
return 'To Do';
|
|
case TaskStatus.inProgress:
|
|
return 'In Progress';
|
|
case TaskStatus.done:
|
|
return 'Done';
|
|
}
|
|
}
|
|
}
|