Merge remote-tracking branch 'origin/main'

This commit is contained in:
OmarHatem
2025-04-17 20:36:41 +02:00
36 changed files with 54 additions and 84 deletions
@@ -204,6 +204,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
);
}
BuildContext? dialogContext;
BuildContext? loadingBottomSheetContext;
void _setEffects() {
@@ -212,7 +213,12 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
}
_exchangeStateReaction = reaction((_) => this.widget.exchangeTradeViewModel.sendViewModel.state,
(ExecutionState state) {
(ExecutionState state) async {
if (dialogContext != null && dialogContext?.mounted == true) {
Navigator.of(dialogContext!).pop();
}
if (state is! IsExecutingState &&
loadingBottomSheetContext != null &&
loadingBottomSheetContext!.mounted) {
@@ -236,6 +242,13 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
}
if (state is IsExecutingState) {
// wait a bit to avoid showing the loading dialog if transaction is failed
await Future.delayed(const Duration(milliseconds: 300));
final currentState = widget.exchangeTradeViewModel.sendViewModel.state;
if (currentState is ExecutedSuccessfullyState || currentState is FailureState) {
return;
}
WidgetsBinding.instance.addPostFrameCallback((_) {
if (context.mounted) {
showModalBottomSheet<void>(
@@ -104,11 +104,9 @@ class _WalletNameFormState extends State<WalletNameForm> {
if (state is ExecutedSuccessfullyState) {
if (widget.isChildWallet) {
Navigator.of(navigatorKey.currentContext ?? context).pushNamed(
Routes.walletGroupExistingSeedDescriptionPage,
arguments: _walletNewVM.seedPhraseWordsLength);
Routes.walletGroupExistingSeedDescriptionPage);
} else {
Navigator.of(navigatorKey.currentContext ?? context)
.pushNamed(Routes.preSeedPage, arguments: _walletNewVM.seedPhraseWordsLength);
Navigator.of(navigatorKey.currentContext ?? context).pushNamed(Routes.preSeedPage);
}
}
@@ -9,9 +9,7 @@ import 'package:cake_wallet/themes/theme_base.dart';
import 'package:flutter/material.dart';
class WalletGroupExistingSeedDescriptionPage extends BasePage {
WalletGroupExistingSeedDescriptionPage({required this.seedPhraseWordsLength});
final int seedPhraseWordsLength;
WalletGroupExistingSeedDescriptionPage();
@override
String get title => S.current.wallet_group;
@@ -69,8 +67,7 @@ class WalletGroupExistingSeedDescriptionPage extends BasePage {
child: PrimaryButton(
key: ValueKey(
'wallet_group_existing_seed_description_page_verify_seed_button_key'),
onPressed: () => Navigator.pushNamed(context, Routes.preSeedPage,
arguments: seedPhraseWordsLength),
onPressed: () => Navigator.pushNamed(context, Routes.preSeedPage),
text: S.current.verify_seed,
color: Theme.of(context).cardColor,
textColor: currentTheme.type == ThemeType.dark
+2 -4
View File
@@ -4,9 +4,7 @@ import 'package:cake_wallet/src/screens/Info_page.dart';
import 'package:flutter/cupertino.dart';
class PreSeedPage extends InfoPage {
PreSeedPage(this.seedPhraseLength);
final int seedPhraseLength;
PreSeedPage();
@override
bool get onWillPop => false;
@@ -15,7 +13,7 @@ class PreSeedPage extends InfoPage {
String get pageTitle => S.current.pre_seed_title;
@override
String get pageDescription => S.current.pre_seed_description(seedPhraseLength.toString());
String get pageDescription => S.current.pre_seed_description;
@override
String get buttonText => S.current.pre_seed_button_text;