fix: remove BasePage from week template modification

The weekday selection has no padding on the right side. To achieve this the screen isn't wrapped with a padding but only all the individual elements except the weekday selection.
This commit is contained in:
Freek van de Ven 2024-07-24 11:18:45 +02:00
parent 4eecef7b34
commit 97318ff8c0
2 changed files with 61 additions and 44 deletions

View file

@ -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,11 +216,11 @@ class _WeekTemplateModificationScreenState
),
);
return options.baseScreenBuilder(
context,
onBackPressed,
BasePage(
body: [
var body = CustomScrollView(
slivers: [
SliverList.list(
children: [
const SizedBox(height: 40),
_WeekTemplateSidePadding(child: title),
const SizedBox(height: 24),
if (_editing) ...[
@ -229,8 +228,22 @@ class _WeekTemplateModificationScreenState
] else ...[
overviewPage,
],
const SizedBox(height: 32),
],
buttons: [
),
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 ...[
@ -244,7 +257,13 @@ class _WeekTemplateModificationScreenState
],
],
),
),
),
),
],
);
return options.baseScreenBuilder(context, onBackPressed, body);
}
}

View file

@ -61,6 +61,7 @@ class _TemplateWeekDaySelectionState extends State<TemplateWeekDaySelection> {
onDaySelected: (selected) =>
onDaySelected(selected, days.indexOf(day)),
),
const SizedBox(width: 8),
],
],
),
@ -125,9 +126,7 @@ class _DaySelectionCardLayout extends StatelessWidget {
)
: abbreviationTextStyle;
return Padding(
padding: const EdgeInsets.only(left: 8.0),
child: AnimatedContainer(
return AnimatedContainer(
duration: const Duration(milliseconds: 300),
height: isSelected ? 72 : 64,
width: isSelected ? 72 : 64,
@ -144,7 +143,6 @@ class _DaySelectionCardLayout extends StatelessWidget {
showCheckmark: theme.chipTheme.showCheckmark ?? false,
onSelected: onDaySelected,
),
),
);
}
}