feat(06-01): add watchCompletionsForTask DAO method and history localization strings
- Add watchCompletionsForTask(taskId) to TasksDao: Stream<List<TaskCompletion>> sorted newest first - Regenerate tasks_dao.g.dart with build_runner - Add taskHistoryTitle, taskHistoryEmpty, taskHistoryCount to app_de.arb - Regenerate app_localizations.dart and app_localizations_de.dart - All 5 new DAO tests pass, zero analyze issues
This commit is contained in:
@@ -81,6 +81,14 @@ class TasksDao extends DatabaseAccessor<AppDatabase> with _$TasksDaoMixin {
|
||||
});
|
||||
}
|
||||
|
||||
/// Watch all completions for a task, newest first.
|
||||
Stream<List<TaskCompletion>> watchCompletionsForTask(int taskId) {
|
||||
return (select(taskCompletions)
|
||||
..where((c) => c.taskId.equals(taskId))
|
||||
..orderBy([(c) => OrderingTerm.desc(c.completedAt)]))
|
||||
.watch();
|
||||
}
|
||||
|
||||
/// Count overdue tasks in a room (nextDueDate before today).
|
||||
Future<int> getOverdueTaskCount(int roomId, {DateTime? today}) async {
|
||||
final now = today ?? DateTime.now();
|
||||
|
||||
Reference in New Issue
Block a user