Project task view: tapping a project shows milestone-grouped task list

- ProjectLibraryCard.onTap navigates to /projects/:id/tasks
- New ProjectTasksScreen: milestone sections with coloured dot,
  done/total counter and thin progress bar; unassigned tasks at bottom
- Status cycle icon updates optimistically (pendingStatus map) so
  the list doesn't flash on every tap; syncs global tasksProvider
- New route /projects/:id/tasks registered in app.dart
- TasksApi.getByProject + TasksRepository + projectTasksProvider (family)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-12 21:40:14 -04:00
parent a337c3fda3
commit 5ca5856f15
7 changed files with 415 additions and 1 deletions
+18
View File
@@ -52,6 +52,24 @@ class TasksApi {
}
}
Future<List<Task>> getByProject(int projectId) async {
try {
final response = await _dio.get(
'/api/notes',
queryParameters: {
'project_id': projectId,
'is_task': 'true',
'limit': 500,
},
);
final data = response.data as Map<String, dynamic>;
final list = data['notes'] as List<dynamic>;
return list.map((e) => Task.fromJson(e as Map<String, dynamic>)).toList();
} on DioException catch (e) {
throw dioToApp(e);
}
}
Future<List<Task>> getSubTasks(int parentId) async {
try {
final response = await _dio.get(