From d8e5b8e3052790300eee5c2468fd44669c0fe776 Mon Sep 17 00:00:00 2001 From: likho Date: Fri, 15 Mar 2024 13:26:50 +0200 Subject: [PATCH] Add frost mascot and dialog --- .../frost_step_explanation_dialog.dart | 65 +++++++++++++++++++ ...irm_new_frost_ms_wallet_creation_view.dart | 9 ++- .../new/create_new_frost_ms_wallet_view.dart | 9 ++- .../new/frost_share_commitments_view.dart | 7 +- .../frost_ms/new/frost_share_shares_view.dart | 8 ++- .../new/import_new_frost_ms_wallet_view.dart | 10 ++- .../new/share_new_multisig_config_view.dart | 9 ++- .../restore/restore_frost_ms_wallet_view.dart | 9 ++- .../{FrostMascot.dart => frost_mascot.dart} | 18 +++-- .../resharing/finish_resharing_view.dart | 10 ++- .../new/new_continue_sharing_view.dart | 16 ++--- .../new/new_import_resharer_config_view.dart | 9 ++- .../new/new_start_resharing_view.dart | 16 ++--- 13 files changed, 139 insertions(+), 56 deletions(-) create mode 100644 lib/pages/add_wallet_views/frost_ms/frost_step_explanation_dialog.dart rename lib/pages/{FrostMascot.dart => frost_mascot.dart} (66%) diff --git a/lib/pages/add_wallet_views/frost_ms/frost_step_explanation_dialog.dart b/lib/pages/add_wallet_views/frost_ms/frost_step_explanation_dialog.dart new file mode 100644 index 000000000..102bab1e5 --- /dev/null +++ b/lib/pages/add_wallet_views/frost_ms/frost_step_explanation_dialog.dart @@ -0,0 +1,65 @@ +/* + * This file is part of Stack Wallet. + * + * Copyright (c) 2023 Cypher Stack + * All Rights Reserved. + * The code is distributed under GPLv3 license, see LICENSE file for details. + * Generated by Cypher Stack on 2023-05-26 + * + */ + +import 'package:flutter/material.dart'; +import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/widgets/desktop/secondary_button.dart'; +import 'package:stackwallet/widgets/stack_dialog.dart'; + +class FrostStepExplanationDialog extends StatelessWidget { + final String title; + final String body; + const FrostStepExplanationDialog({super.key, required this.title, required this.body}); + + @override + Widget build(BuildContext context) { + return StackDialogBase( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: STextStyles.titleBold12(context), + ), + const SizedBox( + height: 12, + ), + Text( + body, + style: STextStyles.baseXS(context), + ), + ], + ), + ), + ), + const SizedBox( + height: 24, + ), + Row( + children: [ + const Spacer(), + Expanded( + child: SecondaryButton( + label: "Close", + onPressed: Navigator.of(context).pop, + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/lib/pages/add_wallet_views/frost_ms/new/confirm_new_frost_ms_wallet_creation_view.dart b/lib/pages/add_wallet_views/frost_ms/new/confirm_new_frost_ms_wallet_creation_view.dart index c1797cd6e..ffd1127b6 100644 --- a/lib/pages/add_wallet_views/frost_ms/new/confirm_new_frost_ms_wallet_creation_view.dart +++ b/lib/pages/add_wallet_views/frost_ms/new/confirm_new_frost_ms_wallet_creation_view.dart @@ -4,7 +4,7 @@ import 'dart:typed_data'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; -import 'package:stackwallet/pages/FrostMascot.dart'; +import 'package:stackwallet/pages/frost_mascot.dart'; import 'package:stackwallet/pages/home_view/home_view.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart'; import 'package:stackwallet/pages_desktop_specific/desktop_home_view.dart'; @@ -34,7 +34,7 @@ import 'package:stackwallet/widgets/detail_item.dart'; import 'package:stackwallet/widgets/dialogs/frost_interruption_dialog.dart'; import 'package:stackwallet/widgets/loading_indicator.dart'; -import '../../../../wallets/isar/models/wallet_info.dart'; +import 'package:stackwallet/wallets/isar/models/wallet_info.dart'; class ConfirmNewFrostMSWalletCreationView extends ConsumerStatefulWidget { const ConfirmNewFrostMSWalletCreationView({ @@ -103,7 +103,10 @@ class _ConfirmNewFrostMSWalletCreationViewState ); }, ), - trailing: const FrostMascot(), + trailing: FrostMascot( + title: 'Lorem ipsum', + body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, ', + ), ), body: SizedBox( width: 480, diff --git a/lib/pages/add_wallet_views/frost_ms/new/create_new_frost_ms_wallet_view.dart b/lib/pages/add_wallet_views/frost_ms/new/create_new_frost_ms_wallet_view.dart index d1799bc5e..9f42a3fa6 100644 --- a/lib/pages/add_wallet_views/frost_ms/new/create_new_frost_ms_wallet_view.dart +++ b/lib/pages/add_wallet_views/frost_ms/new/create_new_frost_ms_wallet_view.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:stackwallet/pages/FrostMascot.dart'; +import 'package:stackwallet/pages/frost_mascot.dart'; import 'package:stackwallet/pages/add_wallet_views/frost_ms/new/share_new_multisig_config_view.dart'; import 'package:stackwallet/providers/frost_wallet/frost_wallet_providers.dart'; import 'package:stackwallet/services/frost.dart'; @@ -118,10 +118,13 @@ class _NewFrostMsWalletViewState condition: Util.isDesktop, builder: (child) => DesktopScaffold( background: Theme.of(context).extension()!.background, - appBar: const DesktopAppBar( + appBar: DesktopAppBar( isCompactHeight: false, leading: AppBarBackButton(), - trailing: FrostMascot(), + trailing: FrostMascot( + title: 'Lorem ipsum', + body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, ', + ), ), body: SizedBox( width: 480, diff --git a/lib/pages/add_wallet_views/frost_ms/new/frost_share_commitments_view.dart b/lib/pages/add_wallet_views/frost_ms/new/frost_share_commitments_view.dart index 282f1716c..1234dbf8a 100644 --- a/lib/pages/add_wallet_views/frost_ms/new/frost_share_commitments_view.dart +++ b/lib/pages/add_wallet_views/frost_ms/new/frost_share_commitments_view.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:qr_flutter/qr_flutter.dart'; -import 'package:stackwallet/pages/FrostMascot.dart'; +import 'package:stackwallet/pages/frost_mascot.dart'; import 'package:stackwallet/pages/add_wallet_views/frost_ms/new/frost_share_shares_view.dart'; import 'package:stackwallet/pages/home_view/home_view.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart'; @@ -121,7 +121,10 @@ class _FrostShareCommitmentsViewState ); }, ), - trailing: const FrostMascot(), + trailing: FrostMascot( + title: 'Lorem ipsum', + body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, ', + ), ), body: SizedBox( width: 480, diff --git a/lib/pages/add_wallet_views/frost_ms/new/frost_share_shares_view.dart b/lib/pages/add_wallet_views/frost_ms/new/frost_share_shares_view.dart index 33fdcefcf..20ac39c03 100644 --- a/lib/pages/add_wallet_views/frost_ms/new/frost_share_shares_view.dart +++ b/lib/pages/add_wallet_views/frost_ms/new/frost_share_shares_view.dart @@ -3,12 +3,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:qr_flutter/qr_flutter.dart'; -import 'package:stackwallet/pages/FrostMascot.dart'; +import 'package:stackwallet/pages/frost_mascot.dart'; import 'package:stackwallet/pages/add_wallet_views/frost_ms/new/confirm_new_frost_ms_wallet_creation_view.dart'; import 'package:stackwallet/pages/home_view/home_view.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart'; import 'package:stackwallet/pages_desktop_specific/desktop_home_view.dart'; -import 'package:stackwallet/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart'; import 'package:stackwallet/providers/frost_wallet/frost_wallet_providers.dart'; import 'package:stackwallet/services/frost.dart'; import 'package:stackwallet/themes/stack_colors.dart'; @@ -121,7 +120,10 @@ class _FrostShareSharesViewState extends ConsumerState { ); }, ), - trailing: const FrostMascot(), + trailing: FrostMascot( + title: 'Lorem ipsum', + body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, ', + ), ), body: SizedBox( width: 480, diff --git a/lib/pages/add_wallet_views/frost_ms/new/import_new_frost_ms_wallet_view.dart b/lib/pages/add_wallet_views/frost_ms/new/import_new_frost_ms_wallet_view.dart index 1b08b045d..4eeb3a045 100644 --- a/lib/pages/add_wallet_views/frost_ms/new/import_new_frost_ms_wallet_view.dart +++ b/lib/pages/add_wallet_views/frost_ms/new/import_new_frost_ms_wallet_view.dart @@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/add_wallet_views/frost_ms/new/frost_share_commitments_view.dart'; -import 'package:stackwallet/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart'; import 'package:stackwallet/providers/frost_wallet/frost_wallet_providers.dart'; import 'package:stackwallet/services/frost.dart'; import 'package:stackwallet/themes/stack_colors.dart'; @@ -25,6 +24,8 @@ import 'package:stackwallet/widgets/stack_dialog.dart'; import 'package:stackwallet/widgets/stack_text_field.dart'; import 'package:stackwallet/widgets/textfield_icon_button.dart'; +import 'package:stackwallet/pages/frost_mascot.dart'; + class ImportNewFrostMsWalletView extends ConsumerStatefulWidget { const ImportNewFrostMsWalletView({ super.key, @@ -73,10 +74,13 @@ class _ImportNewFrostMsWalletViewState condition: Util.isDesktop, builder: (child) => DesktopScaffold( background: Theme.of(context).extension()!.background, - appBar: const DesktopAppBar( + appBar: DesktopAppBar( isCompactHeight: false, leading: AppBarBackButton(), - trailing: ExitToMyStackButton(), + trailing: FrostMascot( + title: 'Lorem ipsum', + body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, ', + ), ), body: SizedBox( width: 480, diff --git a/lib/pages/add_wallet_views/frost_ms/new/share_new_multisig_config_view.dart b/lib/pages/add_wallet_views/frost_ms/new/share_new_multisig_config_view.dart index aa5a3d7bf..7d463c4ca 100644 --- a/lib/pages/add_wallet_views/frost_ms/new/share_new_multisig_config_view.dart +++ b/lib/pages/add_wallet_views/frost_ms/new/share_new_multisig_config_view.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:qr_flutter/qr_flutter.dart'; -import 'package:stackwallet/pages/FrostMascot.dart'; +import 'package:stackwallet/pages/frost_mascot.dart'; import 'package:stackwallet/pages/add_wallet_views/frost_ms/new/frost_share_commitments_view.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart'; import 'package:stackwallet/providers/frost_wallet/frost_wallet_providers.dart'; @@ -44,10 +44,13 @@ class _ShareNewMultisigConfigViewState condition: Util.isDesktop, builder: (child) => DesktopScaffold( background: Theme.of(context).extension()!.background, - appBar: const DesktopAppBar( + appBar: DesktopAppBar( isCompactHeight: false, leading: AppBarBackButton(), - trailing: FrostMascot(), + trailing: FrostMascot( + title: 'Lorem ipsum', + body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, ', + ), ), body: SizedBox( width: 480, diff --git a/lib/pages/add_wallet_views/frost_ms/restore/restore_frost_ms_wallet_view.dart b/lib/pages/add_wallet_views/frost_ms/restore/restore_frost_ms_wallet_view.dart index c9c174ab0..08f36ebde 100644 --- a/lib/pages/add_wallet_views/frost_ms/restore/restore_frost_ms_wallet_view.dart +++ b/lib/pages/add_wallet_views/frost_ms/restore/restore_frost_ms_wallet_view.dart @@ -40,6 +40,8 @@ import 'package:stackwallet/widgets/stack_dialog.dart'; import 'package:stackwallet/widgets/stack_text_field.dart'; import 'package:stackwallet/widgets/textfield_icon_button.dart'; +import 'package:stackwallet/pages/frost_mascot.dart'; + class RestoreFrostMsWalletView extends ConsumerStatefulWidget { const RestoreFrostMsWalletView({ super.key, @@ -212,10 +214,13 @@ class _RestoreFrostMsWalletViewState condition: Util.isDesktop, builder: (child) => DesktopScaffold( background: Theme.of(context).extension()!.background, - appBar: const DesktopAppBar( + appBar: DesktopAppBar( isCompactHeight: false, leading: AppBarBackButton(), - trailing: ExitToMyStackButton(), + trailing: FrostMascot( + title: 'Lorem ipsum', + body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, ', + ) ), body: SizedBox( width: 480, diff --git a/lib/pages/FrostMascot.dart b/lib/pages/frost_mascot.dart similarity index 66% rename from lib/pages/FrostMascot.dart rename to lib/pages/frost_mascot.dart index 92058d2b9..3f6c0562d 100644 --- a/lib/pages/FrostMascot.dart +++ b/lib/pages/frost_mascot.dart @@ -9,18 +9,16 @@ */ import 'package:flutter/material.dart'; -import 'package:stackwallet/pages_desktop_specific/desktop_home_view.dart'; -import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/pages/add_wallet_views/frost_ms/frost_step_explanation_dialog.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/text_styles.dart'; - -import 'add_wallet_views/new_wallet_recovery_phrase_warning_view/recovery_phrase_explanation_dialog.dart'; class FrostMascot extends StatelessWidget { - const FrostMascot({ - Key? key, - this.onPressed, - }) : super(key: key); + final String title; + final String body; + FrostMascot({ + super.key, + this.onPressed, required this.title, required this.body, + }); final VoidCallback? onPressed; @@ -35,7 +33,7 @@ class FrostMascot extends StatelessWidget { await showDialog( context: context, builder: (context) => - const RecoveryPhraseExplanationDialog(), + FrostStepExplanationDialog(title: title, body: body), ); }, child: Image( diff --git a/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/finish_resharing_view.dart b/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/finish_resharing_view.dart index 8d23e9ed4..5ff5c815d 100644 --- a/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/finish_resharing_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/finish_resharing_view.dart @@ -8,7 +8,6 @@ import 'package:qr_flutter/qr_flutter.dart'; import 'package:stackwallet/pages/settings_views/wallet_settings_view/frost_ms/resharing/verify_updated_wallet_view.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart'; import 'package:stackwallet/pages/wallet_view/wallet_view.dart'; -import 'package:stackwallet/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart'; import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart'; import 'package:stackwallet/providers/db/main_db_provider.dart'; import 'package:stackwallet/providers/frost_wallet/frost_wallet_providers.dart'; @@ -34,6 +33,8 @@ import 'package:stackwallet/widgets/stack_dialog.dart'; import 'package:stackwallet/widgets/stack_text_field.dart'; import 'package:stackwallet/widgets/textfield_icon_button.dart'; +import 'package:stackwallet/pages/frost_mascot.dart'; + class FinishResharingView extends ConsumerStatefulWidget { const FinishResharingView({ super.key, @@ -180,10 +181,13 @@ class _FinishResharingViewState extends ConsumerState { condition: Util.isDesktop, builder: (child) => DesktopScaffold( background: Theme.of(context).extension()!.background, - appBar: const DesktopAppBar( + appBar: DesktopAppBar( isCompactHeight: false, leading: AppBarBackButton(), - trailing: ExitToMyStackButton(), + trailing: FrostMascot( + title: 'Lorem ipsum', + body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, ', + ), ), body: SizedBox( width: 480, diff --git a/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/new/new_continue_sharing_view.dart b/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/new/new_continue_sharing_view.dart index 86ff2ebe0..5e4ed4762 100644 --- a/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/new/new_continue_sharing_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/new/new_continue_sharing_view.dart @@ -5,7 +5,6 @@ import 'package:stackwallet/pages/home_view/home_view.dart'; import 'package:stackwallet/pages/settings_views/wallet_settings_view/frost_ms/resharing/finish_resharing_view.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart'; import 'package:stackwallet/pages_desktop_specific/desktop_home_view.dart'; -import 'package:stackwallet/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart'; import 'package:stackwallet/providers/frost_wallet/frost_wallet_providers.dart'; import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -20,6 +19,8 @@ import 'package:stackwallet/widgets/desktop/primary_button.dart'; import 'package:stackwallet/widgets/detail_item.dart'; import 'package:stackwallet/widgets/dialogs/frost_interruption_dialog.dart'; +import 'package:stackwallet/pages/frost_mascot.dart'; + class NewContinueSharingView extends ConsumerStatefulWidget { const NewContinueSharingView({ super.key, @@ -68,16 +69,9 @@ class _NewContinueSharingViewState ); }, ), - trailing: ExitToMyStackButton( - onPressed: () async { - await showDialog( - context: context, - builder: (_) => const FrostInterruptionDialog( - type: FrostInterruptionDialogType.resharing, - popUntilOnYesRouteName: DesktopHomeView.routeName, - ), - ); - }, + trailing: FrostMascot( + title: 'Lorem ipsum', + body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, ', ), ), body: SizedBox( diff --git a/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/new/new_import_resharer_config_view.dart b/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/new/new_import_resharer_config_view.dart index f3ef1ec0b..698363923 100644 --- a/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/new/new_import_resharer_config_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/new/new_import_resharer_config_view.dart @@ -27,6 +27,8 @@ import 'package:stackwallet/widgets/stack_dialog.dart'; import 'package:stackwallet/widgets/stack_text_field.dart'; import 'package:stackwallet/widgets/textfield_icon_button.dart'; +import 'package:stackwallet/pages/frost_mascot.dart'; + class NewImportResharerConfigView extends ConsumerStatefulWidget { const NewImportResharerConfigView({ super.key, @@ -89,10 +91,13 @@ class _NewImportResharerConfigViewState condition: Util.isDesktop, builder: (child) => DesktopScaffold( background: Theme.of(context).extension()!.background, - appBar: const DesktopAppBar( + appBar: DesktopAppBar( isCompactHeight: false, leading: AppBarBackButton(), - trailing: ExitToMyStackButton(), + trailing: FrostMascot( + title: 'Lorem ipsum', + body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, ', + ), ), body: SizedBox( width: 480, diff --git a/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/new/new_start_resharing_view.dart b/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/new/new_start_resharing_view.dart index fb6107c2c..7173eff3d 100644 --- a/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/new/new_start_resharing_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/frost_ms/resharing/new/new_start_resharing_view.dart @@ -5,7 +5,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/home_view/home_view.dart'; import 'package:stackwallet/pages/settings_views/wallet_settings_view/frost_ms/resharing/new/new_continue_sharing_view.dart'; import 'package:stackwallet/pages_desktop_specific/desktop_home_view.dart'; -import 'package:stackwallet/pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart'; import 'package:stackwallet/providers/frost_wallet/frost_wallet_providers.dart'; import 'package:stackwallet/services/frost.dart'; import 'package:stackwallet/themes/stack_colors.dart'; @@ -27,6 +26,8 @@ import 'package:stackwallet/widgets/stack_dialog.dart'; import 'package:stackwallet/widgets/stack_text_field.dart'; import 'package:stackwallet/widgets/textfield_icon_button.dart'; +import 'package:stackwallet/pages/frost_mascot.dart'; + class NewStartResharingView extends ConsumerStatefulWidget { const NewStartResharingView({ super.key, @@ -146,16 +147,9 @@ class _NewStartResharingViewState extends ConsumerState { ); }, ), - trailing: ExitToMyStackButton( - onPressed: () async { - await showDialog( - context: context, - builder: (_) => const FrostInterruptionDialog( - type: FrostInterruptionDialogType.resharing, - popUntilOnYesRouteName: DesktopHomeView.routeName, - ), - ); - }, + trailing: FrostMascot( + title: 'Lorem ipsum', + body: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, ', ), ), body: SizedBox(