From 28b634e6ba475face372ea687649b67b59e798b2 Mon Sep 17 00:00:00 2001 From: Damian Molinski Date: Mon, 14 Oct 2024 12:28:28 +0200 Subject: [PATCH 1/3] feat: account restored panel --- .../recover/recover_seed_phrase_panel.dart | 4 +- .../recover/seed_phrase/restored_panel.dart | 59 +++++++++++++++++++ .../registration/registration_info_panel.dart | 4 +- .../wallet_link/account_role_dialog.dart | 5 +- .../stage/roles_chooser_panel.dart | 2 +- .../widgets/placeholder_panel.dart | 18 ------ .../catalyst_voices_localizations.dart | 24 ++++++++ .../catalyst_voices_localizations_en.dart | 12 ++++ .../catalyst_voices_localizations_es.dart | 12 ++++ .../lib/l10n/intl_en.arb | 6 +- 10 files changed, 122 insertions(+), 24 deletions(-) create mode 100644 catalyst_voices/lib/pages/registration/recover/seed_phrase/restored_panel.dart delete mode 100644 catalyst_voices/lib/pages/registration/widgets/placeholder_panel.dart diff --git a/catalyst_voices/lib/pages/registration/recover/recover_seed_phrase_panel.dart b/catalyst_voices/lib/pages/registration/recover/recover_seed_phrase_panel.dart index 406e21b8877..717b138d194 100644 --- a/catalyst_voices/lib/pages/registration/recover/recover_seed_phrase_panel.dart +++ b/catalyst_voices/lib/pages/registration/recover/recover_seed_phrase_panel.dart @@ -1,9 +1,9 @@ import 'package:catalyst_voices/pages/registration/recover/seed_phrase/account_details_panel.dart'; +import 'package:catalyst_voices/pages/registration/recover/seed_phrase/restored_panel.dart'; import 'package:catalyst_voices/pages/registration/recover/seed_phrase/seed_phrase_input_panel.dart'; import 'package:catalyst_voices/pages/registration/recover/seed_phrase/seed_phrase_instructions_panel.dart'; import 'package:catalyst_voices/pages/registration/recover/seed_phrase/unlock_password_instructions_panel.dart'; import 'package:catalyst_voices/pages/registration/recover/seed_phrase/unlock_password_panel.dart'; -import 'package:catalyst_voices/pages/registration/widgets/placeholder_panel.dart'; import 'package:catalyst_voices_models/catalyst_voices_models.dart'; import 'package:flutter/material.dart'; @@ -25,7 +25,7 @@ class RecoverSeedPhrasePanel extends StatelessWidget { RecoverSeedPhraseStage.unlockPasswordInstructions => const UnlockPasswordInstructionsPanel(), RecoverSeedPhraseStage.unlockPassword => const UnlockPasswordPanel(), - RecoverSeedPhraseStage.success => const PlaceholderPanel(), + RecoverSeedPhraseStage.success => const RestoredPanel(), }; } } diff --git a/catalyst_voices/lib/pages/registration/recover/seed_phrase/restored_panel.dart b/catalyst_voices/lib/pages/registration/recover/seed_phrase/restored_panel.dart new file mode 100644 index 00000000000..26f72e7b120 --- /dev/null +++ b/catalyst_voices/lib/pages/registration/recover/seed_phrase/restored_panel.dart @@ -0,0 +1,59 @@ +import 'package:catalyst_voices/routes/routes.dart'; +import 'package:catalyst_voices/widgets/buttons/voices_filled_button.dart'; +import 'package:catalyst_voices/widgets/buttons/voices_text_button.dart'; +import 'package:catalyst_voices_brands/catalyst_voices_brands.dart'; +import 'package:catalyst_voices_localization/catalyst_voices_localization.dart'; +import 'package:flutter/material.dart'; + +class RestoredPanel extends StatelessWidget { + const RestoredPanel({super.key}); + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + + final textTheme = theme.textTheme; + final colors = theme.colors; + + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox(height: 24), + Text( + context.l10n.recoverySuccessTitle, + style: textTheme.titleLarge?.copyWith( + color: colors.textOnPrimaryLevel1, + ), + ), + const SizedBox(height: 24), + Text( + context.l10n.recoverySuccessSubtitle, + style: textTheme.bodyMedium?.copyWith( + color: colors.textOnPrimaryLevel0, + ), + ), + const Spacer(), + const SizedBox(height: 10), + VoicesFilledButton( + onTap: () => _redirectToDashboard(context), + child: Text(context.l10n.recoverySuccessGoToDashboard), + ), + const SizedBox(height: 10), + VoicesTextButton( + onTap: () => _redirectToMyAccount(context), + child: Text(context.l10n.recoverySuccessGoAccount), + ), + ], + ); + } + + void _redirectToDashboard(BuildContext context) { + Navigator.of(context).pop(); + const DiscoveryRoute().go(context); + } + + void _redirectToMyAccount(BuildContext context) { + Navigator.of(context).pop(); + const AccountRoute().go(context); + } +} diff --git a/catalyst_voices/lib/pages/registration/registration_info_panel.dart b/catalyst_voices/lib/pages/registration/registration_info_panel.dart index a0fe5bf14c1..d27e99a6ab5 100644 --- a/catalyst_voices/lib/pages/registration/registration_info_panel.dart +++ b/catalyst_voices/lib/pages/registration/registration_info_panel.dart @@ -131,7 +131,9 @@ class RegistrationInfoPanel extends StatelessWidget { ), CreateKeychainStep(:final stage) => buildKeychainStageHeader(stage), WalletLinkStep(:final stage) => buildWalletLinkStageHeader(stage), - AccountCompletedStep() => _HeaderStrings(title: 'TODO'), + AccountCompletedStep() => _HeaderStrings( + title: context.l10n.recoverCatalystKeychain, + ), }; } } diff --git a/catalyst_voices/lib/pages/registration/wallet_link/account_role_dialog.dart b/catalyst_voices/lib/pages/registration/wallet_link/account_role_dialog.dart index 6f441b987c7..1b670d444ec 100644 --- a/catalyst_voices/lib/pages/registration/wallet_link/account_role_dialog.dart +++ b/catalyst_voices/lib/pages/registration/wallet_link/account_role_dialog.dart @@ -16,7 +16,10 @@ class AccountRoleDialog extends StatelessWidget { super.key, }); - static Future show(BuildContext context, AccountRole role) async { + static Future show( + BuildContext context, { + required AccountRole role, + }) async { return VoicesDialog.show( context: context, builder: (context) { diff --git a/catalyst_voices/lib/pages/registration/wallet_link/stage/roles_chooser_panel.dart b/catalyst_voices/lib/pages/registration/wallet_link/stage/roles_chooser_panel.dart index 229686a055c..09fdde65615 100644 --- a/catalyst_voices/lib/pages/registration/wallet_link/stage/roles_chooser_panel.dart +++ b/catalyst_voices/lib/pages/registration/wallet_link/stage/roles_chooser_panel.dart @@ -65,7 +65,7 @@ class _BlocRolesChooserContainer extends StatelessWidget { onLearnMore: (role) async { await AccountRoleDialog.show( context, - role, + role: role, ); }, ); diff --git a/catalyst_voices/lib/pages/registration/widgets/placeholder_panel.dart b/catalyst_voices/lib/pages/registration/widgets/placeholder_panel.dart deleted file mode 100644 index 345d404efb7..00000000000 --- a/catalyst_voices/lib/pages/registration/widgets/placeholder_panel.dart +++ /dev/null @@ -1,18 +0,0 @@ -import 'package:catalyst_voices/pages/registration/widgets/registration_stage_navigation.dart'; -import 'package:flutter/material.dart'; - -/// Temporary panel with next/back buttons. -class PlaceholderPanel extends StatelessWidget { - const PlaceholderPanel({super.key}); - - @override - Widget build(BuildContext context) { - return const Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Spacer(), - RegistrationBackNextNavigation(), - ], - ); - } -} diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart index cf7738485b6..ad4067afcae 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart @@ -1659,6 +1659,30 @@ abstract class VoicesLocalizations { /// In en, this message translates to: /// **'With over 300 trillion possible combinations, your 12 word seed phrase is great for keeping your account safe. 

But it can be a bit tedious to enter every single time you want to use the app. 

In this next step, you\'ll set your Unlock Password for your current device. It\'s like a shortcut for proving ownership of your Keychain. 

Whenever you recover your account for the first time on a new device, you\'ll need to use your Catalyst Keychain to get started. Every time after that, you can use your Unlock Password to quickly regain access.'** String get recoveryUnlockPasswordInstructionsSubtitle; + + /// No description provided for @recoverySuccessTitle. + /// + /// In en, this message translates to: + /// **'Congratulations your Catalyst 
Keychain is restored!'** + String get recoverySuccessTitle; + + /// No description provided for @recoverySuccessSubtitle. + /// + /// In en, this message translates to: + /// **'You have successfully restored your Catalyst Keychain, and unlocked Catalyst Voices on this device.'** + String get recoverySuccessSubtitle; + + /// No description provided for @recoverySuccessGoToDashboard. + /// + /// In en, this message translates to: + /// **'Jump into the Discovery space / Dashboard'** + String get recoverySuccessGoToDashboard; + + /// No description provided for @recoverySuccessGoAccount. + /// + /// In en, this message translates to: + /// **'Check my account'** + String get recoverySuccessGoAccount; } class _VoicesLocalizationsDelegate extends LocalizationsDelegate { diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart index f183349f047..c9e7c7560e7 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart @@ -870,4 +870,16 @@ class VoicesLocalizationsEn extends VoicesLocalizations { @override String get recoveryUnlockPasswordInstructionsSubtitle => 'With over 300 trillion possible combinations, your 12 word seed phrase is great for keeping your account safe. 

But it can be a bit tedious to enter every single time you want to use the app. 

In this next step, you\'ll set your Unlock Password for your current device. It\'s like a shortcut for proving ownership of your Keychain. 

Whenever you recover your account for the first time on a new device, you\'ll need to use your Catalyst Keychain to get started. Every time after that, you can use your Unlock Password to quickly regain access.'; + + @override + String get recoverySuccessTitle => 'Congratulations your Catalyst 
Keychain is restored!'; + + @override + String get recoverySuccessSubtitle => 'You have successfully restored your Catalyst Keychain, and unlocked Catalyst Voices on this device.'; + + @override + String get recoverySuccessGoToDashboard => 'Jump into the Discovery space / Dashboard'; + + @override + String get recoverySuccessGoAccount => 'Check my account'; } diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart index b60bb8d8449..74d015c8711 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart @@ -870,4 +870,16 @@ class VoicesLocalizationsEs extends VoicesLocalizations { @override String get recoveryUnlockPasswordInstructionsSubtitle => 'With over 300 trillion possible combinations, your 12 word seed phrase is great for keeping your account safe. 

But it can be a bit tedious to enter every single time you want to use the app. 

In this next step, you\'ll set your Unlock Password for your current device. It\'s like a shortcut for proving ownership of your Keychain. 

Whenever you recover your account for the first time on a new device, you\'ll need to use your Catalyst Keychain to get started. Every time after that, you can use your Unlock Password to quickly regain access.'; + + @override + String get recoverySuccessTitle => 'Congratulations your Catalyst 
Keychain is restored!'; + + @override + String get recoverySuccessSubtitle => 'You have successfully restored your Catalyst Keychain, and unlocked Catalyst Voices on this device.'; + + @override + String get recoverySuccessGoToDashboard => 'Jump into the Discovery space / Dashboard'; + + @override + String get recoverySuccessGoAccount => 'Check my account'; } diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb b/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb index 9e75ac287b4..afe2ab0b2b9 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb @@ -881,5 +881,9 @@ "recoveryAccountSuccessTitle": "Keychain recovered successfully!", "recoveryAccountDetailsAction": "Set unlock password for this device", "recoveryUnlockPasswordInstructionsTitle": "Set your Catalyst unlock password f\u2028or this device", - "recoveryUnlockPasswordInstructionsSubtitle": "With over 300 trillion possible combinations, your 12 word seed phrase is great for keeping your account safe. \u2028\u2028But it can be a bit tedious to enter every single time you want to use the app. \u2028\u2028In this next step, you'll set your Unlock Password for your current device. It's like a shortcut for proving ownership of your Keychain. \u2028\u2028Whenever you recover your account for the first time on a new device, you'll need to use your Catalyst Keychain to get started. Every time after that, you can use your Unlock Password to quickly regain access." + "recoveryUnlockPasswordInstructionsSubtitle": "With over 300 trillion possible combinations, your 12 word seed phrase is great for keeping your account safe. \u2028\u2028But it can be a bit tedious to enter every single time you want to use the app. \u2028\u2028In this next step, you'll set your Unlock Password for your current device. It's like a shortcut for proving ownership of your Keychain. \u2028\u2028Whenever you recover your account for the first time on a new device, you'll need to use your Catalyst Keychain to get started. Every time after that, you can use your Unlock Password to quickly regain access.", + "recoverySuccessTitle": "Congratulations your Catalyst \u2028Keychain is restored!", + "recoverySuccessSubtitle": "You have successfully restored your Catalyst Keychain, and unlocked Catalyst Voices on this device.", + "recoverySuccessGoToDashboard": "Jump into the Discovery space / Dashboard", + "recoverySuccessGoAccount": "Check my account" } \ No newline at end of file From f90b055ab2027a1cdb722073399a69e53082e66f Mon Sep 17 00:00:00 2001 From: Damian Molinski Date: Mon, 14 Oct 2024 12:34:22 +0200 Subject: [PATCH 2/3] docs: check local keychains --- .../lib/src/registration/cubits/recover_cubit.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/catalyst_voices/packages/catalyst_voices_blocs/lib/src/registration/cubits/recover_cubit.dart b/catalyst_voices/packages/catalyst_voices_blocs/lib/src/registration/cubits/recover_cubit.dart index 2e7ffb80e8f..c961b7e75eb 100644 --- a/catalyst_voices/packages/catalyst_voices_blocs/lib/src/registration/cubits/recover_cubit.dart +++ b/catalyst_voices/packages/catalyst_voices_blocs/lib/src/registration/cubits/recover_cubit.dart @@ -41,6 +41,9 @@ final class RecoverCubit extends Cubit } } + // Note. this function will have more sense when we'll implement + // multi account feature. Then we can have multiple keychains and lookup + // those already stored locally. @override Future checkLocalKeychains() async { // TODO(damian-molinski): to be implemented From 2652655249dab186fb3394b8e386734e6382b5bd Mon Sep 17 00:00:00 2001 From: Damian Molinski Date: Mon, 14 Oct 2024 13:31:01 +0200 Subject: [PATCH 3/3] feat: exit dialog --- .../registration/registration_dialog.dart | 45 +++++++-- .../registration_exit_confirm_dialog.dart | 55 ----------- .../widgets/exit_confirm_dialog.dart | 96 +++++++++++++++++++ .../catalyst_voices_localizations.dart | 22 ++++- .../catalyst_voices_localizations_en.dart | 11 ++- .../catalyst_voices_localizations_es.dart | 11 ++- .../lib/l10n/intl_en.arb | 7 +- .../src/registration/registration_step.dart | 16 ++++ 8 files changed, 195 insertions(+), 68 deletions(-) delete mode 100644 catalyst_voices/lib/pages/registration/registration_exit_confirm_dialog.dart create mode 100644 catalyst_voices/lib/pages/registration/widgets/exit_confirm_dialog.dart diff --git a/catalyst_voices/lib/pages/registration/registration_dialog.dart b/catalyst_voices/lib/pages/registration/registration_dialog.dart index c9449974ec9..6944033a1e0 100644 --- a/catalyst_voices/lib/pages/registration/registration_dialog.dart +++ b/catalyst_voices/lib/pages/registration/registration_dialog.dart @@ -3,10 +3,11 @@ import 'dart:async'; import 'package:catalyst_voices/common/error_handler.dart'; import 'package:catalyst_voices/dependency/dependencies.dart'; import 'package:catalyst_voices/pages/registration/registration_details_panel.dart'; -import 'package:catalyst_voices/pages/registration/registration_exit_confirm_dialog.dart'; import 'package:catalyst_voices/pages/registration/registration_info_panel.dart'; +import 'package:catalyst_voices/pages/registration/widgets/exit_confirm_dialog.dart'; import 'package:catalyst_voices/widgets/widgets.dart'; import 'package:catalyst_voices_blocs/catalyst_voices_blocs.dart'; +import 'package:catalyst_voices_models/catalyst_voices_models.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; @@ -54,7 +55,12 @@ class _RegistrationDialogState extends State child: PopScope( canPop: false, onPopInvokedWithResult: (didPop, result) { - unawaited(_confirmedExit(context, didPop: didPop)); + unawaited( + _handlePop( + context, + didPop: didPop, + ), + ); }, child: const VoicesTwoPaneDialog( left: RegistrationInfoPanel(), @@ -64,7 +70,7 @@ class _RegistrationDialogState extends State ); } - Future _confirmedExit( + Future _handlePop( BuildContext context, { required bool didPop, }) async { @@ -72,13 +78,38 @@ class _RegistrationDialogState extends State return; } - final confirmed = await VoicesQuestionDialog.show( - context, - builder: (_) => const RegistrationExitConfirmDialog(), - ); + final state = _cubit.state; + final hasProgress = (state.progress ?? 0.0) > 0.0; + if (!hasProgress) { + Navigator.of(context).pop(); + return; + } + + final confirmed = await _confirmExit(context, step: state.step); if (context.mounted && confirmed) { Navigator.of(context).pop(); } } + + Future _confirmExit( + BuildContext context, { + required RegistrationStep step, + }) { + if (step.isRegistrationFlow) { + return VoicesQuestionDialog.show( + context, + builder: (_) => const RegistrationExitConfirmDialog(), + ); + } + + if (step.isRecoverFlow) { + return VoicesQuestionDialog.show( + context, + builder: (_) => const RecoveryExitConfirmDialog(), + ); + } + + return Future.value(true); + } } diff --git a/catalyst_voices/lib/pages/registration/registration_exit_confirm_dialog.dart b/catalyst_voices/lib/pages/registration/registration_exit_confirm_dialog.dart deleted file mode 100644 index e8a8a1f0fa1..00000000000 --- a/catalyst_voices/lib/pages/registration/registration_exit_confirm_dialog.dart +++ /dev/null @@ -1,55 +0,0 @@ -import 'package:catalyst_voices/widgets/widgets.dart'; -import 'package:catalyst_voices_assets/catalyst_voices_assets.dart'; -import 'package:catalyst_voices_brands/catalyst_voices_brands.dart'; -import 'package:catalyst_voices_localization/catalyst_voices_localization.dart'; -import 'package:flutter/material.dart'; - -class RegistrationExitConfirmDialog extends StatelessWidget { - const RegistrationExitConfirmDialog({super.key}); - - @override - Widget build(BuildContext context) { - final l10n = context.l10n; - - return VoicesQuestionDialog( - title: Text(l10n.warning.toUpperCase()), - icon: const _WarningIcon(), - subtitle: Text(l10n.registrationExitConfirmDialogSubtitle.toUpperCase()), - content: Padding( - padding: const EdgeInsets.only(bottom: 30), - child: Text(l10n.registrationExitConfirmDialogContent), - ), - actions: [ - VoicesQuestionActionItem.negative( - l10n.registrationExitConfirmDialogContinue, - type: VoicesQuestionActionType.filled, - ), - VoicesQuestionActionItem.positive( - l10n.registrationExitConfirmDialogCancel, - type: VoicesQuestionActionType.text, - ), - ], - ); - } -} - -class _WarningIcon extends StatelessWidget { - const _WarningIcon(); - - @override - Widget build(BuildContext context) { - final theme = Theme.of(context); - final color = theme.colors.iconsError!; - - return VoicesAvatar( - border: Border.all( - color: color, - width: 3, - ), - icon: VoicesAssets.icons.exclamation.buildIcon(size: 36), - backgroundColor: Colors.transparent, - foregroundColor: color, - radius: 40, - ); - } -} diff --git a/catalyst_voices/lib/pages/registration/widgets/exit_confirm_dialog.dart b/catalyst_voices/lib/pages/registration/widgets/exit_confirm_dialog.dart new file mode 100644 index 00000000000..95d0948a673 --- /dev/null +++ b/catalyst_voices/lib/pages/registration/widgets/exit_confirm_dialog.dart @@ -0,0 +1,96 @@ +import 'package:catalyst_voices/widgets/widgets.dart'; +import 'package:catalyst_voices_assets/catalyst_voices_assets.dart'; +import 'package:catalyst_voices_brands/catalyst_voices_brands.dart'; +import 'package:catalyst_voices_localization/catalyst_voices_localization.dart'; +import 'package:flutter/material.dart'; + +class RecoveryExitConfirmDialog extends StatelessWidget { + const RecoveryExitConfirmDialog({super.key}); + + @override + Widget build(BuildContext context) { + return ExitConfirmDialog( + title: context.l10n.warning, + subtitle: context.l10n.recoveryExitConfirmDialogSubtitle, + content: context.l10n.recoveryExitConfirmDialogContent, + positive: context.l10n.recoveryExitConfirmDialogContinue, + negative: context.l10n.cancelAnyways, + ); + } +} + +class RegistrationExitConfirmDialog extends StatelessWidget { + const RegistrationExitConfirmDialog({super.key}); + + @override + Widget build(BuildContext context) { + return ExitConfirmDialog( + title: context.l10n.warning, + subtitle: context.l10n.registrationExitConfirmDialogSubtitle, + content: context.l10n.registrationExitConfirmDialogContent, + positive: context.l10n.registrationExitConfirmDialogContinue, + negative: context.l10n.cancelAnyways, + ); + } +} + +class ExitConfirmDialog extends StatelessWidget { + final String title; + final String subtitle; + final String content; + final String positive; + final String negative; + + const ExitConfirmDialog({ + super.key, + required this.title, + required this.subtitle, + required this.content, + required this.positive, + required this.negative, + }); + + @override + Widget build(BuildContext context) { + return VoicesQuestionDialog( + title: Text(title.toUpperCase()), + icon: const _WarningIcon(), + subtitle: Text(subtitle.toUpperCase()), + content: Padding( + padding: const EdgeInsets.only(bottom: 30), + child: Text(content), + ), + actions: [ + VoicesQuestionActionItem.negative( + positive, + type: VoicesQuestionActionType.filled, + ), + VoicesQuestionActionItem.positive( + negative, + type: VoicesQuestionActionType.text, + ), + ], + ); + } +} + +class _WarningIcon extends StatelessWidget { + const _WarningIcon(); + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final color = theme.colors.iconsError!; + + return VoicesAvatar( + border: Border.all( + color: color, + width: 3, + ), + icon: VoicesAssets.icons.exclamation.buildIcon(size: 36), + backgroundColor: Colors.transparent, + foregroundColor: color, + radius: 40, + ); + } +} diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart index ad4067afcae..b6869d9e60f 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations.dart @@ -1552,11 +1552,11 @@ abstract class VoicesLocalizations { /// **'Continue keychain creation'** String get registrationExitConfirmDialogContinue; - /// No description provided for @registrationExitConfirmDialogCancel. + /// No description provided for @cancelAnyways. /// /// In en, this message translates to: /// **'Cancel anyway'** - String get registrationExitConfirmDialogCancel; + String get cancelAnyways; /// No description provided for @recoverCatalystKeychain. /// @@ -1683,6 +1683,24 @@ abstract class VoicesLocalizations { /// In en, this message translates to: /// **'Check my account'** String get recoverySuccessGoAccount; + + /// No description provided for @recoveryExitConfirmDialogSubtitle. + /// + /// In en, this message translates to: + /// **'12 word keychain restoration incomplete'** + String get recoveryExitConfirmDialogSubtitle; + + /// No description provided for @recoveryExitConfirmDialogContent. + /// + /// In en, this message translates to: + /// **'Please continue your Catalyst Keychain restoration, if you cancel all input will be lost.'** + String get recoveryExitConfirmDialogContent; + + /// No description provided for @recoveryExitConfirmDialogContinue. + /// + /// In en, this message translates to: + /// **'Continue recovery process'** + String get recoveryExitConfirmDialogContinue; } class _VoicesLocalizationsDelegate extends LocalizationsDelegate { diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart index c9e7c7560e7..d4ad0ad93ab 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_en.dart @@ -818,7 +818,7 @@ class VoicesLocalizationsEn extends VoicesLocalizations { String get registrationExitConfirmDialogContinue => 'Continue keychain creation'; @override - String get registrationExitConfirmDialogCancel => 'Cancel anyway'; + String get cancelAnyways => 'Cancel anyway'; @override String get recoverCatalystKeychain => 'Restore Catalyst keychain'; @@ -882,4 +882,13 @@ class VoicesLocalizationsEn extends VoicesLocalizations { @override String get recoverySuccessGoAccount => 'Check my account'; + + @override + String get recoveryExitConfirmDialogSubtitle => '12 word keychain restoration incomplete'; + + @override + String get recoveryExitConfirmDialogContent => 'Please continue your Catalyst Keychain restoration, if you cancel all input will be lost.'; + + @override + String get recoveryExitConfirmDialogContinue => 'Continue recovery process'; } diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart index 74d015c8711..16aed19d4f3 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/generated/catalyst_voices_localizations_es.dart @@ -818,7 +818,7 @@ class VoicesLocalizationsEs extends VoicesLocalizations { String get registrationExitConfirmDialogContinue => 'Continue keychain creation'; @override - String get registrationExitConfirmDialogCancel => 'Cancel anyway'; + String get cancelAnyways => 'Cancel anyway'; @override String get recoverCatalystKeychain => 'Restore Catalyst keychain'; @@ -882,4 +882,13 @@ class VoicesLocalizationsEs extends VoicesLocalizations { @override String get recoverySuccessGoAccount => 'Check my account'; + + @override + String get recoveryExitConfirmDialogSubtitle => '12 word keychain restoration incomplete'; + + @override + String get recoveryExitConfirmDialogContent => 'Please continue your Catalyst Keychain restoration, if you cancel all input will be lost.'; + + @override + String get recoveryExitConfirmDialogContinue => 'Continue recovery process'; } diff --git a/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb b/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb index afe2ab0b2b9..d3a09880893 100644 --- a/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb +++ b/catalyst_voices/packages/catalyst_voices_localization/lib/l10n/intl_en.arb @@ -864,7 +864,7 @@ "registrationExitConfirmDialogSubtitle": "Account creation incomplete!", "registrationExitConfirmDialogContent": "If attempt to leave without creating your keychain - account creation will be incomplete. \u2028\u2028You are not able to login without \u2028completing your keychain.", "registrationExitConfirmDialogContinue": "Continue keychain creation", - "registrationExitConfirmDialogCancel": "Cancel anyway", + "cancelAnyways": "Cancel anyway", "recoverCatalystKeychain": "Restore Catalyst keychain", "recoverKeychainMethodsTitle": "Restore your Catalyst Keychain", "recoverKeychainMethodsNoKeychainFound": "No Catalyst Keychain found on this device.", @@ -885,5 +885,8 @@ "recoverySuccessTitle": "Congratulations your Catalyst \u2028Keychain is restored!", "recoverySuccessSubtitle": "You have successfully restored your Catalyst Keychain, and unlocked Catalyst Voices on this device.", "recoverySuccessGoToDashboard": "Jump into the Discovery space / Dashboard", - "recoverySuccessGoAccount": "Check my account" + "recoverySuccessGoAccount": "Check my account", + "recoveryExitConfirmDialogSubtitle": "12 word keychain restoration incomplete", + "recoveryExitConfirmDialogContent": "Please continue your Catalyst Keychain restoration, if you cancel all input will be lost.", + "recoveryExitConfirmDialogContinue": "Continue recovery process" } \ No newline at end of file diff --git a/catalyst_voices/packages/catalyst_voices_models/lib/src/registration/registration_step.dart b/catalyst_voices/packages/catalyst_voices_models/lib/src/registration/registration_step.dart index c9157a9e68b..bcdec7bfa82 100644 --- a/catalyst_voices/packages/catalyst_voices_models/lib/src/registration/registration_step.dart +++ b/catalyst_voices/packages/catalyst_voices_models/lib/src/registration/registration_step.dart @@ -7,6 +7,10 @@ import 'package:equatable/equatable.dart'; sealed class RegistrationStep extends Equatable { const RegistrationStep(); + bool get isRegistrationFlow => false; + + bool get isRecoverFlow => false; + @override List get props => []; } @@ -26,6 +30,9 @@ final class SeedPhraseRecoverStep extends RegistrationStep { this.stage = RecoverSeedPhraseStage.seedPhraseInstructions, }); + @override + bool get isRecoverFlow => true; + @override List get props => [stage]; } @@ -37,12 +44,18 @@ final class CreateKeychainStep extends RegistrationStep { this.stage = CreateKeychainStage.splash, }); + @override + bool get isRegistrationFlow => true; + @override List get props => [stage]; } final class FinishAccountCreationStep extends RegistrationStep { const FinishAccountCreationStep(); + + @override + bool get isRegistrationFlow => true; } final class WalletLinkStep extends RegistrationStep { @@ -52,6 +65,9 @@ final class WalletLinkStep extends RegistrationStep { this.stage = WalletLinkStage.intro, }); + @override + bool get isRegistrationFlow => true; + @override List get props => [stage]; }