From 8de2199742d4f2b47d4beaca9d2aa14c759a0b5d Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 14 Mar 2025 15:16:21 +0100 Subject: [PATCH] Render the "add day" within a Card This makes it visually more similar to the rest of the options --- lib/widgets/routines/forms/day.dart | 39 +++++++++++++---------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/lib/widgets/routines/forms/day.dart b/lib/widgets/routines/forms/day.dart index 80776aa2..99086ae5 100644 --- a/lib/widgets/routines/forms/day.dart +++ b/lib/widgets/routines/forms/day.dart @@ -123,28 +123,25 @@ class _ReorderableDaysListState extends State { provider.editDays(widget.days, refresh: true); }, ), - ListTile( - key: const ValueKey('add-day'), - // tileColor: Theme.of(context).highlightColor, - leading: const Icon(Icons.add), - title: Text( - AppLocalizations.of(context).newDay, - style: Theme.of(context).textTheme.titleMedium, + Card( + child: ListTile( + key: const ValueKey('add-day'), + // tileColor: Theme.of(context).focusColor, + leading: const Icon(Icons.add), + title: Text( + AppLocalizations.of(context).newDay, + style: Theme.of(context).textTheme.titleMedium, + ), + onTap: () async { + final day = Day.empty(); + day.name = '${i18n.newDay} ${widget.days.length + 1}'; + day.routineId = widget.routineId; + day.order = widget.days.length + 1; + final newDay = await provider.addDay(day, refresh: true); + + widget.onDaySelected(newDay.id!); + }, ), - onTap: () async { - final day = Day.empty(); - day.name = '${i18n.newDay} ${widget.days.length + 1}'; - day.routineId = widget.routineId; - day.order = widget.days.length + 1; - final newDay = await provider.addDay(day, refresh: true); - - // final newSlot = await provider.addSlot(Slot.withData( - // day: newDay.id, - // order: 1, - // )); - - widget.onDaySelected(newDay.id!); - }, ), ], );