-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server): add tasks and sub-tasks feature
cover tables, permissions and relationships for new added view and tables. closes #26
- Loading branch information
Showing
28 changed files
with
1,085 additions
and
125 deletions.
There are no files selected for viewing
9 changes: 7 additions & 2 deletions
9
app/lib/src/features/task_management/application/category_service.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||
|
||
import '../data/remote_category_repository.dart'; | ||
import '../domain/task_category.dart'; | ||
import '../domain/todo_category.dart'; | ||
import '../domain/todo_task.dart'; | ||
|
||
// TODO:: Support offline graphql | ||
class CategoryService { | ||
final RemoteCategoryRepository _remoteCategoryRepository; | ||
CategoryService(this._remoteCategoryRepository); | ||
|
||
Stream<AsyncValue<List<TaskCategory>>> watchCategories() { | ||
Stream<AsyncValue<List<TodoCategory>>> watchCategories() { | ||
return _remoteCategoryRepository.watchCategories(); | ||
} | ||
|
||
Stream<AsyncValue<List<TodoTask>>> watchTasksByCategoryId(String categoryId) { | ||
return _remoteCategoryRepository.watchTasksByCategoryId(categoryId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
...task_management/domain/task_category.dart → ...task_management/domain/todo_category.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
import '../../../common/models/converters.dart'; | ||
|
||
part 'task_category.freezed.dart'; | ||
part 'task_category.g.dart'; | ||
part 'todo_category.freezed.dart'; | ||
part 'todo_category.g.dart'; | ||
|
||
@freezed | ||
@JsonSerializable(converters: [ColorConverter()], createFactory: false) | ||
class TaskCategory with _$TaskCategory { | ||
factory TaskCategory({ | ||
class TodoCategory with _$TodoCategory { | ||
factory TodoCategory({ | ||
required String id, | ||
required String name, | ||
required String userId, | ||
@ColorConverter() Color? color, | ||
required DateTime createdAt, | ||
DateTime? updatedAt, | ||
}) = _TaskCategory; | ||
}) = _TodoCategory; | ||
|
||
TaskCategory._(); | ||
TodoCategory._(); | ||
|
||
@override | ||
factory TaskCategory.fromJson(Map<String, dynamic> json) => | ||
_$TaskCategoryFromJson(json); | ||
factory TodoCategory.fromJson(Map<String, dynamic> json) => | ||
_$TodoCategoryFromJson(json); | ||
|
||
@override | ||
Map<String, dynamic> toJson() => _$TaskCategoryToJson(this); | ||
Map<String, dynamic> toJson() => _$TodoCategoryToJson(this); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.