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:
2026-03-16 21:55:44 +01:00
parent 2687f5e31e
commit ceae7d7d61
5 changed files with 46 additions and 2 deletions

View File

@@ -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();