- Add totalTaskCount field to CalendarDayState to distinguish first-run from celebration - Add getTaskCount() to CalendarDao (SELECT COUNT from tasks) - CalendarStrip: 181-day horizontal scroll with German abbreviations, today highlighting, month boundary labels, scroll-to-today controller - CalendarTaskRow: task name + room tag chip + checkbox, no relative date, isOverdue coral styling - CalendarDayList: loading/error/first-run-empty/empty-day/celebration/has-tasks states, overdue section (today only), slide-out completion animation - Update home_screen_test.dart and app_shell_test.dart to test new calendar providers instead of dailyPlanProvider
26 lines
975 B
Dart
26 lines
975 B
Dart
import 'package:household_keeper/features/home/domain/daily_plan_models.dart';
|
|
|
|
/// State for the calendar day view: tasks for the selected date + overdue tasks.
|
|
class CalendarDayState {
|
|
final DateTime selectedDate;
|
|
final List<TaskWithRoom> dayTasks;
|
|
final List<TaskWithRoom> overdueTasks;
|
|
|
|
/// Total number of tasks in the database (across all days/rooms).
|
|
/// Used by the UI to distinguish first-run empty state (no tasks exist at all)
|
|
/// from celebration state (tasks exist but today's are all done).
|
|
final int totalTaskCount;
|
|
|
|
const CalendarDayState({
|
|
required this.selectedDate,
|
|
required this.dayTasks,
|
|
required this.overdueTasks,
|
|
required this.totalTaskCount,
|
|
});
|
|
|
|
/// True when both day tasks and overdue tasks are empty.
|
|
/// Determined by the UI layer (completion state vs. no tasks at all
|
|
/// is handled in the widget based on this flag and history context).
|
|
bool get isEmpty => dayTasks.isEmpty && overdueTasks.isEmpty;
|
|
}
|