Improve event todo visibility

This commit is contained in:
zsolt
2026-08-13 14:07:22 +02:00
parent e56abfb2aa
commit f13353f4ee
2 changed files with 166 additions and 9 deletions
+63 -1
View File
@@ -915,6 +915,26 @@ class WeekEventPill extends StatelessWidget {
fontWeight: FontWeight.w900,
),
),
if (event.hasTodos) ...[
const SizedBox(height: 2),
Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(Icons.task_alt_rounded, color: sage, size: 12),
const SizedBox(width: 3),
Text(
event.todos.isEmpty
? 'teend\u0151'
: '${event.todos.length} db',
style: const TextStyle(
color: sage,
fontSize: 10,
fontWeight: FontWeight.w900,
),
),
],
),
],
const SizedBox(height: 1),
Text(
event.title,
@@ -1424,7 +1444,15 @@ class EventCard extends StatelessWidget {
style: const TextStyle(color: Colors.black54),
),
const SizedBox(height: 6),
AudienceChip(person: person, event: event),
Wrap(
spacing: 6,
runSpacing: 6,
crossAxisAlignment: WrapCrossAlignment.center,
children: [
AudienceChip(person: person, event: event),
if (event.hasTodos) TodoBadge(event: event),
],
),
],
),
),
@@ -1440,6 +1468,40 @@ class EventCard extends StatelessWidget {
}
}
class TodoBadge extends StatelessWidget {
const TodoBadge({super.key, required this.event});
final CalendarEvent event;
@override
Widget build(BuildContext context) {
final count = event.todos.length;
return Container(
padding: const EdgeInsets.symmetric(horizontal: 9, vertical: 5),
decoration: BoxDecoration(
color: sage.withValues(alpha: .12),
borderRadius: BorderRadius.circular(999),
border: Border.all(color: sage.withValues(alpha: .18)),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(Icons.task_alt_rounded, color: sage, size: 14),
const SizedBox(width: 4),
Text(
count == 0 ? 'Teend\u0151 van' : '$count teend\u0151',
style: const TextStyle(
color: sage,
fontWeight: FontWeight.w900,
fontSize: 11,
),
),
],
),
);
}
}
class FamilyAvatar extends StatelessWidget {
const FamilyAvatar({super.key, required this.person, this.radius = 22});