diff --git a/packages/flutter_availability/lib/src/ui/screens/template_week_modification.dart b/packages/flutter_availability/lib/src/ui/screens/template_week_modification.dart index a1a43e1..d6c5755 100644 --- a/packages/flutter_availability/lib/src/ui/screens/template_week_modification.dart +++ b/packages/flutter_availability/lib/src/ui/screens/template_week_modification.dart @@ -1,7 +1,6 @@ import "package:flutter/material.dart"; import "package:flutter_availability/src/ui/view_models/template_daydata_view_model.dart"; import "package:flutter_availability/src/ui/view_models/week_template_view_models.dart"; -import "package:flutter_availability/src/ui/widgets/base_page.dart"; import "package:flutter_availability/src/ui/widgets/color_selection.dart"; import "package:flutter_availability/src/ui/widgets/template_name_input.dart"; import "package:flutter_availability/src/ui/widgets/template_time_break.dart"; @@ -217,34 +216,54 @@ class _WeekTemplateModificationScreenState ), ); - return options.baseScreenBuilder( - context, - onBackPressed, - BasePage( - body: [ - _WeekTemplateSidePadding(child: title), - const SizedBox(height: 24), - if (_editing) ...[ - ...editPage, - ] else ...[ - overviewPage, + var body = CustomScrollView( + slivers: [ + SliverList.list( + children: [ + const SizedBox(height: 40), + _WeekTemplateSidePadding(child: title), + const SizedBox(height: 24), + if (_editing) ...[ + ...editPage, + ] else ...[ + overviewPage, + ], + const SizedBox(height: 32), ], - ], - buttons: [ - if (_editing) ...[ - nextButton, - ] else ...[ - saveButton, - const SizedBox(height: 8), - previousButton, - ], - if (widget.template != null) ...[ - const SizedBox(height: 8), - deleteButton, - ], - ], - ), + ), + SliverFillRemaining( + fillOverscroll: false, + hasScrollBody: false, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: spacing.sidePadding, + ).copyWith( + bottom: spacing.bottomButtonPadding, + ), + child: Align( + alignment: Alignment.bottomCenter, + child: Column( + children: [ + if (_editing) ...[ + nextButton, + ] else ...[ + saveButton, + const SizedBox(height: 8), + previousButton, + ], + if (widget.template != null) ...[ + const SizedBox(height: 8), + deleteButton, + ], + ], + ), + ), + ), + ), + ], ); + + return options.baseScreenBuilder(context, onBackPressed, body); } } diff --git a/packages/flutter_availability/lib/src/ui/widgets/template_week_day_selection.dart b/packages/flutter_availability/lib/src/ui/widgets/template_week_day_selection.dart index be5d25f..b986e30 100644 --- a/packages/flutter_availability/lib/src/ui/widgets/template_week_day_selection.dart +++ b/packages/flutter_availability/lib/src/ui/widgets/template_week_day_selection.dart @@ -61,6 +61,7 @@ class _TemplateWeekDaySelectionState extends State { onDaySelected: (selected) => onDaySelected(selected, days.indexOf(day)), ), + const SizedBox(width: 8), ], ], ), @@ -125,25 +126,22 @@ class _DaySelectionCardLayout extends StatelessWidget { ) : abbreviationTextStyle; - return Padding( - padding: const EdgeInsets.only(left: 8.0), - child: AnimatedContainer( - duration: const Duration(milliseconds: 300), - height: isSelected ? 72 : 64, - width: isSelected ? 72 : 64, - child: ChoiceChip( - shape: RoundedRectangleBorder(borderRadius: options.borderRadius), - padding: EdgeInsets.zero, - label: Center( - child: Text( - day.toUpperCase(), - style: abbreviationTextStyle, - ), + return AnimatedContainer( + duration: const Duration(milliseconds: 300), + height: isSelected ? 72 : 64, + width: isSelected ? 72 : 64, + child: ChoiceChip( + shape: RoundedRectangleBorder(borderRadius: options.borderRadius), + padding: EdgeInsets.zero, + label: Center( + child: Text( + day.toUpperCase(), + style: abbreviationTextStyle, ), - selected: isSelected, - showCheckmark: theme.chipTheme.showCheckmark ?? false, - onSelected: onDaySelected, ), + selected: isSelected, + showCheckmark: theme.chipTheme.showCheckmark ?? false, + onSelected: onDaySelected, ), ); }