Files
HouseHoldKeaper/lib/features/home/presentation/progress_card.dart
Jean-Luc Makiola 4e3a3ed3c2 feat(03-02): add DailyPlanTaskRow and ProgressCard widgets
- DailyPlanTaskRow: task name, tappable room tag, relative date (coral if overdue), optional checkbox, no row-tap
- ProgressCard: "X von Y erledigt" with LinearProgressIndicator

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 12:35:44 +01:00

52 lines
1.4 KiB
Dart

import 'package:flutter/material.dart';
import 'package:household_keeper/l10n/app_localizations.dart';
/// A progress banner card showing "X von Y erledigt" with a linear
/// progress bar. Displayed at the top of the daily plan screen.
class ProgressCard extends StatelessWidget {
const ProgressCard({
super.key,
required this.completed,
required this.total,
});
final int completed;
final int total;
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context);
final theme = Theme.of(context);
final colorScheme = theme.colorScheme;
return Card(
margin: const EdgeInsets.all(16),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
l10n.dailyPlanProgress(completed, total),
style: theme.textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 12),
ClipRRect(
borderRadius: BorderRadius.circular(4),
child: LinearProgressIndicator(
value: total > 0 ? completed / total : 0.0,
minHeight: 8,
backgroundColor: colorScheme.surfaceContainerHighest,
color: colorScheme.primary,
),
),
],
),
),
);
}
}