- Create task_history_sheet.dart: showTaskHistorySheet() modal bottom sheet - Sheet uses StreamBuilder on watchCompletionsForTask, shows dates in dd.MM.yyyy + HH:mm format - Empty state: Icons.history + 'Noch nie erledigt' message - Count summary shown above list when completions exist - Add Verlauf ListTile to TaskFormScreen (edit mode only) opening history sheet - Add onTap to CalendarTaskRow navigating to /rooms/:roomId/tasks/:taskId - All 106 tests pass, zero analyze issues
73 lines
2.2 KiB
Dart
73 lines
2.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
import 'package:household_keeper/features/home/domain/daily_plan_models.dart';
|
|
|
|
/// Warm coral/terracotta color for overdue task name text.
|
|
const _overdueColor = Color(0xFFE07A5F);
|
|
|
|
/// A task row adapted for the calendar day list.
|
|
///
|
|
/// Shows task name, a tappable room tag (navigates to room task list),
|
|
/// and an interactive checkbox. Does NOT show a relative date — the
|
|
/// calendar strip already communicates which day is selected.
|
|
///
|
|
/// When [isOverdue] is true the task name uses coral text to visually
|
|
/// distinguish overdue carry-over from today's regular tasks.
|
|
class CalendarTaskRow extends StatelessWidget {
|
|
const CalendarTaskRow({
|
|
super.key,
|
|
required this.taskWithRoom,
|
|
required this.onCompleted,
|
|
this.isOverdue = false,
|
|
});
|
|
|
|
final TaskWithRoom taskWithRoom;
|
|
|
|
/// Called when the user checks the checkbox.
|
|
final VoidCallback onCompleted;
|
|
|
|
/// When true, task name is rendered in coral color.
|
|
final bool isOverdue;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
final task = taskWithRoom.task;
|
|
|
|
return ListTile(
|
|
onTap: () => context.go(
|
|
'/rooms/${taskWithRoom.roomId}/tasks/${taskWithRoom.task.id}',
|
|
),
|
|
leading: Checkbox(
|
|
value: false,
|
|
onChanged: (_) => onCompleted(),
|
|
),
|
|
title: Text(
|
|
task.name,
|
|
style: theme.textTheme.titleMedium?.copyWith(
|
|
color: isOverdue ? _overdueColor : null,
|
|
),
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
),
|
|
subtitle: GestureDetector(
|
|
onTap: () => context.go('/rooms/${taskWithRoom.roomId}'),
|
|
child: Container(
|
|
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
|
decoration: BoxDecoration(
|
|
color: theme.colorScheme.secondaryContainer,
|
|
borderRadius: BorderRadius.circular(4),
|
|
),
|
|
child: Text(
|
|
taskWithRoom.roomName,
|
|
style: theme.textTheme.labelSmall?.copyWith(
|
|
color: theme.colorScheme.onSecondaryContainer,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|