Skip to content

Commit

Permalink
feat(#717): adapt bottom widgets spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Sep 2, 2024
1 parent 3fb3699 commit 45e3b93
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/lib/onboarding/pages/onboarding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class OnboardingPage extends HookWidget {
final iconSize = 32.0;
final sidePadding = PharMeTheme.mediumSpace;
final indicatorSize = PharMeTheme.smallSpace;
final indicatorPadding = PharMeTheme.mediumSpace;

double getTopPadding(BuildContext context) {
return MediaQuery.of(context).padding.top + sidePadding;
Expand All @@ -19,8 +20,13 @@ class OnboardingPage extends HookWidget {
return MediaQuery.of(context).padding.bottom + PharMeTheme.smallSpace;
}

double getBottomSpace(BuildContext context) {
return iconSize + 2 * getBottomPadding(context) + 4 * indicatorSize;
double getBottomSpace(context) {
// Icon button height and indicators
final bottomWidgetsSize = iconSize + indicatorSize + indicatorPadding;
const spaceBetweenBottomWidgets = PharMeTheme.mediumToLargeSpace;
return getBottomPadding(context)
+ bottomWidgetsSize
+ spaceBetweenBottomWidgets;
}

final _pages = [
Expand Down Expand Up @@ -129,7 +135,7 @@ class OnboardingPage extends HookWidget {
),
),
Positioned(
bottom: getBottomSpace(context) - 2 * indicatorSize,
bottom: getBottomSpace(context) - indicatorSize - indicatorPadding,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: _buildPageIndicator(context, currentPage.value),
Expand Down

0 comments on commit 45e3b93

Please sign in to comment.