Skip to content

Commit

Permalink
fix: Add back button to the seed page and adjust styling to seed veri…
Browse files Browse the repository at this point in the history
…fication question text
  • Loading branch information
Blazebrain committed Dec 12, 2024
1 parent 89968c4 commit f62bd80
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 39 deletions.
2 changes: 1 addition & 1 deletion lib/src/screens/seed/pre_seed_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ class PreSeedPage extends InfoPage {

@override
void Function(BuildContext) get onPressed =>
(BuildContext context) => Navigator.of(context).popAndPushNamed(Routes.seed, arguments: true);
(BuildContext context) => Navigator.of(context).pushNamed(Routes.seed, arguments: true);
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class SeedVerificationPage extends BasePage {
)
: SeedVerificationStepView(
walletSeedViewModel: walletSeedViewModel,
questionTextColor: titleColor(context),
),
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import 'package:flutter_mobx/flutter_mobx.dart';
class SeedVerificationStepView extends StatelessWidget {
const SeedVerificationStepView({
required this.walletSeedViewModel,
required this.questionTextColor,
super.key,
});

final WalletSeedViewModel walletSeedViewModel;
final Color questionTextColor;

@override
Widget build(BuildContext context) {
Expand All @@ -33,23 +35,23 @@ class SeedVerificationStepView extends StatelessWidget {
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
color: questionTextColor,
),
),
TextSpan(
text: '${getOrdinal(walletSeedViewModel.currentWordIndex + 1)} ',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w800,
color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
color: questionTextColor,
),
),
TextSpan(
text: S.current.seed_position_question_two,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
color: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
color: questionTextColor,
),
),
],
Expand Down
35 changes: 0 additions & 35 deletions lib/src/screens/seed/wallet_seed_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,6 @@ class WalletSeedPage extends BasePage {
final bool isNewWalletCreated;
final WalletSeedViewModel walletSeedViewModel;

@override
void onClose(BuildContext context) async {
if (isNewWalletCreated) {
final confirmed = await showPopUp<bool>(
context: context,
builder: (BuildContext context) {
return AlertWithTwoActions(
alertDialogKey: ValueKey('wallet_seed_page_seed_alert_dialog_key'),
alertRightActionButtonKey:
ValueKey('wallet_seed_page_seed_alert_confirm_button_key'),
alertLeftActionButtonKey: ValueKey('wallet_seed_page_seed_alert_back_button_key'),
alertTitle: S.of(context).seed_alert_title,
alertContent: S.of(context).seed_alert_content,
leftButtonText: S.of(context).seed_alert_back,
rightButtonText: S.of(context).seed_alert_yes,
actionLeftButton: () => Navigator.of(context).pop(false),
actionRightButton: () => Navigator.of(context).pop(true),
);
},
) ??
false;

if (confirmed) {
Navigator.of(context).popUntil((route) => route.isFirst);
}

return;
}

Navigator.of(context).pop();
}

@override
Widget? leading(BuildContext context) => isNewWalletCreated ? null : super.leading(context);

@override
Widget trailing(BuildContext context) {
final copyImage = Image.asset(
Expand Down

0 comments on commit f62bd80

Please sign in to comment.