Add board service and repository, update routes and assets
- 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.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
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';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user