Skip to content

Commit

Permalink
feat(app): better app tour button size
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Sep 6, 2024
1 parent 79371c1 commit f889934
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/lib/common/widgets/direction_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class DirectionButton extends StatelessWidget {
required this.text,
required this.onPressed,
this.iconSize = 32,
this.buttonTextStyle,
this.emphasize = false,
this.onDarkBackground = false,
});
Expand All @@ -19,6 +20,7 @@ class DirectionButton extends StatelessWidget {
final String text;
final FutureOr<void> Function() onPressed;
final double iconSize;
final TextStyle? buttonTextStyle;
final bool emphasize;
final bool onDarkBackground;

Expand All @@ -43,10 +45,12 @@ class DirectionButton extends StatelessWidget {
color: textColor,
size: iconSize,
);
final buttonTextBaseStyle = buttonTextStyle ??
PharMeTheme.textTheme.titleLarge;
final buttonText = Flexible(
child: Text(
text,
style: PharMeTheme.textTheme.titleLarge!.copyWith(
style: buttonTextBaseStyle!.copyWith(
color: textColor,
overflow: TextOverflow.fade,
),
Expand Down
9 changes: 8 additions & 1 deletion app/lib/common/widgets/tutorial/tutorial_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ class TutorialBuilder extends HookWidget {
) {
final isFirstPage = currentPageIndex.value == 0;
final isLastPage = currentPageIndex.value == pages.length - 1;
final directionButtonTextStyle =
PharMeTheme.textTheme.titleLarge!.copyWith(fontSize: 20);
const directionButtonIconSize = 22.0;
return Row(
mainAxisAlignment: isFirstPage
? MainAxisAlignment.end
Expand All @@ -152,6 +155,8 @@ class TutorialBuilder extends HookWidget {
direction: ButtonDirection.backward,
onPressed: () => currentPageIndex.value = currentPageIndex.value - 1,
text: context.l10n.onboarding_prev,
buttonTextStyle: directionButtonTextStyle,
iconSize: directionButtonIconSize,
),
DirectionButton(
direction: ButtonDirection.forward,
Expand All @@ -162,7 +167,9 @@ class TutorialBuilder extends HookWidget {
? lastNextButtonText!
: context.l10n.action_continue,
emphasize: true,
),
buttonTextStyle: directionButtonTextStyle,
iconSize: directionButtonIconSize,
),
],
);
}
Expand Down

0 comments on commit f889934

Please sign in to comment.