2023-03-24 15:26:42 +00:00
|
|
|
import 'package:cake_wallet/anonpay/anonpay_info_base.dart';
|
|
|
|
import 'package:cake_wallet/anonpay/anonpay_invoice_info.dart';
|
2023-05-17 14:43:23 +00:00
|
|
|
import 'package:cake_wallet/core/totp_request_details.dart';
|
2020-09-26 19:17:31 +00:00
|
|
|
import 'package:cake_wallet/entities/contact_record.dart';
|
2021-04-12 18:22:22 +00:00
|
|
|
import 'package:cake_wallet/buy/order.dart';
|
2023-04-21 18:03:42 +00:00
|
|
|
import 'package:cake_wallet/entities/qr_view_data.dart';
|
2023-03-24 15:26:42 +00:00
|
|
|
import 'package:cake_wallet/src/screens/anonpay_details/anonpay_details_page.dart';
|
2021-01-13 16:43:34 +00:00
|
|
|
import 'package:cake_wallet/src/screens/backup/backup_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/backup/edit_backup_password_page.dart';
|
2021-04-13 18:40:44 +00:00
|
|
|
import 'package:cake_wallet/src/screens/buy/buy_webview_page.dart';
|
2023-06-13 23:15:10 +00:00
|
|
|
import 'package:cake_wallet/src/screens/buy/webview_page.dart';
|
2023-03-31 18:34:39 +00:00
|
|
|
import 'package:cake_wallet/src/screens/buy/payfura_page.dart';
|
2021-04-12 18:22:22 +00:00
|
|
|
import 'package:cake_wallet/src/screens/buy/pre_order_page.dart';
|
2023-04-21 18:36:47 +00:00
|
|
|
import 'package:cake_wallet/src/screens/restore/sweeping_wallet_page.dart';
|
2023-03-24 15:26:42 +00:00
|
|
|
import 'package:cake_wallet/src/screens/receive/anonpay_invoice_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/receive/anonpay_receive_page.dart';
|
2023-04-14 04:39:08 +00:00
|
|
|
import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_dashboard_actions.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/dashboard/widgets/transactions_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/settings/desktop_settings/desktop_settings_page.dart';
|
2022-11-18 18:53:35 +00:00
|
|
|
import 'package:cake_wallet/src/screens/settings/display_settings_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/settings/other_settings_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/settings/privacy_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/settings/security_backup_page.dart';
|
2022-07-28 17:03:16 +00:00
|
|
|
import 'package:cake_wallet/src/screens/ionia/cards/ionia_account_cards_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/ionia/cards/ionia_account_page.dart';
|
2022-09-02 13:47:45 +00:00
|
|
|
import 'package:cake_wallet/src/screens/ionia/cards/ionia_custom_redeem_page.dart';
|
2022-07-28 17:03:16 +00:00
|
|
|
import 'package:cake_wallet/src/screens/ionia/cards/ionia_custom_tip_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/ionia/cards/ionia_gift_card_detail_page.dart';
|
2022-09-02 13:47:45 +00:00
|
|
|
import 'package:cake_wallet/src/screens/ionia/cards/ionia_more_options_page.dart';
|
2022-10-05 13:58:25 +00:00
|
|
|
import 'package:cake_wallet/src/screens/new_wallet/advanced_privacy_settings_page.dart';
|
2021-03-12 19:04:37 +00:00
|
|
|
import 'package:cake_wallet/src/screens/order_details/order_details_page.dart';
|
2020-10-22 18:24:24 +00:00
|
|
|
import 'package:cake_wallet/src/screens/pin_code/pin_code_widget.dart';
|
2021-01-13 16:43:34 +00:00
|
|
|
import 'package:cake_wallet/src/screens/restore/restore_from_backup_page.dart';
|
2020-10-13 21:11:04 +00:00
|
|
|
import 'package:cake_wallet/src/screens/restore/wallet_restore_page.dart';
|
2020-11-27 11:08:17 +00:00
|
|
|
import 'package:cake_wallet/src/screens/seed/pre_seed_page.dart';
|
2022-11-16 07:29:14 +00:00
|
|
|
import 'package:cake_wallet/src/screens/settings/connection_sync_page.dart';
|
2023-05-17 14:43:23 +00:00
|
|
|
import 'package:cake_wallet/src/screens/setup_2fa/modify_2fa_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/setup_2fa/setup_2fa_qr_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/setup_2fa/setup_2fa.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/setup_2fa/setup_2fa_enter_code_page.dart';
|
2021-02-25 18:25:52 +00:00
|
|
|
import 'package:cake_wallet/src/screens/support/support_page.dart';
|
2021-05-27 17:57:51 +00:00
|
|
|
import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_details_page.dart';
|
2021-05-25 17:32:36 +00:00
|
|
|
import 'package:cake_wallet/src/screens/unspent_coins/unspent_coins_list_page.dart';
|
2022-08-09 13:47:41 +00:00
|
|
|
import 'package:cake_wallet/utils/payment_request.dart';
|
2023-04-14 04:39:08 +00:00
|
|
|
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
2020-11-17 18:16:58 +00:00
|
|
|
import 'package:cake_wallet/view_model/monero_account_list/account_list_item.dart';
|
2022-10-05 17:28:11 +00:00
|
|
|
import 'package:cake_wallet/view_model/node_list/node_create_or_edit_view_model.dart';
|
2022-12-04 03:08:42 +00:00
|
|
|
import 'package:cake_wallet/view_model/advanced_privacy_settings_view_model.dart';
|
2023-04-27 15:06:09 +00:00
|
|
|
import 'package:cake_wallet/wallet_type_utils.dart';
|
2020-01-04 19:31:52 +00:00
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:cake_wallet/routes.dart';
|
|
|
|
import 'package:cake_wallet/generated/i18n.dart';
|
2020-09-21 11:50:26 +00:00
|
|
|
import 'package:cake_wallet/di.dart';
|
|
|
|
import 'package:cake_wallet/view_model/wallet_new_vm.dart';
|
|
|
|
import 'package:cake_wallet/view_model/wallet_restoration_from_seed_vm.dart';
|
|
|
|
import 'package:cake_wallet/exchange/trade.dart';
|
2021-12-24 12:37:24 +00:00
|
|
|
import 'package:cw_core/transaction_info.dart';
|
|
|
|
import 'package:cw_core/wallet_type.dart';
|
2020-09-21 11:50:26 +00:00
|
|
|
import 'package:cake_wallet/src/screens/dashboard/dashboard_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/seed/wallet_seed_page.dart';
|
2020-01-04 19:31:52 +00:00
|
|
|
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/src/screens/nodes/node_create_or_edit_page.dart';
|
2020-01-04 19:31:52 +00:00
|
|
|
import 'package:cake_wallet/src/screens/receive/receive_page.dart';
|
2020-06-20 07:10:00 +00:00
|
|
|
import 'package:cake_wallet/src/screens/subaddress/address_edit_or_create_page.dart';
|
2020-01-04 19:31:52 +00:00
|
|
|
import 'package:cake_wallet/src/screens/wallet_list/wallet_list_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/new_wallet/new_wallet_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/setup_pin_code/setup_pin_code.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/restore/restore_options_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/send/send_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/disclaimer/disclaimer_page.dart';
|
2020-02-28 20:16:39 +00:00
|
|
|
import 'package:cake_wallet/src/screens/seed_language/seed_language_page.dart';
|
2020-01-04 19:31:52 +00:00
|
|
|
import 'package:cake_wallet/src/screens/transaction_details/transaction_details_page.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/src/screens/monero_accounts/monero_account_edit_or_create_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/contact/contact_list_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/contact/contact_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/wallet_keys/wallet_keys_page.dart';
|
2020-01-04 19:31:52 +00:00
|
|
|
import 'package:cake_wallet/src/screens/restore/restore_wallet_from_seed_details.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/exchange/exchange_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/rescan/rescan_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/faq/faq_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/trade_details/trade_details_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/welcome/create_welcome_page.dart';
|
2020-04-28 17:50:12 +00:00
|
|
|
import 'package:cake_wallet/src/screens/new_wallet/new_wallet_type_page.dart';
|
2020-05-08 16:22:56 +00:00
|
|
|
import 'package:cake_wallet/src/screens/send/send_template_page.dart';
|
2020-05-14 17:29:10 +00:00
|
|
|
import 'package:cake_wallet/src/screens/exchange/exchange_template_page.dart';
|
2020-09-21 11:50:26 +00:00
|
|
|
import 'package:cake_wallet/src/screens/exchange_trade/exchange_confirm_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/exchange_trade/exchange_trade_page.dart';
|
2021-03-26 11:29:43 +00:00
|
|
|
import 'package:flutter/services.dart';
|
2022-03-30 15:57:04 +00:00
|
|
|
import 'package:cake_wallet/wallet_types.g.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/dashboard/widgets/address_page.dart';
|
2022-06-23 09:25:00 +00:00
|
|
|
import 'package:cake_wallet/src/screens/receive/fullscreen_qr_page.dart';
|
2022-07-28 17:03:16 +00:00
|
|
|
import 'package:cake_wallet/src/screens/ionia/ionia.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/ionia/cards/ionia_payment_status_page.dart';
|
|
|
|
import 'package:cake_wallet/anypay/any_pay_payment_committed_info.dart';
|
|
|
|
import 'package:cake_wallet/ionia/ionia_any_pay_payment_info.dart';
|
2022-11-05 18:05:55 +00:00
|
|
|
import 'package:cw_core/crypto_currency.dart';
|
2023-03-15 13:24:38 +00:00
|
|
|
import 'package:cw_core/node.dart';
|
2020-09-14 12:08:33 +00:00
|
|
|
|
2023-06-13 23:15:10 +00:00
|
|
|
import 'buy/moonpay/moonpay_buy_provider.dart';
|
|
|
|
|
2022-10-12 17:09:57 +00:00
|
|
|
late RouteSettings currentRouteSettings;
|
2021-11-05 15:08:45 +00:00
|
|
|
|
2020-10-19 11:20:24 +00:00
|
|
|
Route<dynamic> createRoute(RouteSettings settings) {
|
2021-11-05 15:08:45 +00:00
|
|
|
currentRouteSettings = settings;
|
2022-06-23 09:25:00 +00:00
|
|
|
|
2020-10-19 11:20:24 +00:00
|
|
|
switch (settings.name) {
|
|
|
|
case Routes.welcome:
|
|
|
|
return MaterialPageRoute<void>(builder: (_) => createWelcomePage());
|
|
|
|
|
|
|
|
case Routes.newWalletFromWelcome:
|
|
|
|
return CupertinoPageRoute<void>(
|
2020-11-12 16:31:53 +00:00
|
|
|
builder: (_) => getIt.get<SetupPinCodePage>(
|
2022-01-03 18:25:48 +00:00
|
|
|
param1: (PinCodeState<PinCodeWidget> context, dynamic _) {
|
2022-06-23 09:25:00 +00:00
|
|
|
if (availableWalletTypes.length == 1) {
|
2022-03-30 15:57:04 +00:00
|
|
|
Navigator.of(context.context).pushNamed(Routes.newWallet, arguments: availableWalletTypes.first);
|
|
|
|
} else {
|
|
|
|
Navigator.of(context.context).pushNamed(Routes.newWalletType);
|
|
|
|
}
|
2022-01-03 18:25:48 +00:00
|
|
|
}),
|
2020-10-19 11:20:24 +00:00
|
|
|
fullscreenDialog: true);
|
|
|
|
|
|
|
|
case Routes.newWalletType:
|
|
|
|
return CupertinoPageRoute<void>(
|
2020-11-12 16:31:53 +00:00
|
|
|
builder: (_) => getIt.get<NewWalletTypePage>(
|
2020-12-21 20:20:46 +00:00
|
|
|
param1: (BuildContext context, WalletType type) =>
|
|
|
|
Navigator.of(context)
|
2022-10-12 17:09:57 +00:00
|
|
|
.pushNamed(Routes.newWallet, arguments: type)));
|
2020-10-19 11:20:24 +00:00
|
|
|
|
|
|
|
case Routes.newWallet:
|
2020-11-30 17:17:44 +00:00
|
|
|
final type = settings.arguments as WalletType;
|
2020-10-19 11:20:24 +00:00
|
|
|
final walletNewVM = getIt.get<WalletNewVM>(param1: type);
|
|
|
|
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (_) => NewWalletPage(walletNewVM));
|
|
|
|
|
|
|
|
case Routes.setupPin:
|
2022-10-12 17:09:57 +00:00
|
|
|
Function(PinCodeState<PinCodeWidget>, String)? callback;
|
2020-10-19 11:20:24 +00:00
|
|
|
|
2020-10-24 14:35:55 +00:00
|
|
|
if (settings.arguments is Function(PinCodeState<PinCodeWidget>, String)) {
|
2020-11-06 18:54:00 +00:00
|
|
|
callback =
|
|
|
|
settings.arguments as Function(PinCodeState<PinCodeWidget>, String);
|
2020-10-19 11:20:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (_) => getIt.get<SetupPinCodePage>(param1: callback));
|
|
|
|
|
|
|
|
case Routes.restoreWalletType:
|
|
|
|
return CupertinoPageRoute<void>(
|
2020-11-12 16:31:53 +00:00
|
|
|
builder: (_) => getIt.get<NewWalletTypePage>(
|
|
|
|
param1: (BuildContext context, WalletType type) =>
|
|
|
|
Navigator.of(context)
|
2020-11-30 17:17:44 +00:00
|
|
|
.pushNamed(Routes.restoreWallet, arguments: type),
|
2020-11-12 16:31:53 +00:00
|
|
|
param2: false));
|
2020-10-19 11:20:24 +00:00
|
|
|
|
|
|
|
case Routes.restoreOptions:
|
2023-04-21 18:36:47 +00:00
|
|
|
final isNewInstall = settings.arguments as bool;
|
2020-10-19 11:20:24 +00:00
|
|
|
return CupertinoPageRoute<void>(
|
2023-05-17 14:43:23 +00:00
|
|
|
fullscreenDialog: true,
|
2023-04-21 18:36:47 +00:00
|
|
|
builder: (_) => getIt.get<RestoreOptionsPage>(param1: isNewInstall));
|
2020-10-19 11:20:24 +00:00
|
|
|
|
2023-04-27 15:06:09 +00:00
|
|
|
case Routes.restoreWalletFromSeedKeys:
|
2023-04-21 18:36:47 +00:00
|
|
|
final isNewInstall = settings.arguments as bool;
|
2023-04-27 15:06:09 +00:00
|
|
|
|
|
|
|
if (isNewInstall) {
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (_) => getIt.get<SetupPinCodePage>(
|
|
|
|
param1: (PinCodeState<PinCodeWidget> context, dynamic _) {
|
|
|
|
if (isSingleCoin) {
|
|
|
|
return Navigator.of(context.context)
|
|
|
|
.pushNamed(Routes.restoreWallet, arguments: availableWalletTypes.first);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Navigator.pushNamed(
|
|
|
|
context.context, Routes.restoreWalletType);
|
|
|
|
}),
|
|
|
|
fullscreenDialog: true);
|
|
|
|
} else if (isSingleCoin) {
|
|
|
|
return MaterialPageRoute<void>(
|
|
|
|
builder: (_) => getIt.get<WalletRestorePage>(
|
|
|
|
param1: availableWalletTypes.first
|
|
|
|
));
|
|
|
|
} else {
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (_) => getIt.get<NewWalletTypePage>(
|
|
|
|
param1: (BuildContext context, WalletType type) =>
|
|
|
|
Navigator.of(context)
|
|
|
|
.pushNamed(Routes.restoreWallet, arguments: type),
|
|
|
|
param2: false));
|
|
|
|
}
|
2020-10-19 11:20:24 +00:00
|
|
|
|
|
|
|
case Routes.seed:
|
|
|
|
return MaterialPageRoute<void>(
|
2023-05-19 14:33:16 +00:00
|
|
|
fullscreenDialog: true,
|
2020-10-19 11:20:24 +00:00
|
|
|
builder: (_) =>
|
|
|
|
getIt.get<WalletSeedPage>(param1: settings.arguments as bool));
|
|
|
|
|
|
|
|
case Routes.restoreWallet:
|
|
|
|
return MaterialPageRoute<void>(
|
2020-12-21 20:20:46 +00:00
|
|
|
builder: (_) => getIt.get<WalletRestorePage>(
|
|
|
|
param1: settings.arguments as WalletType));
|
2020-10-19 11:20:24 +00:00
|
|
|
|
2023-04-21 18:36:47 +00:00
|
|
|
case Routes.sweepingWalletPage:
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (_) => getIt.get<SweepingWalletPage>());
|
|
|
|
|
2020-10-19 11:20:24 +00:00
|
|
|
case Routes.dashboard:
|
|
|
|
return CupertinoPageRoute<void>(
|
2023-06-07 23:16:52 +00:00
|
|
|
settings: settings,
|
2020-10-19 11:20:24 +00:00
|
|
|
builder: (_) => getIt.get<DashboardPage>());
|
|
|
|
|
|
|
|
case Routes.send:
|
2022-11-08 14:56:27 +00:00
|
|
|
final initialPaymentRequest = settings.arguments as PaymentRequest?;
|
2022-08-09 13:47:41 +00:00
|
|
|
|
2020-10-19 11:20:24 +00:00
|
|
|
return CupertinoPageRoute<void>(
|
2022-08-09 13:47:41 +00:00
|
|
|
fullscreenDialog: true, builder: (_) => getIt.get<SendPage>(
|
|
|
|
param1: initialPaymentRequest,
|
|
|
|
));
|
2020-10-19 11:20:24 +00:00
|
|
|
|
|
|
|
case Routes.sendTemplate:
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
fullscreenDialog: true,
|
|
|
|
builder: (_) => getIt.get<SendTemplatePage>());
|
|
|
|
|
|
|
|
case Routes.receive:
|
|
|
|
return CupertinoPageRoute<void>(
|
2023-04-21 18:03:42 +00:00
|
|
|
builder: (_) => getIt.get<ReceivePage>());
|
2020-10-19 11:20:24 +00:00
|
|
|
|
2022-03-30 15:57:04 +00:00
|
|
|
case Routes.addressPage:
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
fullscreenDialog: true, builder: (_) => getIt.get<AddressPage>());
|
|
|
|
|
2020-10-19 11:20:24 +00:00
|
|
|
case Routes.transactionDetails:
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
fullscreenDialog: true,
|
2020-11-06 18:54:00 +00:00
|
|
|
builder: (_) => getIt.get<TransactionDetailsPage>(
|
|
|
|
param1: settings.arguments as TransactionInfo));
|
2020-10-19 11:20:24 +00:00
|
|
|
|
|
|
|
case Routes.newSubaddress:
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (_) =>
|
|
|
|
getIt.get<AddressEditOrCreatePage>(param1: settings.arguments));
|
|
|
|
|
|
|
|
case Routes.disclaimer:
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => DisclaimerPage());
|
|
|
|
|
|
|
|
case Routes.readDisclaimer:
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (_) => DisclaimerPage(isReadOnly: true));
|
|
|
|
|
|
|
|
case Routes.seedLanguage:
|
|
|
|
final args = settings.arguments as List<dynamic>;
|
|
|
|
final type = args.first as WalletType;
|
|
|
|
final redirectRoute = args[1] as String;
|
|
|
|
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) {
|
|
|
|
return SeedLanguage(
|
|
|
|
onConfirm: (context, lang) => Navigator.of(context)
|
|
|
|
.popAndPushNamed(redirectRoute, arguments: [type, lang]));
|
|
|
|
});
|
|
|
|
|
|
|
|
case Routes.walletList:
|
|
|
|
return MaterialPageRoute<void>(
|
|
|
|
fullscreenDialog: true, builder: (_) => getIt.get<WalletListPage>());
|
|
|
|
|
|
|
|
case Routes.auth:
|
|
|
|
return MaterialPageRoute<void>(
|
|
|
|
fullscreenDialog: true,
|
|
|
|
builder: (_) => getIt.get<AuthPage>(
|
|
|
|
param1: settings.arguments as OnAuthenticationFinished,
|
|
|
|
param2: true));
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
case Routes.totpAuthCodePage:
|
|
|
|
final args = settings.arguments as TotpAuthArgumentsModel;
|
|
|
|
return MaterialPageRoute<void>(
|
|
|
|
fullscreenDialog: true,
|
|
|
|
builder: (_) => getIt.get<TotpAuthCodePage>(
|
|
|
|
param1: args,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
case Routes.login:
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (context) => WillPopScope(
|
|
|
|
child: getIt.get<AuthPage>(instanceName: 'login'),
|
|
|
|
onWillPop: () async =>
|
|
|
|
// FIX-ME: Additional check does it works correctly
|
|
|
|
(await SystemChannels.platform.invokeMethod<bool>('SystemNavigator.pop') ??
|
|
|
|
false),
|
|
|
|
),
|
|
|
|
fullscreenDialog: true);
|
|
|
|
|
2020-10-19 11:20:24 +00:00
|
|
|
case Routes.unlock:
|
|
|
|
return MaterialPageRoute<void>(
|
|
|
|
fullscreenDialog: true,
|
2021-04-22 15:56:14 +00:00
|
|
|
builder: (_) => WillPopScope(
|
|
|
|
child: getIt.get<AuthPage>(
|
|
|
|
param1: settings.arguments as OnAuthenticationFinished,
|
|
|
|
param2: false),
|
|
|
|
onWillPop: () async => false));
|
2020-10-19 11:20:24 +00:00
|
|
|
|
2022-11-16 07:29:14 +00:00
|
|
|
case Routes.connectionSync:
|
2020-10-19 11:20:24 +00:00
|
|
|
return CupertinoPageRoute<void>(
|
2023-04-14 04:39:08 +00:00
|
|
|
fullscreenDialog: true,
|
2022-11-16 07:29:14 +00:00
|
|
|
builder: (_) => getIt.get<ConnectionSyncPage>());
|
2020-10-19 11:20:24 +00:00
|
|
|
|
2022-11-16 07:29:14 +00:00
|
|
|
case Routes.securityBackupPage:
|
|
|
|
return CupertinoPageRoute<void>(
|
2023-04-14 04:39:08 +00:00
|
|
|
fullscreenDialog: true,
|
2022-11-16 07:29:14 +00:00
|
|
|
builder: (_) => getIt.get<SecurityBackupPage>());
|
|
|
|
|
|
|
|
case Routes.privacyPage:
|
|
|
|
return CupertinoPageRoute<void>(
|
2023-04-14 04:39:08 +00:00
|
|
|
fullscreenDialog: true,
|
2022-11-16 07:29:14 +00:00
|
|
|
builder: (_) => getIt.get<PrivacyPage>());
|
|
|
|
|
|
|
|
case Routes.displaySettingsPage:
|
|
|
|
return CupertinoPageRoute<void>(
|
2023-04-14 04:39:08 +00:00
|
|
|
fullscreenDialog: true,
|
2022-11-16 07:29:14 +00:00
|
|
|
builder: (_) => getIt.get<DisplaySettingsPage>());
|
|
|
|
|
|
|
|
case Routes.otherSettingsPage:
|
|
|
|
return CupertinoPageRoute<void>(
|
2023-04-14 04:39:08 +00:00
|
|
|
fullscreenDialog: true,
|
2022-11-16 07:29:14 +00:00
|
|
|
builder: (_) => getIt.get<OtherSettingsPage>());
|
|
|
|
|
2020-10-19 11:20:24 +00:00
|
|
|
case Routes.newNode:
|
2023-03-15 13:24:38 +00:00
|
|
|
final args = settings.arguments as Map<String, dynamic>?;
|
2020-10-19 11:20:24 +00:00
|
|
|
return CupertinoPageRoute<void>(
|
2023-03-15 13:24:38 +00:00
|
|
|
builder: (_) => getIt.get<NodeCreateOrEditPage>(
|
|
|
|
param1: args?['editingNode'] as Node?,
|
|
|
|
param2: args?['isSelected'] as bool?));
|
2020-10-19 11:20:24 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
|
2020-10-19 11:20:24 +00:00
|
|
|
|
|
|
|
case Routes.accountCreation:
|
|
|
|
return CupertinoPageRoute<String>(
|
2020-11-17 18:16:58 +00:00
|
|
|
builder: (_) => getIt.get<MoneroAccountEditOrCreatePage>(
|
2022-10-24 19:25:14 +00:00
|
|
|
param1: settings.arguments as AccountListItem?));
|
2020-10-19 11:20:24 +00:00
|
|
|
|
|
|
|
case Routes.addressBook:
|
|
|
|
return MaterialPageRoute<void>(
|
2023-04-14 04:39:08 +00:00
|
|
|
fullscreenDialog: true,
|
|
|
|
builder: (_) => getIt.get<ContactListPage>());
|
2020-10-19 11:20:24 +00:00
|
|
|
|
|
|
|
case Routes.pickerAddressBook:
|
2023-02-06 16:33:12 +00:00
|
|
|
final selectedCurrency = settings.arguments as CryptoCurrency?;
|
2020-10-19 11:20:24 +00:00
|
|
|
return MaterialPageRoute<void>(
|
2022-12-02 21:36:22 +00:00
|
|
|
builder: (_) => getIt.get<ContactListPage>(param1: selectedCurrency));
|
2020-10-19 11:20:24 +00:00
|
|
|
|
|
|
|
case Routes.addressBookAddContact:
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (_) => getIt.get<ContactPage>(
|
2022-10-12 17:09:57 +00:00
|
|
|
param1: settings.arguments as ContactRecord?));
|
2020-10-19 11:20:24 +00:00
|
|
|
|
|
|
|
case Routes.showKeys:
|
|
|
|
return MaterialPageRoute<void>(
|
|
|
|
builder: (_) => getIt.get<WalletKeysPage>(), fullscreenDialog: true);
|
|
|
|
|
|
|
|
case Routes.exchangeTrade:
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (_) => getIt.get<ExchangeTradePage>());
|
|
|
|
|
|
|
|
case Routes.exchangeConfirm:
|
|
|
|
return MaterialPageRoute<void>(
|
|
|
|
builder: (_) => getIt.get<ExchangeConfirmPage>());
|
|
|
|
|
|
|
|
case Routes.tradeDetails:
|
|
|
|
return MaterialPageRoute<void>(
|
2023-05-17 14:43:23 +00:00
|
|
|
fullscreenDialog: true,
|
2020-12-18 12:42:53 +00:00
|
|
|
builder: (_) =>
|
|
|
|
getIt.get<TradeDetailsPage>(param1: settings.arguments as Trade));
|
2020-10-19 11:20:24 +00:00
|
|
|
|
2021-03-12 19:04:37 +00:00
|
|
|
case Routes.orderDetails:
|
|
|
|
return MaterialPageRoute<void>(
|
|
|
|
builder: (_) =>
|
|
|
|
getIt.get<OrderDetailsPage>(param1: settings.arguments as Order));
|
|
|
|
|
2021-04-12 18:22:22 +00:00
|
|
|
case Routes.preOrder:
|
2021-03-17 10:32:22 +00:00
|
|
|
return MaterialPageRoute<void>(
|
|
|
|
builder: (_) =>
|
2021-04-12 18:22:22 +00:00
|
|
|
getIt.get<PreOrderPage>());
|
|
|
|
|
2021-04-13 18:40:44 +00:00
|
|
|
case Routes.buyWebView:
|
2021-04-15 17:10:23 +00:00
|
|
|
final args = settings.arguments as List;
|
|
|
|
|
2021-03-17 10:32:22 +00:00
|
|
|
return MaterialPageRoute<void>(
|
2023-05-17 14:43:23 +00:00
|
|
|
fullscreenDialog: true,
|
2021-03-17 10:32:22 +00:00
|
|
|
builder: (_) =>
|
2021-04-15 17:10:23 +00:00
|
|
|
getIt.get<BuyWebViewPage>(param1: args));
|
2021-03-17 10:32:22 +00:00
|
|
|
|
2020-10-19 11:20:24 +00:00
|
|
|
case Routes.restoreWalletFromSeedDetails:
|
|
|
|
final args = settings.arguments as List;
|
|
|
|
final walletRestorationFromSeedVM =
|
|
|
|
getIt.get<WalletRestorationFromSeedVM>(param1: args);
|
|
|
|
|
|
|
|
return CupertinoPageRoute<void>(
|
2023-05-17 14:43:23 +00:00
|
|
|
fullscreenDialog: true,
|
2020-10-19 11:20:24 +00:00
|
|
|
builder: (_) => RestoreWalletFromSeedDetailsPage(
|
|
|
|
walletRestorationFromSeedVM: walletRestorationFromSeedVM));
|
|
|
|
|
|
|
|
case Routes.exchange:
|
|
|
|
return CupertinoPageRoute<void>(
|
2023-04-14 04:39:08 +00:00
|
|
|
fullscreenDialog: true,
|
2020-10-19 11:20:24 +00:00
|
|
|
builder: (_) => getIt.get<ExchangePage>());
|
|
|
|
|
|
|
|
case Routes.exchangeTemplate:
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (_) => getIt.get<ExchangeTemplatePage>());
|
|
|
|
|
|
|
|
case Routes.rescan:
|
|
|
|
return MaterialPageRoute<void>(builder: (_) => getIt.get<RescanPage>());
|
|
|
|
|
|
|
|
case Routes.faq:
|
|
|
|
return MaterialPageRoute<void>(builder: (_) => getIt.get<FaqPage>());
|
|
|
|
|
2020-11-27 11:08:17 +00:00
|
|
|
case Routes.preSeed:
|
|
|
|
return MaterialPageRoute<void>(
|
2020-12-21 20:20:46 +00:00
|
|
|
builder: (_) =>
|
|
|
|
getIt.get<PreSeedPage>(param1: settings.arguments as WalletType));
|
2021-01-13 16:43:34 +00:00
|
|
|
|
|
|
|
case Routes.backup:
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
fullscreenDialog: true, builder: (_) => getIt.get<BackupPage>());
|
|
|
|
|
|
|
|
case Routes.editBackupPassword:
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (_) => getIt.get<EditBackupPasswordPage>());
|
|
|
|
|
|
|
|
case Routes.restoreFromBackup:
|
|
|
|
return CupertinoPageRoute<void>(
|
2023-05-17 14:43:23 +00:00
|
|
|
fullscreenDialog: true,
|
2021-01-13 16:43:34 +00:00
|
|
|
builder: (_) => getIt.get<RestoreFromBackupPage>());
|
2020-11-27 11:08:17 +00:00
|
|
|
|
2021-02-25 18:25:52 +00:00
|
|
|
case Routes.support:
|
|
|
|
return CupertinoPageRoute<void>(
|
2023-04-14 04:39:08 +00:00
|
|
|
fullscreenDialog: true,
|
2021-02-25 18:25:52 +00:00
|
|
|
builder: (_) => getIt.get<SupportPage>());
|
|
|
|
|
2021-05-25 17:32:36 +00:00
|
|
|
case Routes.unspentCoinsList:
|
|
|
|
return MaterialPageRoute<void>(
|
|
|
|
builder: (_) => getIt.get<UnspentCoinsListPage>());
|
|
|
|
|
2021-05-27 17:57:51 +00:00
|
|
|
case Routes.unspentCoinsDetails:
|
2021-07-05 13:52:24 +00:00
|
|
|
final args = settings.arguments as List;
|
|
|
|
|
2021-05-27 17:57:51 +00:00
|
|
|
return MaterialPageRoute<void>(
|
|
|
|
builder: (_) =>
|
|
|
|
getIt.get<UnspentCoinsDetailsPage>(
|
2021-07-05 13:52:24 +00:00
|
|
|
param1: args));
|
2021-05-27 17:57:51 +00:00
|
|
|
|
2022-06-23 09:25:00 +00:00
|
|
|
case Routes.fullscreenQR:
|
|
|
|
return MaterialPageRoute<void>(
|
|
|
|
builder: (_) =>
|
|
|
|
getIt.get<FullscreenQRPage>(
|
2023-04-21 18:03:42 +00:00
|
|
|
param1: settings.arguments as QrViewData,
|
2022-06-23 09:25:00 +00:00
|
|
|
));
|
|
|
|
|
2022-07-28 17:03:16 +00:00
|
|
|
case Routes.ioniaWelcomePage:
|
2023-04-14 04:39:08 +00:00
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
fullscreenDialog: true,
|
|
|
|
builder: (_) => getIt.get<IoniaWelcomePage>(),
|
|
|
|
);
|
2022-07-28 17:03:16 +00:00
|
|
|
|
|
|
|
case Routes.ioniaLoginPage:
|
|
|
|
return CupertinoPageRoute<void>( builder: (_) => getIt.get<IoniaLoginPage>());
|
|
|
|
|
|
|
|
case Routes.ioniaCreateAccountPage:
|
|
|
|
return CupertinoPageRoute<void>( builder: (_) => getIt.get<IoniaCreateAccountPage>());
|
|
|
|
|
|
|
|
case Routes.ioniaManageCardsPage:
|
2023-06-07 23:16:52 +00:00
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (_) => getIt.get<IoniaManageCardsPage>());
|
2022-07-28 17:03:16 +00:00
|
|
|
|
|
|
|
case Routes.ioniaBuyGiftCardPage:
|
|
|
|
final args = settings.arguments as List;
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => getIt.get<IoniaBuyGiftCardPage>(param1: args));
|
|
|
|
|
|
|
|
case Routes.ioniaBuyGiftCardDetailPage:
|
|
|
|
final args = settings.arguments as List;
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => getIt.get<IoniaBuyGiftCardDetailPage>(param1: args));
|
|
|
|
|
|
|
|
case Routes.ioniaVerifyIoniaOtpPage:
|
|
|
|
final args = settings.arguments as List;
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) =>getIt.get<IoniaVerifyIoniaOtp>(param1: args));
|
|
|
|
|
|
|
|
case Routes.ioniaDebitCardPage:
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => getIt.get<IoniaDebitCardPage>());
|
|
|
|
|
|
|
|
case Routes.ioniaActivateDebitCardPage:
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => getIt.get<IoniaActivateDebitCardPage>());
|
|
|
|
|
|
|
|
case Routes.ioniaAccountPage:
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => getIt.get<IoniaAccountPage>());
|
|
|
|
|
|
|
|
case Routes.ioniaAccountCardsPage:
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => getIt.get<IoniaAccountCardsPage>());
|
|
|
|
|
|
|
|
case Routes.ioniaCustomTipPage:
|
|
|
|
final args = settings.arguments as List;
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) =>getIt.get<IoniaCustomTipPage>(param1: args));
|
|
|
|
|
|
|
|
case Routes.ioniaGiftCardDetailPage:
|
|
|
|
final args = settings.arguments as List;
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => getIt.get<IoniaGiftCardDetailPage>(param1: args.first));
|
2022-09-02 13:47:45 +00:00
|
|
|
|
|
|
|
case Routes.ioniaCustomRedeemPage:
|
|
|
|
final args = settings.arguments as List;
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => getIt.get<IoniaCustomRedeemPage>(param1: args));
|
|
|
|
|
|
|
|
case Routes.ioniaMoreOptionsPage:
|
|
|
|
final args = settings.arguments as List;
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => getIt.get<IoniaMoreOptionsPage>(param1: args));
|
2022-07-28 17:03:16 +00:00
|
|
|
|
|
|
|
case Routes.ioniaPaymentStatusPage:
|
|
|
|
final args = settings.arguments as List;
|
|
|
|
final paymentInfo = args.first as IoniaAnyPayPaymentInfo;
|
|
|
|
final commitedInfo = args[1] as AnyPayPaymentCommittedInfo;
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => getIt.get<IoniaPaymentStatusPage>(
|
|
|
|
param1: paymentInfo,
|
|
|
|
param2: commitedInfo));
|
|
|
|
|
2023-06-13 23:15:10 +00:00
|
|
|
case Routes.webViewPage:
|
|
|
|
final args = settings.arguments as List;
|
|
|
|
final title = args.first as String;
|
|
|
|
final url = args[1] as Uri;
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => getIt.get<WebViewPage>(
|
|
|
|
param1: title,
|
|
|
|
param2: url));
|
2022-10-27 21:33:58 +00:00
|
|
|
|
2023-03-31 18:34:39 +00:00
|
|
|
case Routes.payfuraPage:
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => getIt.get<PayFuraPage>());
|
|
|
|
|
2022-12-04 03:08:42 +00:00
|
|
|
case Routes.advancedPrivacySettings:
|
2022-10-05 13:58:25 +00:00
|
|
|
final type = settings.arguments as WalletType;
|
|
|
|
|
|
|
|
return CupertinoPageRoute<void>(
|
2022-12-04 03:08:42 +00:00
|
|
|
builder: (_) => AdvancedPrivacySettingsPage(
|
|
|
|
getIt.get<AdvancedPrivacySettingsViewModel>(param1: type),
|
|
|
|
getIt.get<NodeCreateOrEditViewModel>(param1: type),
|
|
|
|
));
|
2023-04-14 04:39:08 +00:00
|
|
|
|
2023-03-24 15:26:42 +00:00
|
|
|
case Routes.anonPayInvoicePage:
|
|
|
|
final args = settings.arguments as List;
|
2023-05-10 13:58:31 +00:00
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (_) => getIt.get<AnonPayInvoicePage>(param1: args));
|
2023-04-14 04:39:08 +00:00
|
|
|
|
2023-03-24 15:26:42 +00:00
|
|
|
case Routes.anonPayReceivePage:
|
|
|
|
final anonInvoiceViewData = settings.arguments as AnonpayInfoBase;
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => getIt.get<AnonPayReceivePage>(param1: anonInvoiceViewData));
|
2023-04-14 04:39:08 +00:00
|
|
|
|
2023-03-24 15:26:42 +00:00
|
|
|
case Routes.anonPayDetailsPage:
|
|
|
|
final anonInvoiceViewData = settings.arguments as AnonpayInvoiceInfo;
|
|
|
|
return CupertinoPageRoute<void>(builder: (_) => getIt.get<AnonpayDetailsPage>(param1: anonInvoiceViewData));
|
2023-04-14 04:39:08 +00:00
|
|
|
|
|
|
|
case Routes.desktop_actions:
|
|
|
|
return PageRouteBuilder(
|
|
|
|
opaque: false,
|
|
|
|
pageBuilder: (_, __, ___) => DesktopDashboardActions(getIt<DashboardViewModel>()),
|
|
|
|
);
|
|
|
|
|
|
|
|
case Routes.desktop_settings_page:
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
builder: (_) => DesktopSettingsPage());
|
|
|
|
|
|
|
|
case Routes.empty_no_route:
|
|
|
|
return MaterialPageRoute<void>(
|
|
|
|
builder: (_) => SizedBox.shrink());
|
|
|
|
|
|
|
|
case Routes.transactionsPage:
|
|
|
|
return CupertinoPageRoute<void>(
|
|
|
|
settings: settings,
|
|
|
|
fullscreenDialog: true,
|
|
|
|
builder: (_) => getIt.get<TransactionsPage>());
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
case Routes.setup_2faPage:
|
|
|
|
return MaterialPageRoute<void>(builder: (_) => getIt.get<Setup2FAPage>());
|
|
|
|
|
|
|
|
case Routes.setup_2faQRPage:
|
|
|
|
return MaterialPageRoute<void>(builder: (_) => getIt.get<Setup2FAQRPage>());
|
|
|
|
|
|
|
|
case Routes.modify2FAPage:
|
|
|
|
return MaterialPageRoute<void>(builder: (_) => getIt.get<Modify2FAPage>());
|
|
|
|
|
2020-10-19 11:20:24 +00:00
|
|
|
default:
|
|
|
|
return MaterialPageRoute<void>(
|
|
|
|
builder: (_) => Scaffold(
|
|
|
|
body: Center(
|
2022-10-12 17:09:57 +00:00
|
|
|
child: Text(S.current.router_no_route(settings.name ?? 'No route')))));
|
2020-01-04 19:31:52 +00:00
|
|
|
}
|
2020-11-06 18:54:00 +00:00
|
|
|
}
|