Skip to content

Commit b7b8aad

Browse files
committed
Also put the list tile to add exercises in a card
This makes it look the same as the one to add new days and makes for a more consistent behaviour
1 parent 5fdcb63 commit b7b8aad

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

lib/widgets/routines/forms/slot.dart

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -574,29 +574,31 @@ class _SlotFormWidgetStateNg extends State<ReorderableSlotList> {
574574
},
575575
),
576576
if (!widget.day.isRest)
577-
ListTile(
578-
leading: isAddingSlot ? const FormProgressIndicator() : const Icon(Icons.add),
579-
title: Text(
580-
i18n.addExercise,
581-
style: Theme.of(context).textTheme.titleMedium,
577+
Card(
578+
child: ListTile(
579+
leading: isAddingSlot ? const FormProgressIndicator() : const Icon(Icons.add),
580+
title: Text(
581+
i18n.addExercise,
582+
style: Theme.of(context).textTheme.titleMedium,
583+
),
584+
onTap: isAddingSlot
585+
? null
586+
: () async {
587+
setState(() => isAddingSlot = true);
588+
589+
final newSlot = await provider.addSlot(
590+
Slot.withData(
591+
day: widget.day.id,
592+
order: widget.slots.length + 1,
593+
),
594+
widget.day.routineId,
595+
);
596+
if (mounted) {
597+
setState(() => isAddingSlot = false);
598+
setState(() => selectedSlotId = newSlot.id);
599+
}
600+
},
582601
),
583-
onTap: isAddingSlot
584-
? null
585-
: () async {
586-
setState(() => isAddingSlot = true);
587-
588-
final newSlot = await provider.addSlot(
589-
Slot.withData(
590-
day: widget.day.id,
591-
order: widget.slots.length + 1,
592-
),
593-
widget.day.routineId,
594-
);
595-
if (mounted) {
596-
setState(() => isAddingSlot = false);
597-
setState(() => selectedSlotId = newSlot.id);
598-
}
599-
},
600602
),
601603
],
602604
);

0 commit comments

Comments
 (0)