mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-15 16:12:16 +00:00
specific error dialog when an unrecoverable frost error has occurred
This commit is contained in:
parent
441faf4d3a
commit
3f4ebe0229
22 changed files with 259 additions and 134 deletions
|
@ -41,6 +41,7 @@ final pFrostScaffoldArgs = StateProvider<
|
|||
List<FrostStepRoute> stepRoutes,
|
||||
FrostInterruptionDialogType frostInterruptionDialogType,
|
||||
NavigatorState parentNav,
|
||||
String callerRouteName,
|
||||
})?>((ref) => null);
|
||||
|
||||
abstract class FrostRouteGenerator {
|
||||
|
|
|
@ -431,6 +431,7 @@ class _NewFrostMsWalletViewState
|
|||
frostInterruptionDialogType:
|
||||
FrostInterruptionDialogType.walletCreation,
|
||||
parentNav: Navigator.of(context),
|
||||
callerRouteName: CreateNewFrostMsWalletView.routeName,
|
||||
);
|
||||
|
||||
await Navigator.of(context).pushNamed(
|
||||
|
|
|
@ -131,7 +131,6 @@ class _SelectNewFrostImportTypeViewState
|
|||
PrimaryButton(
|
||||
label: "Continue",
|
||||
onPressed: () async {
|
||||
final String route;
|
||||
switch (_selectedOption) {
|
||||
case _ImportOption.multisigNew:
|
||||
ref.read(pFrostScaffoldArgs.state).state = (
|
||||
|
@ -144,6 +143,7 @@ class _SelectNewFrostImportTypeViewState
|
|||
parentNav: Navigator.of(context),
|
||||
frostInterruptionDialogType:
|
||||
FrostInterruptionDialogType.walletCreation,
|
||||
callerRouteName: SelectNewFrostImportTypeView.routeName,
|
||||
);
|
||||
break;
|
||||
|
||||
|
@ -158,6 +158,7 @@ class _SelectNewFrostImportTypeViewState
|
|||
parentNav: Navigator.of(context),
|
||||
frostInterruptionDialogType:
|
||||
FrostInterruptionDialogType.resharing,
|
||||
callerRouteName: SelectNewFrostImportTypeView.routeName,
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import 'package:stackwallet/widgets/custom_buttons/frost_qr_dialog_button.dart';
|
|||
import 'package:stackwallet/widgets/custom_buttons/simple_copy_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/detail_item.dart';
|
||||
import 'package:stackwallet/widgets/dialogs/frost/frost_error_dialog.dart';
|
||||
import 'package:stackwallet/widgets/frost_step_user_steps.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
import 'package:stackwallet/widgets/textfields/frost_step_field.dart';
|
||||
|
@ -183,10 +184,9 @@ class _FrostCreateStep2State extends ConsumerState<FrostCreateStep2> {
|
|||
if (context.mounted) {
|
||||
return await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => StackOkDialog(
|
||||
builder: (_) => FrostErrorDialog(
|
||||
title: "Failed to generate shares",
|
||||
message: e.toString(),
|
||||
desktopPopRootNavigator: Util.isDesktop,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import 'package:stackwallet/widgets/custom_buttons/frost_qr_dialog_button.dart';
|
|||
import 'package:stackwallet/widgets/custom_buttons/simple_copy_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/detail_item.dart';
|
||||
import 'package:stackwallet/widgets/dialogs/frost/frost_error_dialog.dart';
|
||||
import 'package:stackwallet/widgets/frost_step_user_steps.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
import 'package:stackwallet/widgets/textfields/frost_step_field.dart';
|
||||
|
@ -184,9 +185,8 @@ class _FrostCreateStep3State extends ConsumerState<FrostCreateStep3> {
|
|||
if (context.mounted) {
|
||||
return await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => StackOkDialog(
|
||||
builder: (_) => const FrostErrorDialog(
|
||||
title: "Failed to complete key generation",
|
||||
desktopPopRootNavigator: Util.isDesktop,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -20,9 +20,9 @@ import 'package:stackwallet/widgets/custom_buttons/simple_copy_button.dart';
|
|||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
||||
import 'package:stackwallet/widgets/detail_item.dart';
|
||||
import 'package:stackwallet/widgets/dialogs/frost/frost_error_dialog.dart';
|
||||
import 'package:stackwallet/widgets/dialogs/simple_mobile_dialog.dart';
|
||||
import 'package:stackwallet/widgets/frost_step_user_steps.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
|
||||
class FrostReshareStep1a extends ConsumerStatefulWidget {
|
||||
const FrostReshareStep1a({super.key});
|
||||
|
@ -88,9 +88,8 @@ class _FrostReshareStep1aState extends ConsumerState<FrostReshareStep1a> {
|
|||
if (mounted) {
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => StackOkDialog(
|
||||
builder: (_) => FrostErrorDialog(
|
||||
title: e.toString(),
|
||||
desktopPopRootNavigator: Util.isDesktop,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@ import 'package:stackwallet/utilities/util.dart';
|
|||
import 'package:stackwallet/wallets/isar/models/frost_wallet_info.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/checkbox_text_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/dialogs/frost/frost_error_dialog.dart';
|
||||
import 'package:stackwallet/widgets/frost_step_user_steps.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
import 'package:stackwallet/widgets/textfields/frost_step_field.dart';
|
||||
|
||||
class FrostReshareStep1b extends ConsumerStatefulWidget {
|
||||
|
@ -124,9 +124,8 @@ class _FrostReshareStep1bState extends ConsumerState<FrostReshareStep1b> {
|
|||
if (mounted) {
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => StackOkDialog(
|
||||
builder: (_) => FrostErrorDialog(
|
||||
title: e.toString(),
|
||||
desktopPopRootNavigator: Util.isDesktop,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -190,6 +190,7 @@ class _FrostReshareStep1cState extends ConsumerState<FrostReshareStep1c> {
|
|||
parentNav: data.parentNav,
|
||||
frostInterruptionDialogType:
|
||||
FrostInterruptionDialogType.resharing,
|
||||
callerRouteName: data.callerRouteName,
|
||||
);
|
||||
ref.read(pFrostMyName.state).state =
|
||||
ref.read(pFrostResharingData).myName!;
|
||||
|
|
|
@ -15,7 +15,7 @@ import 'package:stackwallet/widgets/custom_buttons/frost_qr_dialog_button.dart';
|
|||
import 'package:stackwallet/widgets/custom_buttons/simple_copy_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/detail_item.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
import 'package:stackwallet/widgets/dialogs/frost/frost_error_dialog.dart';
|
||||
import 'package:stackwallet/widgets/textfields/frost_step_field.dart';
|
||||
|
||||
class FrostReshareStep2abd extends ConsumerStatefulWidget {
|
||||
|
@ -86,10 +86,9 @@ class _FrostReshareStep2abdState extends ConsumerState<FrostReshareStep2abd> {
|
|||
if (mounted) {
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => StackOkDialog(
|
||||
builder: (_) => FrostErrorDialog(
|
||||
title: "Error",
|
||||
message: e.toString(),
|
||||
desktopPopRootNavigator: Util.isDesktop,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import 'package:stackwallet/services/frost.dart';
|
|||
import 'package:stackwallet/utilities/logger.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
import 'package:stackwallet/widgets/dialogs/frost/frost_error_dialog.dart';
|
||||
import 'package:stackwallet/widgets/textfields/frost_step_field.dart';
|
||||
|
||||
class FrostReshareStep2c extends ConsumerStatefulWidget {
|
||||
|
@ -63,14 +63,15 @@ class _FrostReshareStep2cState extends ConsumerState<FrostReshareStep2c> {
|
|||
level: LogLevel.Fatal,
|
||||
);
|
||||
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => StackOkDialog(
|
||||
title: "Error",
|
||||
message: e.toString(),
|
||||
desktopPopRootNavigator: Util.isDesktop,
|
||||
),
|
||||
);
|
||||
if (mounted) {
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => FrostErrorDialog(
|
||||
title: "Error",
|
||||
message: e.toString(),
|
||||
),
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
_buttonLock = false;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import 'package:stackwallet/widgets/custom_buttons/frost_qr_dialog_button.dart';
|
|||
import 'package:stackwallet/widgets/custom_buttons/simple_copy_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/detail_item.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
import 'package:stackwallet/widgets/dialogs/frost/frost_error_dialog.dart';
|
||||
import 'package:stackwallet/widgets/textfields/frost_step_field.dart';
|
||||
|
||||
class FrostReshareStep3abd extends ConsumerStatefulWidget {
|
||||
|
@ -73,15 +73,15 @@ class _FrostReshareStep3abdState extends ConsumerState<FrostReshareStep3abd> {
|
|||
"$e\n$s",
|
||||
level: LogLevel.Fatal,
|
||||
);
|
||||
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => StackOkDialog(
|
||||
title: "Error",
|
||||
message: e.toString(),
|
||||
desktopPopRootNavigator: Util.isDesktop,
|
||||
),
|
||||
);
|
||||
if (mounted) {
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => FrostErrorDialog(
|
||||
title: "Error",
|
||||
message: e.toString(),
|
||||
),
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
_buttonLock = false;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ import 'package:stackwallet/widgets/custom_buttons/frost_qr_dialog_button.dart';
|
|||
import 'package:stackwallet/widgets/custom_buttons/simple_copy_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/detail_item.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
import 'package:stackwallet/widgets/dialogs/frost/frost_error_dialog.dart';
|
||||
import 'package:stackwallet/widgets/textfields/frost_step_field.dart';
|
||||
|
||||
// was FinishResharingView
|
||||
|
@ -94,10 +94,9 @@ class _FrostReshareStep4State extends ConsumerState<FrostReshareStep4> {
|
|||
if (mounted) {
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => StackOkDialog(
|
||||
builder: (_) => FrostErrorDialog(
|
||||
title: "Error",
|
||||
message: e.toString(),
|
||||
desktopPopRootNavigator: Util.isDesktop,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ import 'package:stackwallet/wallets/wallet/impl/bitcoin_frost_wallet.dart';
|
|||
import 'package:stackwallet/widgets/custom_buttons/simple_copy_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/detail_item.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
import 'package:stackwallet/widgets/dialogs/frost/frost_error_dialog.dart';
|
||||
|
||||
// was VerifyUpdatedWalletView
|
||||
class FrostReshareStep5 extends ConsumerStatefulWidget {
|
||||
|
@ -110,10 +110,9 @@ class _FrostReshareStep5State extends ConsumerState<FrostReshareStep5> {
|
|||
if (mounted) {
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => StackOkDialog(
|
||||
builder: (_) => FrostErrorDialog(
|
||||
title: "Error",
|
||||
message: e.toString(),
|
||||
desktopPopRootNavigator: Util.isDesktop,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -139,6 +139,7 @@ class _FrostSendViewState extends ConsumerState<FrostSendView> {
|
|||
parentNav: Navigator.of(context),
|
||||
frostInterruptionDialogType:
|
||||
FrostInterruptionDialogType.transactionCreation,
|
||||
callerRouteName: FrostSendView.routeName,
|
||||
);
|
||||
|
||||
await Navigator.of(context).pushNamed(
|
||||
|
|
|
@ -109,14 +109,16 @@ class _FrostSendStep1bState extends ConsumerState<FrostSendStep1b> {
|
|||
"$e\n$s",
|
||||
level: LogLevel.Error,
|
||||
);
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => StackOkDialog(
|
||||
title: "Import and attempt sign config failed",
|
||||
message: e.toString(),
|
||||
desktopPopRootNavigator: Util.isDesktop,
|
||||
),
|
||||
);
|
||||
if (mounted) {
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => StackOkDialog(
|
||||
title: "Import and attempt sign config failed",
|
||||
message: e.toString(),
|
||||
desktopPopRootNavigator: Util.isDesktop,
|
||||
),
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
_attemptSignLock = false;
|
||||
}
|
||||
|
|
|
@ -14,8 +14,8 @@ import 'package:stackwallet/widgets/custom_buttons/frost_qr_dialog_button.dart';
|
|||
import 'package:stackwallet/widgets/custom_buttons/simple_copy_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/detail_item.dart';
|
||||
import 'package:stackwallet/widgets/dialogs/frost/frost_error_dialog.dart';
|
||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
import 'package:stackwallet/widgets/textfields/frost_step_field.dart';
|
||||
|
||||
class FrostSendStep2 extends ConsumerStatefulWidget {
|
||||
|
@ -293,13 +293,14 @@ class _FrostSendStep2State extends ConsumerState<FrostSendStep2> {
|
|||
level: LogLevel.Fatal,
|
||||
);
|
||||
|
||||
return await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => StackOkDialog(
|
||||
title: "Failed to continue signing",
|
||||
desktopPopRootNavigator: Util.isDesktop,
|
||||
),
|
||||
);
|
||||
if (context.mounted) {
|
||||
return await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => const FrostErrorDialog(
|
||||
title: "Failed to continue signing",
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
|
|
|
@ -15,8 +15,8 @@ import 'package:stackwallet/widgets/custom_buttons/frost_qr_dialog_button.dart';
|
|||
import 'package:stackwallet/widgets/custom_buttons/simple_copy_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/detail_item.dart';
|
||||
import 'package:stackwallet/widgets/dialogs/frost/frost_error_dialog.dart';
|
||||
import 'package:stackwallet/widgets/frost_step_user_steps.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
import 'package:stackwallet/widgets/textfields/frost_step_field.dart';
|
||||
|
||||
class FrostSendStep3 extends ConsumerStatefulWidget {
|
||||
|
@ -238,9 +238,8 @@ class _FrostSendStep3State extends ConsumerState<FrostSendStep3> {
|
|||
if (context.mounted) {
|
||||
return await showDialog<void>(
|
||||
context: context,
|
||||
builder: (_) => StackOkDialog(
|
||||
builder: (_) => const FrostErrorDialog(
|
||||
title: "Failed to complete signing process",
|
||||
desktopPopRootNavigator: Util.isDesktop,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -162,6 +162,7 @@ class FrostMSWalletOptionsView extends ConsumerWidget {
|
|||
parentNav: Navigator.of(context),
|
||||
frostInterruptionDialogType:
|
||||
FrostInterruptionDialogType.resharing,
|
||||
callerRouteName: FrostMSWalletOptionsView.routeName,
|
||||
);
|
||||
|
||||
Navigator.of(context).pushNamed(
|
||||
|
|
|
@ -129,18 +129,19 @@ class _CompleteReshareConfigViewState
|
|||
final wallet =
|
||||
ref.read(pWallets).getWallet(widget.walletId) as BitcoinFrostWallet;
|
||||
|
||||
ref.read(pFrostScaffoldArgs.state).state = (
|
||||
info: (
|
||||
walletName: wallet.info.name,
|
||||
frostCurrency: wallet.cryptoCurrency,
|
||||
),
|
||||
walletId: wallet.walletId,
|
||||
stepRoutes: FrostRouteGenerator.initiateReshareStepRoutes,
|
||||
parentNav: Navigator.of(context),
|
||||
frostInterruptionDialogType: FrostInterruptionDialogType.resharing,
|
||||
);
|
||||
|
||||
if (mounted) {
|
||||
ref.read(pFrostScaffoldArgs.state).state = (
|
||||
info: (
|
||||
walletName: wallet.info.name,
|
||||
frostCurrency: wallet.cryptoCurrency,
|
||||
),
|
||||
walletId: wallet.walletId,
|
||||
stepRoutes: FrostRouteGenerator.initiateReshareStepRoutes,
|
||||
parentNav: Navigator.of(context),
|
||||
frostInterruptionDialogType: FrostInterruptionDialogType.resharing,
|
||||
callerRouteName: CompleteReshareConfigView.routeName,
|
||||
);
|
||||
|
||||
await Navigator.of(context).pushNamed(
|
||||
FrostStepScaffold.routeName,
|
||||
);
|
||||
|
@ -345,7 +346,8 @@ class _CompleteReshareConfigViewState
|
|||
() => _includeMeInReshare = value == true,
|
||||
);
|
||||
_participantsCountChanged(
|
||||
_newParticipantsCountController.text);
|
||||
_newParticipantsCountController.text,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
|
|
@ -277,25 +277,27 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
const timeout = Duration(milliseconds: 1500);
|
||||
if (_cachedTime == null || now.difference(_cachedTime!) > timeout) {
|
||||
_cachedTime = now;
|
||||
unawaited(showDialog<dynamic>(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (_) => WillPopScope(
|
||||
onWillPop: () async {
|
||||
Navigator.of(context).popUntil(
|
||||
ModalRoute.withName(HomeView.routeName),
|
||||
);
|
||||
_logout();
|
||||
return false;
|
||||
},
|
||||
child: const StackDialog(title: "Tap back again to exit wallet"),
|
||||
unawaited(
|
||||
showDialog<dynamic>(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (_) => WillPopScope(
|
||||
onWillPop: () async {
|
||||
Navigator.of(context).popUntil(
|
||||
ModalRoute.withName(HomeView.routeName),
|
||||
);
|
||||
_logout();
|
||||
return false;
|
||||
},
|
||||
child: const StackDialog(title: "Tap back again to exit wallet"),
|
||||
),
|
||||
).timeout(
|
||||
timeout,
|
||||
onTimeout: () => Navigator.of(context).popUntil(
|
||||
ModalRoute.withName(WalletView.routeName),
|
||||
),
|
||||
),
|
||||
).timeout(
|
||||
timeout,
|
||||
onTimeout: () => Navigator.of(context).popUntil(
|
||||
ModalRoute.withName(WalletView.routeName),
|
||||
),
|
||||
));
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -373,6 +375,7 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
parentNav: Navigator.of(context),
|
||||
frostInterruptionDialogType:
|
||||
FrostInterruptionDialogType.transactionCreation,
|
||||
callerRouteName: WalletView.routeName,
|
||||
);
|
||||
|
||||
await Navigator.of(context).pushNamed(
|
||||
|
@ -398,11 +401,12 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
.tickerEqualToAnyExchangeNameName(coin.ticker)
|
||||
.findFirst();
|
||||
} catch (_) {
|
||||
_future = ExchangeDataLoadingService.instance.loadAll().then((_) =>
|
||||
ExchangeDataLoadingService.instance.isar.currencies
|
||||
.where()
|
||||
.tickerEqualToAnyExchangeNameName(coin.ticker)
|
||||
.findFirst());
|
||||
_future = ExchangeDataLoadingService.instance.loadAll().then(
|
||||
(_) => ExchangeDataLoadingService.instance.isar.currencies
|
||||
.where()
|
||||
.tickerEqualToAnyExchangeNameName(coin.ticker)
|
||||
.findFirst(),
|
||||
);
|
||||
}
|
||||
|
||||
final currency = await showLoading(
|
||||
|
@ -411,7 +415,7 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
message: "Loading...",
|
||||
);
|
||||
|
||||
if (mounted) {
|
||||
if (context.mounted) {
|
||||
unawaited(
|
||||
Navigator.of(context).pushNamed(
|
||||
WalletInitiatedExchangeView.routeName,
|
||||
|
@ -568,7 +572,7 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
},
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
@ -607,7 +611,7 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
style: STextStyles.navBarTitle(context),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
|
@ -670,9 +674,12 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.background,
|
||||
icon: ref.watch(notificationsProvider.select(
|
||||
(value) => value
|
||||
.hasUnreadNotificationsFor(walletId)))
|
||||
icon: ref.watch(
|
||||
notificationsProvider.select(
|
||||
(value) =>
|
||||
value.hasUnreadNotificationsFor(walletId),
|
||||
),
|
||||
)
|
||||
? SvgPicture.file(
|
||||
File(
|
||||
ref.watch(
|
||||
|
@ -683,10 +690,14 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
),
|
||||
width: 20,
|
||||
height: 20,
|
||||
color: ref.watch(notificationsProvider.select(
|
||||
(value) =>
|
||||
value.hasUnreadNotificationsFor(
|
||||
walletId)))
|
||||
color: ref.watch(
|
||||
notificationsProvider.select(
|
||||
(value) =>
|
||||
value.hasUnreadNotificationsFor(
|
||||
walletId,
|
||||
),
|
||||
),
|
||||
)
|
||||
? null
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
|
@ -696,10 +707,14 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
Assets.svg.bell,
|
||||
width: 20,
|
||||
height: 20,
|
||||
color: ref.watch(notificationsProvider.select(
|
||||
(value) =>
|
||||
value.hasUnreadNotificationsFor(
|
||||
walletId)))
|
||||
color: ref.watch(
|
||||
notificationsProvider.select(
|
||||
(value) =>
|
||||
value.hasUnreadNotificationsFor(
|
||||
walletId,
|
||||
),
|
||||
),
|
||||
)
|
||||
? null
|
||||
: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
|
@ -720,22 +735,25 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
.state;
|
||||
if (unreadNotificationIds.isEmpty) return;
|
||||
|
||||
List<Future<dynamic>> futures = [];
|
||||
final List<Future<dynamic>> futures = [];
|
||||
for (int i = 0;
|
||||
i < unreadNotificationIds.length - 1;
|
||||
i++) {
|
||||
futures.add(ref
|
||||
.read(notificationsProvider)
|
||||
.markAsRead(
|
||||
futures.add(
|
||||
ref.read(notificationsProvider).markAsRead(
|
||||
unreadNotificationIds.elementAt(i),
|
||||
false));
|
||||
false,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// wait for multiple to update if any
|
||||
Future.wait(futures).then((_) {
|
||||
// only notify listeners once
|
||||
ref.read(notificationsProvider).markAsRead(
|
||||
unreadNotificationIds.last, true);
|
||||
unreadNotificationIds.last,
|
||||
true,
|
||||
);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
@ -824,7 +842,8 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
style: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.getSecondaryEnabledButtonStyle(
|
||||
context),
|
||||
context,
|
||||
),
|
||||
onPressed: () async {
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
|
@ -855,7 +874,8 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
style: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.getPrimaryEnabledButtonStyle(
|
||||
context),
|
||||
context,
|
||||
),
|
||||
child: Text(
|
||||
"Continue",
|
||||
style:
|
||||
|
@ -1073,21 +1093,22 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
),
|
||||
if (coin == Coin.banano)
|
||||
WalletNavigationBarItemData(
|
||||
icon: SvgPicture.asset(
|
||||
Assets.svg.monkey,
|
||||
height: 20,
|
||||
width: 20,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.bottomNavIconIcon,
|
||||
),
|
||||
label: "MonKey",
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
MonkeyView.routeName,
|
||||
arguments: widget.walletId,
|
||||
);
|
||||
}),
|
||||
icon: SvgPicture.asset(
|
||||
Assets.svg.monkey,
|
||||
height: 20,
|
||||
width: 20,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.bottomNavIconIcon,
|
||||
),
|
||||
label: "MonKey",
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed(
|
||||
MonkeyView.routeName,
|
||||
arguments: widget.walletId,
|
||||
);
|
||||
},
|
||||
),
|
||||
if (ref.watch(
|
||||
pWallets.select(
|
||||
(value) => value.getWallet(widget.walletId)
|
||||
|
@ -1112,8 +1133,12 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
);
|
||||
},
|
||||
),
|
||||
if (ref.watch(pWallets.select((value) =>
|
||||
value.getWallet(widget.walletId) is PaynymInterface)))
|
||||
if (ref.watch(
|
||||
pWallets.select(
|
||||
(value) =>
|
||||
value.getWallet(widget.walletId) is PaynymInterface,
|
||||
),
|
||||
))
|
||||
WalletNavigationBarItemData(
|
||||
label: "PayNym",
|
||||
icon: const PaynymNavIcon(),
|
||||
|
@ -1145,7 +1170,7 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
level: LogLevel.Info,
|
||||
);
|
||||
|
||||
if (mounted) {
|
||||
if (context.mounted) {
|
||||
Navigator.of(context).pop();
|
||||
|
||||
// check if account exists and for matching code to see if claimed
|
||||
|
|
|
@ -13,6 +13,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
import 'package:stackwallet/frost_route_generator.dart';
|
||||
import 'package:stackwallet/pages/send_view/frost_ms/frost_send_view.dart';
|
||||
import 'package:stackwallet/pages/wallet_view/transaction_views/tx_v2/transaction_v2_list.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/my_stack_view.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_receive.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart';
|
||||
import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_token_send.dart';
|
||||
|
@ -104,6 +105,7 @@ class _MyWalletState extends ConsumerState<MyWallet> {
|
|||
frostInterruptionDialogType:
|
||||
FrostInterruptionDialogType
|
||||
.transactionCreation,
|
||||
callerRouteName: MyStackView.routeName,
|
||||
);
|
||||
|
||||
await Navigator.of(context).pushNamed(
|
||||
|
@ -111,7 +113,7 @@ class _MyWalletState extends ConsumerState<MyWallet> {
|
|||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
FrostSendView(
|
||||
|
|
92
lib/widgets/dialogs/frost/frost_error_dialog.dart
Normal file
92
lib/widgets/dialogs/frost/frost_error_dialog.dart
Normal file
|
@ -0,0 +1,92 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:stackwallet/frost_route_generator.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
|
||||
class FrostErrorDialog extends ConsumerWidget {
|
||||
const FrostErrorDialog({
|
||||
super.key,
|
||||
required this.title,
|
||||
this.icon,
|
||||
this.message,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final Widget? icon;
|
||||
final String? message;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return SafeArea(
|
||||
child: StackDialogBase(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
title,
|
||||
style: STextStyles.pageTitleH2(context),
|
||||
),
|
||||
),
|
||||
icon != null ? icon! : Container(),
|
||||
],
|
||||
),
|
||||
if (message != null)
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
if (message != null)
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
message!,
|
||||
style: STextStyles.smallMed14(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Process must be restarted",
|
||||
style: STextStyles.smallMed14(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
const Spacer(),
|
||||
const SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
PrimaryButton(
|
||||
label: "Ok",
|
||||
onPressed: () {
|
||||
ref.read(pFrostScaffoldCanPopDesktop.notifier).state = true;
|
||||
ref.read(pFrostScaffoldArgs)!.parentNav.popUntil(
|
||||
ModalRoute.withName(
|
||||
ref.read(pFrostScaffoldArgs)!.callerRouteName,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue