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();
|
||||
|
||||
@@ -107,5 +107,13 @@
|
||||
"overdue": { "type": "int" }
|
||||
}
|
||||
},
|
||||
"calendarTodayButton": "Heute"
|
||||
"calendarTodayButton": "Heute",
|
||||
"taskHistoryTitle": "Verlauf",
|
||||
"taskHistoryEmpty": "Noch nie erledigt",
|
||||
"taskHistoryCount": "{count} Mal erledigt",
|
||||
"@taskHistoryCount": {
|
||||
"placeholders": {
|
||||
"count": { "type": "int" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,6 +519,24 @@ abstract class AppLocalizations {
|
||||
/// In de, this message translates to:
|
||||
/// **'Heute'**
|
||||
String get calendarTodayButton;
|
||||
|
||||
/// No description provided for @taskHistoryTitle.
|
||||
///
|
||||
/// In de, this message translates to:
|
||||
/// **'Verlauf'**
|
||||
String get taskHistoryTitle;
|
||||
|
||||
/// No description provided for @taskHistoryEmpty.
|
||||
///
|
||||
/// In de, this message translates to:
|
||||
/// **'Noch nie erledigt'**
|
||||
String get taskHistoryEmpty;
|
||||
|
||||
/// No description provided for @taskHistoryCount.
|
||||
///
|
||||
/// In de, this message translates to:
|
||||
/// **'{count} Mal erledigt'**
|
||||
String taskHistoryCount(int count);
|
||||
}
|
||||
|
||||
class _AppLocalizationsDelegate
|
||||
|
||||
@@ -239,4 +239,15 @@ class AppLocalizationsDe extends AppLocalizations {
|
||||
|
||||
@override
|
||||
String get calendarTodayButton => 'Heute';
|
||||
|
||||
@override
|
||||
String get taskHistoryTitle => 'Verlauf';
|
||||
|
||||
@override
|
||||
String get taskHistoryEmpty => 'Noch nie erledigt';
|
||||
|
||||
@override
|
||||
String taskHistoryCount(int count) {
|
||||
return '$count Mal erledigt';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user