mirror of
https://github.com/Iconica-Development/flutter_availability.git
synced 2025-05-19 21:23:44 +02:00
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:
parent
4eecef7b34
commit
97318ff8c0
2 changed files with 61 additions and 44 deletions
|
@ -1,7 +1,6 @@
|
||||||
import "package:flutter/material.dart";
|
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/template_daydata_view_model.dart";
|
||||||
import "package:flutter_availability/src/ui/view_models/week_template_view_models.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/color_selection.dart";
|
||||||
import "package:flutter_availability/src/ui/widgets/template_name_input.dart";
|
import "package:flutter_availability/src/ui/widgets/template_name_input.dart";
|
||||||
import "package:flutter_availability/src/ui/widgets/template_time_break.dart";
|
import "package:flutter_availability/src/ui/widgets/template_time_break.dart";
|
||||||
|
@ -217,11 +216,11 @@ class _WeekTemplateModificationScreenState
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
return options.baseScreenBuilder(
|
var body = CustomScrollView(
|
||||||
context,
|
slivers: [
|
||||||
onBackPressed,
|
SliverList.list(
|
||||||
BasePage(
|
children: [
|
||||||
body: [
|
const SizedBox(height: 40),
|
||||||
_WeekTemplateSidePadding(child: title),
|
_WeekTemplateSidePadding(child: title),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
if (_editing) ...[
|
if (_editing) ...[
|
||||||
|
@ -229,8 +228,22 @@ class _WeekTemplateModificationScreenState
|
||||||
] else ...[
|
] else ...[
|
||||||
overviewPage,
|
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) ...[
|
if (_editing) ...[
|
||||||
nextButton,
|
nextButton,
|
||||||
] else ...[
|
] else ...[
|
||||||
|
@ -244,7 +257,13 @@ class _WeekTemplateModificationScreenState
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return options.baseScreenBuilder(context, onBackPressed, body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,7 @@ class _TemplateWeekDaySelectionState extends State<TemplateWeekDaySelection> {
|
||||||
onDaySelected: (selected) =>
|
onDaySelected: (selected) =>
|
||||||
onDaySelected(selected, days.indexOf(day)),
|
onDaySelected(selected, days.indexOf(day)),
|
||||||
),
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -125,9 +126,7 @@ class _DaySelectionCardLayout extends StatelessWidget {
|
||||||
)
|
)
|
||||||
: abbreviationTextStyle;
|
: abbreviationTextStyle;
|
||||||
|
|
||||||
return Padding(
|
return AnimatedContainer(
|
||||||
padding: const EdgeInsets.only(left: 8.0),
|
|
||||||
child: AnimatedContainer(
|
|
||||||
duration: const Duration(milliseconds: 300),
|
duration: const Duration(milliseconds: 300),
|
||||||
height: isSelected ? 72 : 64,
|
height: isSelected ? 72 : 64,
|
||||||
width: isSelected ? 72 : 64,
|
width: isSelected ? 72 : 64,
|
||||||
|
@ -144,7 +143,6 @@ class _DaySelectionCardLayout extends StatelessWidget {
|
||||||
showCheckmark: theme.chipTheme.showCheckmark ?? false,
|
showCheckmark: theme.chipTheme.showCheckmark ?? false,
|
||||||
onSelected: onDaySelected,
|
onSelected: onDaySelected,
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue