2023-03-24 15:26:42 +00:00
|
|
|
import 'package:cake_wallet/anonpay/anonpay_api.dart';
|
|
|
|
import 'package:cake_wallet/anonpay/anonpay_info_base.dart';
|
|
|
|
import 'package:cake_wallet/anonpay/anonpay_invoice_info.dart';
|
2024-01-01 13:05:37 +00:00
|
|
|
import 'package:cake_wallet/buy/moonpay/moonpay_provider.dart';
|
2023-04-14 04:39:08 +00:00
|
|
|
import 'package:cake_wallet/buy/onramper/onramper_buy_provider.dart';
|
2023-10-12 22:50:16 +00:00
|
|
|
import 'package:cake_wallet/bitcoin_cash/bitcoin_cash.dart';
|
2023-04-14 04:39:08 +00:00
|
|
|
import 'package:cake_wallet/buy/payfura/payfura_buy_provider.dart';
|
2023-10-03 14:56:10 +00:00
|
|
|
import 'package:cake_wallet/core/wallet_connect/wallet_connect_key_service.dart';
|
|
|
|
import 'package:cake_wallet/core/wallet_connect/wc_bottom_sheet_service.dart';
|
2023-09-14 19:14:49 +00:00
|
|
|
import 'package:cake_wallet/buy/robinhood/robinhood_buy_provider.dart';
|
2023-10-03 14:56:10 +00:00
|
|
|
import 'package:cake_wallet/core/wallet_connect/web3wallet_service.dart';
|
2022-03-15 09:11:53 +00:00
|
|
|
import 'package:cake_wallet/core/yat_service.dart';
|
2023-08-04 17:55:56 +00:00
|
|
|
import 'package:cake_wallet/entities/background_tasks.dart';
|
2023-03-24 15:26:42 +00:00
|
|
|
import 'package:cake_wallet/entities/exchange_api_mode.dart';
|
2022-03-15 09:11:53 +00:00
|
|
|
import 'package:cake_wallet/entities/parse_address_from_domain.dart';
|
2023-03-24 15:26:42 +00:00
|
|
|
import 'package:cake_wallet/entities/receive_page_option.dart';
|
2023-08-04 17:01:49 +00:00
|
|
|
import 'package:cake_wallet/ethereum/ethereum.dart';
|
2023-10-05 01:09:07 +00:00
|
|
|
import 'package:cake_wallet/nano/nano.dart';
|
2022-07-28 17:03:16 +00:00
|
|
|
import 'package:cake_wallet/ionia/ionia_anypay.dart';
|
|
|
|
import 'package:cake_wallet/ionia/ionia_gift_card.dart';
|
2022-09-01 16:29:58 +00:00
|
|
|
import 'package:cake_wallet/ionia/ionia_tip.dart';
|
2023-12-02 02:26:43 +00:00
|
|
|
import 'package:cake_wallet/polygon/polygon.dart';
|
2023-05-17 14:43:23 +00:00
|
|
|
import 'package:cake_wallet/routes.dart';
|
2023-03-24 15:26:42 +00:00
|
|
|
import 'package:cake_wallet/src/screens/anonpay_details/anonpay_details_page.dart';
|
2023-09-14 19:14:49 +00:00
|
|
|
import 'package:cake_wallet/src/screens/buy/buy_options_page.dart';
|
2023-06-13 23:15:10 +00:00
|
|
|
import 'package:cake_wallet/src/screens/buy/webview_page.dart';
|
2023-04-14 04:39:08 +00:00
|
|
|
import 'package:cake_wallet/src/screens/dashboard/desktop_dashboard_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart';
|
2023-08-04 17:01:49 +00:00
|
|
|
import 'package:cake_wallet/src/screens/dashboard/edit_token_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/dashboard/home_settings_page.dart';
|
2023-11-22 17:43:26 +00:00
|
|
|
import 'package:cake_wallet/src/screens/dashboard/pages/transactions_page.dart';
|
2023-10-05 01:09:07 +00:00
|
|
|
import 'package:cake_wallet/src/screens/nano/nano_change_rep_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/nano_accounts/nano_account_edit_or_create_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/nano_accounts/nano_account_list_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/nodes/pow_node_create_or_edit_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-10-05 01:09:07 +00:00
|
|
|
import 'package:cake_wallet/src/screens/restore/wallet_restore_choose_derivation.dart';
|
2022-11-18 18:53:35 +00:00
|
|
|
import 'package:cake_wallet/src/screens/settings/display_settings_page.dart';
|
2023-11-03 19:23:11 +00:00
|
|
|
import 'package:cake_wallet/src/screens/settings/domain_lookups_page.dart';
|
2023-08-04 17:55:56 +00:00
|
|
|
import 'package:cake_wallet/src/screens/settings/manage_nodes_page.dart';
|
2022-11-18 18:53:35 +00:00
|
|
|
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-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_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-11-16 07:29:14 +00:00
|
|
|
import 'package:cake_wallet/src/screens/settings/connection_sync_page.dart';
|
2023-11-16 23:23:34 +00:00
|
|
|
import 'package:cake_wallet/src/screens/settings/trocador_providers_page.dart';
|
2023-11-18 13:43:15 +00:00
|
|
|
import 'package:cake_wallet/src/screens/settings/tor_page.dart';
|
2023-05-17 14:43:23 +00:00
|
|
|
import 'package:cake_wallet/src/screens/setup_2fa/modify_2fa_page.dart';
|
2023-12-30 19:55:17 +00:00
|
|
|
import 'package:cake_wallet/src/screens/setup_2fa/setup_2fa_info_page.dart';
|
2023-05-17 14:43:23 +00:00
|
|
|
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';
|
2023-08-15 00:47:25 +00:00
|
|
|
import 'package:cake_wallet/src/screens/support_chat/support_chat_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/support_other_links/support_other_links_page.dart';
|
2023-07-12 23:20:11 +00:00
|
|
|
import 'package:cake_wallet/src/screens/wallet/wallet_edit_page.dart';
|
2023-11-02 14:41:11 +00:00
|
|
|
import 'package:cake_wallet/src/screens/wallet_connect/wc_connections_listing_view.dart';
|
2023-04-14 04:39:08 +00:00
|
|
|
import 'package:cake_wallet/themes/theme_list.dart';
|
|
|
|
import 'package:cake_wallet/utils/device_info.dart';
|
2023-03-24 15:26:42 +00:00
|
|
|
import 'package:cake_wallet/store/anonpay/anonpay_transactions_store.dart';
|
2022-08-09 13:47:41 +00:00
|
|
|
import 'package:cake_wallet/utils/payment_request.dart';
|
2023-06-13 23:04:52 +00:00
|
|
|
import 'package:cake_wallet/utils/responsive_layout_util.dart';
|
2023-04-14 04:39:08 +00:00
|
|
|
import 'package:cake_wallet/view_model/dashboard/desktop_sidebar_view_model.dart';
|
2023-03-24 15:26:42 +00:00
|
|
|
import 'package:cake_wallet/view_model/anon_invoice_page_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/anonpay_details_view_model.dart';
|
2023-08-04 17:01:49 +00:00
|
|
|
import 'package:cake_wallet/view_model/dashboard/home_settings_view_model.dart';
|
2023-06-07 23:16:52 +00:00
|
|
|
import 'package:cake_wallet/view_model/dashboard/market_place_view_model.dart';
|
2023-11-22 17:43:26 +00:00
|
|
|
import 'package:cake_wallet/view_model/dashboard/nft_view_model.dart';
|
2023-03-24 15:26:42 +00:00
|
|
|
import 'package:cake_wallet/view_model/dashboard/receive_option_view_model.dart';
|
2022-07-28 17:03:16 +00:00
|
|
|
import 'package:cake_wallet/view_model/ionia/ionia_auth_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/ionia/ionia_buy_card_view_model.dart';
|
2022-09-01 16:29:58 +00:00
|
|
|
import 'package:cake_wallet/view_model/ionia/ionia_custom_tip_view_model.dart';
|
2022-09-02 13:47:45 +00:00
|
|
|
import 'package:cake_wallet/view_model/ionia/ionia_custom_redeem_view_model.dart';
|
2022-07-28 17:03:16 +00:00
|
|
|
import 'package:cake_wallet/ionia/ionia_service.dart';
|
|
|
|
import 'package:cake_wallet/ionia/ionia_api.dart';
|
|
|
|
import 'package:cake_wallet/ionia/ionia_merchant.dart';
|
2021-12-24 12:37:24 +00:00
|
|
|
import 'package:cake_wallet/monero/monero.dart';
|
2022-03-30 15:57:04 +00:00
|
|
|
import 'package:cake_wallet/haven/haven.dart';
|
2021-12-24 12:37:24 +00:00
|
|
|
import 'package:cake_wallet/bitcoin/bitcoin.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';
|
|
|
|
import 'package:cake_wallet/src/screens/ionia/cards/ionia_custom_tip_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/ionia/ionia.dart';
|
2023-11-22 17:43:26 +00:00
|
|
|
import 'package:cake_wallet/src/screens/dashboard/pages/balance_page.dart';
|
2022-07-28 17:03:16 +00:00
|
|
|
import 'package:cake_wallet/view_model/ionia/ionia_account_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/ionia/ionia_gift_cards_list_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/ionia/ionia_purchase_merch_view_model.dart';
|
2023-10-05 01:09:07 +00:00
|
|
|
import 'package:cake_wallet/view_model/nano_account_list/nano_account_edit_or_create_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/nano_account_list/nano_account_list_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/node_list/pow_node_list_view_model.dart';
|
2023-12-09 01:37:39 +00:00
|
|
|
import 'package:cake_wallet/view_model/seed_type_view_model.dart';
|
2023-05-17 14:43:23 +00:00
|
|
|
import 'package:cake_wallet/view_model/set_up_2fa_viewmodel.dart';
|
2023-04-21 18:36:47 +00:00
|
|
|
import 'package:cake_wallet/view_model/restore/restore_from_qr_vm.dart';
|
2022-11-23 17:06:41 +00:00
|
|
|
import 'package:cake_wallet/view_model/settings/display_settings_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/settings/other_settings_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/settings/privacy_settings_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/settings/security_settings_view_model.dart';
|
2022-12-04 03:08:42 +00:00
|
|
|
import 'package:cake_wallet/view_model/advanced_privacy_settings_view_model.dart';
|
2023-11-16 23:23:34 +00:00
|
|
|
import 'package:cake_wallet/view_model/settings/trocador_providers_view_model.dart';
|
2023-01-20 19:44:08 +00:00
|
|
|
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_item.dart';
|
2023-07-12 23:20:11 +00:00
|
|
|
import 'package:cake_wallet/view_model/wallet_list/wallet_edit_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/wallet_list/wallet_list_item.dart';
|
2023-10-05 01:09:07 +00:00
|
|
|
import 'package:cake_wallet/view_model/wallet_restore_choose_derivation_view_model.dart';
|
2023-08-04 17:01:49 +00:00
|
|
|
import 'package:cw_core/erc20_token.dart';
|
2023-10-05 01:09:07 +00:00
|
|
|
import 'package:cw_core/nano_account.dart';
|
2021-12-24 12:37:24 +00:00
|
|
|
import 'package:cw_core/unspent_coins_info.dart';
|
2021-01-15 17:41:30 +00:00
|
|
|
import 'package:cake_wallet/core/backup_service.dart';
|
2021-12-24 12:37:24 +00:00
|
|
|
import 'package:cw_core/wallet_service.dart';
|
2020-09-21 11:50:26 +00:00
|
|
|
import 'package:cake_wallet/entities/biometric_auth.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';
|
2020-11-06 18:54:00 +00:00
|
|
|
import 'package:cake_wallet/entities/transaction_description.dart';
|
2021-12-24 12:37:24 +00:00
|
|
|
import 'package:cw_core/transaction_info.dart';
|
2020-09-21 11:50:26 +00:00
|
|
|
import 'package:cake_wallet/entities/contact.dart';
|
2021-12-24 12:37:24 +00:00
|
|
|
import 'package:cw_core/node.dart';
|
2020-09-21 11:50:26 +00:00
|
|
|
import 'package:cake_wallet/exchange/trade.dart';
|
2020-11-12 20:02:37 +00:00
|
|
|
import 'package:cake_wallet/reactions/on_authentication_state_change.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';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/src/screens/contact/contact_list_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/contact/contact_page.dart';
|
2020-08-26 17:31:23 +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';
|
2020-09-28 15:47:43 +00:00
|
|
|
import 'package:cake_wallet/src/screens/faq/faq_page.dart';
|
2020-11-12 16:31:53 +00:00
|
|
|
import 'package:cake_wallet/src/screens/new_wallet/new_wallet_type_page.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/src/screens/nodes/node_create_or_edit_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';
|
2020-09-21 11:50:26 +00:00
|
|
|
import 'package:cake_wallet/src/screens/rescan/rescan_page.dart';
|
2021-01-13 16:43:34 +00:00
|
|
|
import 'package:cake_wallet/src/screens/restore/restore_from_backup_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/restore/restore_options_page.dart';
|
2020-10-13 21:11:04 +00:00
|
|
|
import 'package:cake_wallet/src/screens/restore/wallet_restore_page.dart';
|
2023-12-30 19:55:17 +00:00
|
|
|
import 'package:cake_wallet/src/screens/seed/pre_seed_page.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/src/screens/seed/wallet_seed_page.dart';
|
2020-07-29 16:55:42 +00:00
|
|
|
import 'package:cake_wallet/src/screens/send/send_template_page.dart';
|
2020-09-21 11:50:26 +00:00
|
|
|
import 'package:cake_wallet/src/screens/setup_pin_code/setup_pin_code.dart';
|
2021-02-25 18:25:52 +00:00
|
|
|
import 'package:cake_wallet/src/screens/support/support_page.dart';
|
2020-12-18 12:42:53 +00:00
|
|
|
import 'package:cake_wallet/src/screens/trade_details/trade_details_page.dart';
|
2020-11-06 18:54:00 +00:00
|
|
|
import 'package:cake_wallet/src/screens/transaction_details/transaction_details_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';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/src/screens/wallet_keys/wallet_keys_page.dart';
|
2020-07-31 15:29:21 +00:00
|
|
|
import 'package:cake_wallet/src/screens/exchange/exchange_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/exchange/exchange_template_page.dart';
|
2021-03-12 19:04:37 +00:00
|
|
|
import 'package:cake_wallet/store/dashboard/orders_store.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/store/node_list_store.dart';
|
2021-01-13 16:43:34 +00:00
|
|
|
import 'package:cake_wallet/store/secret_store.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/store/settings_store.dart';
|
2020-06-20 07:10:00 +00:00
|
|
|
import 'package:cake_wallet/core/auth_service.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/core/key_service.dart';
|
2021-12-24 12:37:24 +00:00
|
|
|
import 'package:cw_core/wallet_info.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/src/screens/monero_accounts/monero_account_list_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/monero_accounts/monero_account_edit_or_create_page.dart';
|
2020-06-20 07:10:00 +00:00
|
|
|
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/dashboard/dashboard_page.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/receive/receive_page.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/src/screens/send/send_page.dart';
|
2020-06-20 07:10:00 +00:00
|
|
|
import 'package:cake_wallet/src/screens/subaddress/address_edit_or_create_page.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/src/screens/wallet_list/wallet_list_page.dart';
|
|
|
|
import 'package:cake_wallet/store/wallet_list_store.dart';
|
2021-10-01 15:13:10 +00:00
|
|
|
import 'package:cake_wallet/store/yat/yat_store.dart';
|
2021-01-13 16:43:34 +00:00
|
|
|
import 'package:cake_wallet/view_model/backup_view_model.dart';
|
2021-04-12 18:22:22 +00:00
|
|
|
import 'package:cake_wallet/view_model/buy/buy_amount_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/buy/buy_view_model.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/view_model/contact_list/contact_list_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/contact_list/contact_view_model.dart';
|
2021-01-13 16:43:34 +00:00
|
|
|
import 'package:cake_wallet/view_model/edit_backup_password_view_model.dart';
|
2020-08-26 17:31:23 +00:00
|
|
|
import 'package:cake_wallet/view_model/exchange/exchange_trade_view_model.dart';
|
2020-11-17 18:16:58 +00:00
|
|
|
import 'package:cake_wallet/view_model/monero_account_list/account_list_item.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/view_model/node_list/node_list_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/node_list/node_create_or_edit_view_model.dart';
|
2021-03-12 19:04:37 +00:00
|
|
|
import 'package:cake_wallet/view_model/order_details_view_model.dart';
|
2020-09-21 11:50:26 +00:00
|
|
|
import 'package:cake_wallet/view_model/rescan_view_model.dart';
|
2021-01-13 16:43:34 +00:00
|
|
|
import 'package:cake_wallet/view_model/restore_from_backup_view_model.dart';
|
2021-07-16 09:32:36 +00:00
|
|
|
import 'package:cake_wallet/view_model/send/send_template_view_model.dart';
|
2020-09-21 11:50:26 +00:00
|
|
|
import 'package:cake_wallet/view_model/setup_pin_code_view_model.dart';
|
2021-02-25 18:25:52 +00:00
|
|
|
import 'package:cake_wallet/view_model/support_view_model.dart';
|
2020-12-22 18:42:30 +00:00
|
|
|
import 'package:cake_wallet/view_model/transaction_details_view_model.dart';
|
2020-12-18 12:42:53 +00:00
|
|
|
import 'package:cake_wallet/view_model/trade_details_view_model.dart';
|
2021-05-27 17:57:51 +00:00
|
|
|
import 'package:cake_wallet/view_model/unspent_coins/unspent_coins_details_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/unspent_coins/unspent_coins_item.dart';
|
2021-05-25 17:32:36 +00:00
|
|
|
import 'package:cake_wallet/view_model/unspent_coins/unspent_coins_list_view_model.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_edit_or_create_view_model.dart';
|
2020-06-20 07:10:00 +00:00
|
|
|
import 'package:cake_wallet/view_model/auth_view_model.dart';
|
2020-07-23 12:20:52 +00:00
|
|
|
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/monero_account_list/monero_account_edit_or_create_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/monero_account_list/monero_account_list_view_model.dart';
|
2020-08-25 16:32:40 +00:00
|
|
|
import 'package:cake_wallet/view_model/send/send_view_model.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/view_model/wallet_keys_view_model.dart';
|
|
|
|
import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart';
|
2020-10-13 21:11:04 +00:00
|
|
|
import 'package:cake_wallet/view_model/wallet_restore_view_model.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/view_model/wallet_seed_view_model.dart';
|
2020-07-31 15:29:21 +00:00
|
|
|
import 'package:cake_wallet/view_model/exchange/exchange_view_model.dart';
|
2020-09-21 11:50:26 +00:00
|
|
|
import 'package:flutter/widgets.dart';
|
2020-06-20 07:10:00 +00:00
|
|
|
import 'package:get_it/get_it.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:hive/hive.dart';
|
2020-10-01 16:46:23 +00:00
|
|
|
import 'package:mobx/mobx.dart';
|
2020-06-20 07:10:00 +00:00
|
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
|
|
|
import 'package:cake_wallet/core/wallet_creation_service.dart';
|
|
|
|
import 'package:cake_wallet/store/app_store.dart';
|
2021-12-24 12:37:24 +00:00
|
|
|
import 'package:cw_core/wallet_type.dart';
|
2020-06-20 07:10:00 +00:00
|
|
|
import 'package:cake_wallet/view_model/wallet_new_vm.dart';
|
|
|
|
import 'package:cake_wallet/store/authentication_store.dart';
|
2020-07-23 12:20:52 +00:00
|
|
|
import 'package:cake_wallet/store/dashboard/trades_store.dart';
|
|
|
|
import 'package:cake_wallet/store/dashboard/trade_filter_store.dart';
|
|
|
|
import 'package:cake_wallet/store/dashboard/transaction_filter_store.dart';
|
2020-09-21 11:50:26 +00:00
|
|
|
import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart';
|
2020-07-29 16:55:42 +00:00
|
|
|
import 'package:cake_wallet/store/templates/send_template_store.dart';
|
|
|
|
import 'package:cake_wallet/store/templates/exchange_template_store.dart';
|
2020-09-21 11:50:26 +00:00
|
|
|
import 'package:cake_wallet/entities/template.dart';
|
|
|
|
import 'package:cake_wallet/exchange/exchange_template.dart';
|
2021-03-16 13:20:46 +00:00
|
|
|
import 'package:cake_wallet/.secrets.g.dart' as secrets;
|
2023-11-22 17:43:26 +00:00
|
|
|
import 'package:cake_wallet/src/screens/dashboard/pages/address_page.dart';
|
2022-07-28 17:03:16 +00:00
|
|
|
import 'package:cake_wallet/anypay/anypay_api.dart';
|
|
|
|
import 'package:cake_wallet/view_model/ionia/ionia_gift_card_details_view_model.dart';
|
|
|
|
import 'package:cake_wallet/src/screens/ionia/cards/ionia_payment_status_page.dart';
|
|
|
|
import 'package:cake_wallet/view_model/ionia/ionia_payment_status_view_model.dart';
|
|
|
|
import 'package:cake_wallet/anypay/any_pay_payment_committed_info.dart';
|
|
|
|
import 'package:cake_wallet/ionia/ionia_any_pay_payment_info.dart';
|
2022-06-23 09:25:00 +00:00
|
|
|
import 'package:cake_wallet/src/screens/receive/fullscreen_qr_page.dart';
|
2022-07-19 14:29:28 +00:00
|
|
|
import 'package:cake_wallet/core/wallet_loading_service.dart';
|
2022-11-05 18:05:55 +00:00
|
|
|
import 'package:cw_core/crypto_currency.dart';
|
2023-04-21 18:03:42 +00:00
|
|
|
import 'package:cake_wallet/entities/qr_view_data.dart';
|
2020-06-20 07:10:00 +00:00
|
|
|
|
2023-12-08 14:05:52 +00:00
|
|
|
import 'buy/dfx/dfx_buy_provider.dart';
|
2023-05-17 14:43:23 +00:00
|
|
|
import 'core/totp_request_details.dart';
|
2023-10-19 16:25:44 +00:00
|
|
|
import 'src/screens/settings/desktop_settings/desktop_settings_page.dart';
|
2023-05-17 14:43:23 +00:00
|
|
|
|
2020-06-20 07:10:00 +00:00
|
|
|
final getIt = GetIt.instance;
|
|
|
|
|
2021-01-15 17:41:30 +00:00
|
|
|
var _isSetupFinished = false;
|
2022-10-12 17:09:57 +00:00
|
|
|
late Box<WalletInfo> _walletInfoSource;
|
|
|
|
late Box<Node> _nodeSource;
|
2023-10-05 01:09:07 +00:00
|
|
|
late Box<Node> _powNodeSource;
|
2022-10-12 17:09:57 +00:00
|
|
|
late Box<Contact> _contactSource;
|
|
|
|
late Box<Trade> _tradesSource;
|
|
|
|
late Box<Template> _templates;
|
|
|
|
late Box<ExchangeTemplate> _exchangeTemplates;
|
|
|
|
late Box<TransactionDescription> _transactionDescriptionBox;
|
|
|
|
late Box<Order> _ordersSource;
|
2023-08-24 13:54:05 +00:00
|
|
|
late Box<UnspentCoinsInfo> _unspentCoinsInfoSource;
|
2023-03-24 15:26:42 +00:00
|
|
|
late Box<AnonpayInvoiceInfo> _anonpayInvoiceInfoSource;
|
2021-01-15 17:41:30 +00:00
|
|
|
|
2023-08-24 13:54:05 +00:00
|
|
|
Future<void> setup({
|
2023-05-17 14:43:23 +00:00
|
|
|
required Box<WalletInfo> walletInfoSource,
|
|
|
|
required Box<Node> nodeSource,
|
2023-10-05 01:09:07 +00:00
|
|
|
required Box<Node> powNodeSource,
|
2023-05-17 14:43:23 +00:00
|
|
|
required Box<Contact> contactSource,
|
|
|
|
required Box<Trade> tradesSource,
|
|
|
|
required Box<Template> templates,
|
|
|
|
required Box<ExchangeTemplate> exchangeTemplates,
|
|
|
|
required Box<TransactionDescription> transactionDescriptionBox,
|
|
|
|
required Box<Order> ordersSource,
|
2023-08-24 13:54:05 +00:00
|
|
|
required Box<UnspentCoinsInfo> unspentCoinsInfoSource,
|
2023-05-17 14:43:23 +00:00
|
|
|
required Box<AnonpayInvoiceInfo> anonpayInvoiceInfoSource,
|
2023-10-17 15:59:41 +00:00
|
|
|
required FlutterSecureStorage secureStorage,
|
2023-05-17 14:43:23 +00:00
|
|
|
}) async {
|
2021-01-15 17:41:30 +00:00
|
|
|
_walletInfoSource = walletInfoSource;
|
|
|
|
_nodeSource = nodeSource;
|
2023-10-05 01:09:07 +00:00
|
|
|
_powNodeSource = powNodeSource;
|
2021-01-15 17:41:30 +00:00
|
|
|
_contactSource = contactSource;
|
|
|
|
_tradesSource = tradesSource;
|
|
|
|
_templates = templates;
|
|
|
|
_exchangeTemplates = exchangeTemplates;
|
|
|
|
_transactionDescriptionBox = transactionDescriptionBox;
|
2021-03-12 19:04:37 +00:00
|
|
|
_ordersSource = ordersSource;
|
2021-07-05 13:52:24 +00:00
|
|
|
_unspentCoinsInfoSource = unspentCoinsInfoSource;
|
2023-03-24 15:26:42 +00:00
|
|
|
_anonpayInvoiceInfoSource = anonpayInvoiceInfoSource;
|
2021-01-15 17:41:30 +00:00
|
|
|
|
|
|
|
if (!_isSetupFinished) {
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerSingletonAsync<SharedPreferences>(() => SharedPreferences.getInstance());
|
2021-01-15 17:41:30 +00:00
|
|
|
}
|
2023-08-07 11:43:04 +00:00
|
|
|
if (!_isSetupFinished) {
|
|
|
|
getIt.registerFactory(() => BackgroundTasks());
|
|
|
|
}
|
2023-08-04 17:55:56 +00:00
|
|
|
|
2023-08-04 17:01:49 +00:00
|
|
|
final isBitcoinBuyEnabled = (secrets.wyreSecretKey.isNotEmpty) &&
|
|
|
|
(secrets.wyreApiKey.isNotEmpty) &&
|
|
|
|
(secrets.wyreAccountId.isNotEmpty);
|
2021-06-01 18:03:35 +00:00
|
|
|
|
2021-03-16 13:20:46 +00:00
|
|
|
final settingsStore = await SettingsStoreBase.load(
|
2023-04-14 04:39:08 +00:00
|
|
|
nodeSource: _nodeSource,
|
2023-10-05 01:09:07 +00:00
|
|
|
powNodeSource: _powNodeSource,
|
2023-04-14 04:39:08 +00:00
|
|
|
isBitcoinBuyEnabled: isBitcoinBuyEnabled,
|
|
|
|
// Enforce darkTheme on platforms other than mobile till the design for other themes is completed
|
2023-11-03 05:42:18 +00:00
|
|
|
initialTheme: responsiveLayoutUtil.shouldRenderMobileUI && DeviceInfo.instance.isMobile
|
2023-08-04 13:49:26 +00:00
|
|
|
? null
|
|
|
|
: ThemeList.darkTheme,
|
2023-04-14 04:39:08 +00:00
|
|
|
);
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2021-01-15 17:41:30 +00:00
|
|
|
if (_isSetupFinished) {
|
|
|
|
return;
|
|
|
|
}
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2021-01-15 17:41:30 +00:00
|
|
|
getIt.registerFactory<Box<Node>>(() => _nodeSource);
|
2023-10-05 01:09:07 +00:00
|
|
|
getIt.registerFactory<Box<Node>>(() => _powNodeSource, instanceName: Node.boxName + "pow");
|
2020-09-21 11:50:26 +00:00
|
|
|
|
2023-10-17 15:59:41 +00:00
|
|
|
getIt.registerSingleton<FlutterSecureStorage>(secureStorage);
|
2020-07-06 20:09:03 +00:00
|
|
|
getIt.registerSingleton(AuthenticationStore());
|
|
|
|
getIt.registerSingleton<WalletListStore>(WalletListStore());
|
2020-09-21 11:50:26 +00:00
|
|
|
getIt.registerSingleton(NodeListStoreBase.instance);
|
2020-07-06 20:09:03 +00:00
|
|
|
getIt.registerSingleton<SettingsStore>(settingsStore);
|
|
|
|
getIt.registerSingleton<AppStore>(AppStore(
|
|
|
|
authenticationStore: getIt.get<AuthenticationStore>(),
|
|
|
|
walletList: getIt.get<WalletListStore>(),
|
|
|
|
settingsStore: getIt.get<SettingsStore>(),
|
|
|
|
nodeListStore: getIt.get<NodeListStore>()));
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerSingleton<TradesStore>(
|
|
|
|
TradesStore(tradesSource: _tradesSource, settingsStore: getIt.get<SettingsStore>()));
|
|
|
|
getIt.registerSingleton<OrdersStore>(
|
|
|
|
OrdersStore(ordersSource: _ordersSource, settingsStore: getIt.get<SettingsStore>()));
|
2020-08-26 17:31:23 +00:00
|
|
|
getIt.registerSingleton<TradeFilterStore>(TradeFilterStore());
|
2020-07-23 12:20:52 +00:00
|
|
|
getIt.registerSingleton<TransactionFilterStore>(TransactionFilterStore());
|
2020-09-21 11:50:26 +00:00
|
|
|
getIt.registerSingleton<FiatConversionStore>(FiatConversionStore());
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerSingleton<SendTemplateStore>(SendTemplateStore(templateSource: _templates));
|
2020-07-29 16:55:42 +00:00
|
|
|
getIt.registerSingleton<ExchangeTemplateStore>(
|
2021-01-15 17:41:30 +00:00
|
|
|
ExchangeTemplateStore(templateSource: _exchangeTemplates));
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerSingleton<YatStore>(
|
|
|
|
YatStore(appStore: getIt.get<AppStore>(), secureStorage: getIt.get<FlutterSecureStorage>())
|
|
|
|
..init());
|
|
|
|
getIt.registerSingleton<AnonpayTransactionsStore>(
|
|
|
|
AnonpayTransactionsStore(anonpayInvoiceInfoSource: _anonpayInvoiceInfoSource));
|
2020-07-23 12:20:52 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
final secretStore = await SecretStoreBase.load(getIt.get<FlutterSecureStorage>());
|
2021-01-13 16:43:34 +00:00
|
|
|
|
|
|
|
getIt.registerSingleton<SecretStore>(secretStore);
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory<KeyService>(() => KeyService(getIt.get<FlutterSecureStorage>()));
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<WalletCreationService, WalletType, void>((type, _) =>
|
|
|
|
WalletCreationService(
|
2020-06-20 07:10:00 +00:00
|
|
|
initialType: type,
|
2020-07-06 20:09:03 +00:00
|
|
|
keyService: getIt.get<KeyService>(),
|
2020-06-20 07:10:00 +00:00
|
|
|
secureStorage: getIt.get<FlutterSecureStorage>(),
|
2022-07-14 11:48:59 +00:00
|
|
|
sharedPreferences: getIt.get<SharedPreferences>(),
|
2023-11-17 13:45:42 +00:00
|
|
|
settingsStore: getIt.get<SettingsStore>(),
|
2022-07-14 11:48:59 +00:00
|
|
|
walletInfoSource: _walletInfoSource));
|
2020-06-20 07:10:00 +00:00
|
|
|
|
2023-11-22 21:37:05 +00:00
|
|
|
getIt.registerFactoryParam<AdvancedPrivacySettingsViewModel, WalletType, void>(
|
|
|
|
(type, _) => AdvancedPrivacySettingsViewModel(type, getIt.get<SettingsStore>()));
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory<WalletLoadingService>(() => WalletLoadingService(
|
2022-07-19 14:29:28 +00:00
|
|
|
getIt.get<SharedPreferences>(),
|
|
|
|
getIt.get<KeyService>(),
|
|
|
|
(WalletType type) => getIt.get<WalletService>(param1: type)));
|
2023-11-24 05:53:20 +00:00
|
|
|
|
2023-11-17 13:45:42 +00:00
|
|
|
getIt.registerFactoryParam<WalletNewVM, WalletType, void>((type, _) =>
|
|
|
|
WalletNewVM(getIt.get<AppStore>(),
|
|
|
|
getIt.get<WalletCreationService>(param1: type), _walletInfoSource,
|
2023-11-22 21:37:05 +00:00
|
|
|
getIt.get<AdvancedPrivacySettingsViewModel>(param1: type),type: type));
|
2020-06-20 07:10:00 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<WalletRestorationFromQRVM, WalletType, void>((WalletType type, _) {
|
2023-04-21 18:36:47 +00:00
|
|
|
return WalletRestorationFromQRVM(getIt.get<AppStore>(),
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.get<WalletCreationService>(param1: type), _walletInfoSource, type);
|
2023-04-21 18:36:47 +00:00
|
|
|
});
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory<WalletAddressListViewModel>(() => WalletAddressListViewModel(
|
|
|
|
appStore: getIt.get<AppStore>(),
|
|
|
|
yatStore: getIt.get<YatStore>(),
|
|
|
|
fiatConversionStore: getIt.get<FiatConversionStore>()));
|
2020-06-20 07:10:00 +00:00
|
|
|
|
2020-08-25 16:32:40 +00:00
|
|
|
getIt.registerFactory(() => BalanceViewModel(
|
2020-09-24 09:16:13 +00:00
|
|
|
appStore: getIt.get<AppStore>(),
|
2020-08-25 16:32:40 +00:00
|
|
|
settingsStore: getIt.get<SettingsStore>(),
|
2020-09-21 11:50:26 +00:00
|
|
|
fiatConvertationStore: getIt.get<FiatConversionStore>()));
|
2020-07-23 12:20:52 +00:00
|
|
|
|
2020-08-25 16:32:40 +00:00
|
|
|
getIt.registerFactory(() => DashboardViewModel(
|
|
|
|
balanceViewModel: getIt.get<BalanceViewModel>(),
|
|
|
|
appStore: getIt.get<AppStore>(),
|
|
|
|
tradesStore: getIt.get<TradesStore>(),
|
|
|
|
tradeFilterStore: getIt.get<TradeFilterStore>(),
|
2021-03-16 13:20:46 +00:00
|
|
|
transactionFilterStore: getIt.get<TransactionFilterStore>(),
|
2021-03-24 10:22:42 +00:00
|
|
|
settingsStore: settingsStore,
|
2021-10-01 15:13:10 +00:00
|
|
|
yatStore: getIt.get<YatStore>(),
|
2023-03-24 15:26:42 +00:00
|
|
|
ordersStore: getIt.get<OrdersStore>(),
|
2023-12-19 13:16:15 +00:00
|
|
|
anonpayTransactionsStore: getIt.get<AnonpayTransactionsStore>(),
|
|
|
|
keyService: getIt.get<KeyService>()));
|
2020-06-20 07:10:00 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory<AuthService>(
|
|
|
|
() => AuthService(
|
2020-06-20 07:10:00 +00:00
|
|
|
secureStorage: getIt.get<FlutterSecureStorage>(),
|
2022-12-13 15:19:31 +00:00
|
|
|
sharedPreferences: getIt.get<SharedPreferences>(),
|
|
|
|
settingsStore: getIt.get<SettingsStore>(),
|
2023-05-17 14:43:23 +00:00
|
|
|
),
|
|
|
|
);
|
2020-06-20 07:10:00 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory<AuthViewModel>(() => AuthViewModel(getIt.get<AuthService>(),
|
|
|
|
getIt.get<SharedPreferences>(), getIt.get<SettingsStore>(), BiometricAuth()));
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<AuthPage, void Function(bool, AuthPageState), bool>(
|
|
|
|
(onAuthFinished, closable) => AuthPage(getIt.get<AuthViewModel>(),
|
|
|
|
onAuthenticationFinished: onAuthFinished, closable: closable));
|
|
|
|
|
2023-09-28 18:40:15 +00:00
|
|
|
getIt.registerLazySingleton<Setup2FAViewModel>(
|
2023-05-17 14:43:23 +00:00
|
|
|
() => Setup2FAViewModel(
|
2022-12-05 19:14:46 +00:00
|
|
|
getIt.get<SettingsStore>(),
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.get<SharedPreferences>(),
|
|
|
|
getIt.get<AuthService>(),
|
|
|
|
),
|
|
|
|
);
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<TotpAuthCodePage, TotpAuthArgumentsModel, void>(
|
|
|
|
(totpAuthPageArguments, _) => TotpAuthCodePage(
|
|
|
|
getIt.get<Setup2FAViewModel>(),
|
|
|
|
totpArguments: totpAuthPageArguments,
|
|
|
|
),
|
|
|
|
);
|
2020-06-20 07:10:00 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory<AuthPage>(() {
|
|
|
|
return AuthPage(getIt.get<AuthViewModel>(),
|
|
|
|
onAuthenticationFinished: (isAuthenticated, AuthPageState authPageState) {
|
|
|
|
if (!isAuthenticated) {
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
final authStore = getIt.get<AuthenticationStore>();
|
|
|
|
final appStore = getIt.get<AppStore>();
|
|
|
|
final useTotp = appStore.settingsStore.useTOTP2FA;
|
2023-08-04 13:49:26 +00:00
|
|
|
final shouldUseTotp2FAToAccessWallets =
|
|
|
|
appStore.settingsStore.shouldRequireTOTP2FAForAccessingWallet;
|
|
|
|
if (useTotp && shouldUseTotp2FAToAccessWallets) {
|
2023-05-17 14:43:23 +00:00
|
|
|
authPageState.close(
|
|
|
|
route: Routes.totpAuthCodePage,
|
|
|
|
arguments: TotpAuthArgumentsModel(
|
|
|
|
isForSetup: false,
|
|
|
|
isClosable: false,
|
|
|
|
onTotpAuthenticationFinished: (bool isAuthenticatedSuccessfully,
|
|
|
|
TotpAuthCodePageState totpAuthPageState) async {
|
|
|
|
if (!isAuthenticatedSuccessfully) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (appStore.wallet != null) {
|
|
|
|
authStore.allowed();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
totpAuthPageState.changeProcessText('Loading the wallet');
|
|
|
|
|
|
|
|
if (loginError != null) {
|
|
|
|
totpAuthPageState.changeProcessText('ERROR: ${loginError.toString()}');
|
|
|
|
}
|
|
|
|
|
|
|
|
ReactionDisposer? _reaction;
|
|
|
|
_reaction = reaction((_) => appStore.wallet, (Object? _) {
|
|
|
|
_reaction?.reaction.dispose();
|
|
|
|
authStore.allowed();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
),
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
if (appStore.wallet != null) {
|
|
|
|
authStore.allowed();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
authPageState.changeProcessText('Loading the wallet');
|
|
|
|
|
|
|
|
if (loginError != null) {
|
|
|
|
authPageState.changeProcessText('ERROR: ${loginError.toString()}');
|
|
|
|
}
|
|
|
|
|
|
|
|
ReactionDisposer? _reaction;
|
|
|
|
_reaction = reaction((_) => appStore.wallet, (Object? _) {
|
|
|
|
_reaction?.reaction.dispose();
|
|
|
|
authStore.allowed();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, closable: false);
|
|
|
|
}, instanceName: 'login');
|
|
|
|
|
2023-10-03 14:56:10 +00:00
|
|
|
getIt.registerSingleton<BottomSheetService>(BottomSheetServiceImpl());
|
2023-10-05 01:09:07 +00:00
|
|
|
|
2023-10-03 14:56:10 +00:00
|
|
|
final appStore = getIt.get<AppStore>();
|
|
|
|
|
2023-12-28 01:37:36 +00:00
|
|
|
getIt.registerLazySingleton<WalletConnectKeyService>(() => KeyServiceImpl());
|
2023-10-03 14:56:10 +00:00
|
|
|
|
|
|
|
getIt.registerLazySingleton<Web3WalletService>(() {
|
|
|
|
final Web3WalletService web3WalletService = Web3WalletService(
|
|
|
|
getIt.get<BottomSheetService>(),
|
|
|
|
getIt.get<WalletConnectKeyService>(),
|
|
|
|
appStore,
|
|
|
|
);
|
|
|
|
web3WalletService.create();
|
|
|
|
return web3WalletService;
|
|
|
|
});
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(() => BalancePage(
|
2023-11-22 17:43:26 +00:00
|
|
|
nftViewModel: getIt.get<NFTViewModel>(),
|
2023-04-14 04:39:08 +00:00
|
|
|
dashboardViewModel: getIt.get<DashboardViewModel>(),
|
2023-05-17 14:43:23 +00:00
|
|
|
settingsStore: getIt.get<SettingsStore>()));
|
|
|
|
|
|
|
|
getIt.registerFactory<DashboardPage>(() => DashboardPage(
|
2023-10-03 14:56:10 +00:00
|
|
|
bottomSheetService: getIt.get<BottomSheetService>(),
|
2023-05-17 14:43:23 +00:00
|
|
|
balancePage: getIt.get<BalancePage>(),
|
|
|
|
dashboardViewModel: getIt.get<DashboardViewModel>(),
|
|
|
|
addressListViewModel: getIt.get<WalletAddressListViewModel>(),
|
|
|
|
));
|
2023-04-21 15:21:31 +00:00
|
|
|
|
2023-04-14 04:39:08 +00:00
|
|
|
getIt.registerFactory<DesktopSidebarWrapper>(() {
|
|
|
|
final GlobalKey<NavigatorState> _navigatorKey = GlobalKey<NavigatorState>();
|
|
|
|
return DesktopSidebarWrapper(
|
2023-10-19 16:25:44 +00:00
|
|
|
bottomSheetService: getIt.get<BottomSheetService>(),
|
2023-04-14 04:39:08 +00:00
|
|
|
dashboardViewModel: getIt.get<DashboardViewModel>(),
|
|
|
|
desktopSidebarViewModel: getIt.get<DesktopSidebarViewModel>(),
|
|
|
|
child: getIt.get<DesktopDashboardPage>(param1: _navigatorKey),
|
|
|
|
desktopNavigatorKey: _navigatorKey,
|
|
|
|
);
|
|
|
|
});
|
|
|
|
getIt.registerFactoryParam<DesktopDashboardPage, GlobalKey<NavigatorState>, void>(
|
|
|
|
(desktopKey, _) => DesktopDashboardPage(
|
2023-05-17 14:43:23 +00:00
|
|
|
balancePage: getIt.get<BalancePage>(),
|
|
|
|
dashboardViewModel: getIt.get<DashboardViewModel>(),
|
|
|
|
addressListViewModel: getIt.get<WalletAddressListViewModel>(),
|
|
|
|
desktopKey: desktopKey,
|
|
|
|
));
|
|
|
|
|
|
|
|
getIt.registerFactory<TransactionsPage>(
|
|
|
|
() => TransactionsPage(dashboardViewModel: getIt.get<DashboardViewModel>()));
|
|
|
|
|
2023-12-30 19:55:17 +00:00
|
|
|
getIt.registerFactory<Setup2FAInfoPage>(() => Setup2FAInfoPage());
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory<Setup2FAPage>(
|
|
|
|
() => Setup2FAPage(setup2FAViewModel: getIt.get<Setup2FAViewModel>()));
|
|
|
|
|
|
|
|
getIt.registerFactory<Setup2FAQRPage>(
|
|
|
|
() => Setup2FAQRPage(setup2FAViewModel: getIt.get<Setup2FAViewModel>()));
|
2023-04-14 04:39:08 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory<Modify2FAPage>(
|
|
|
|
() => Modify2FAPage(setup2FAViewModel: getIt.get<Setup2FAViewModel>()));
|
2023-04-14 04:39:08 +00:00
|
|
|
|
2023-11-17 18:35:46 +00:00
|
|
|
getIt.registerFactory<DesktopSettingsPage>(() => DesktopSettingsPage());
|
2023-10-19 16:25:44 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<ReceiveOptionViewModel, ReceivePageOption?, void>(
|
|
|
|
(pageOption, _) => ReceiveOptionViewModel(getIt.get<AppStore>().wallet!, pageOption));
|
2023-03-24 15:26:42 +00:00
|
|
|
|
2023-04-14 04:39:08 +00:00
|
|
|
getIt.registerFactoryParam<AnonInvoicePageViewModel, List<dynamic>, void>((args, _) {
|
2023-03-24 15:26:42 +00:00
|
|
|
final address = args.first as String;
|
|
|
|
final pageOption = args.last as ReceivePageOption;
|
|
|
|
return AnonInvoicePageViewModel(
|
2023-04-14 04:39:08 +00:00
|
|
|
getIt.get<AnonPayApi>(),
|
|
|
|
address,
|
|
|
|
getIt.get<SettingsStore>(),
|
|
|
|
getIt.get<AppStore>().wallet!,
|
|
|
|
_anonpayInvoiceInfoSource,
|
2023-03-24 15:26:42 +00:00
|
|
|
getIt.get<SharedPreferences>(),
|
|
|
|
pageOption,
|
2023-04-14 04:39:08 +00:00
|
|
|
);
|
2023-05-17 14:43:23 +00:00
|
|
|
});
|
2023-03-24 15:26:42 +00:00
|
|
|
|
2023-04-14 04:39:08 +00:00
|
|
|
getIt.registerFactoryParam<AnonPayInvoicePage, List<dynamic>, void>((List<dynamic> args, _) {
|
2023-03-24 15:26:42 +00:00
|
|
|
final pageOption = args.last as ReceivePageOption;
|
2023-05-17 14:43:23 +00:00
|
|
|
return AnonPayInvoicePage(getIt.get<AnonInvoicePageViewModel>(param1: args),
|
|
|
|
getIt.get<ReceiveOptionViewModel>(param1: pageOption));
|
|
|
|
});
|
2023-04-14 04:39:08 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory<ReceivePage>(
|
|
|
|
() => ReceivePage(addressListViewModel: getIt.get<WalletAddressListViewModel>()));
|
2022-03-30 15:57:04 +00:00
|
|
|
getIt.registerFactory<AddressPage>(() => AddressPage(
|
|
|
|
addressListViewModel: getIt.get<WalletAddressListViewModel>(),
|
2023-04-14 04:39:08 +00:00
|
|
|
dashboardViewModel: getIt.get<DashboardViewModel>(),
|
2023-03-24 15:26:42 +00:00
|
|
|
receiveOptionViewModel: getIt.get<ReceiveOptionViewModel>()));
|
2020-06-20 07:10:00 +00:00
|
|
|
|
2023-01-20 19:50:45 +00:00
|
|
|
getIt.registerFactoryParam<WalletAddressEditOrCreateViewModel, WalletAddressListItem?, void>(
|
2023-05-17 14:43:23 +00:00
|
|
|
(WalletAddressListItem? item, _) =>
|
|
|
|
WalletAddressEditOrCreateViewModel(wallet: getIt.get<AppStore>().wallet!, item: item));
|
2020-06-20 07:10:00 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<AddressEditOrCreatePage, dynamic, void>((dynamic item, _) =>
|
|
|
|
AddressEditOrCreatePage(
|
2020-06-20 07:10:00 +00:00
|
|
|
addressEditOrCreateViewModel:
|
2020-07-06 20:09:03 +00:00
|
|
|
getIt.get<WalletAddressEditOrCreateViewModel>(param1: item)));
|
|
|
|
|
2021-07-16 09:32:36 +00:00
|
|
|
getIt.registerFactory<SendTemplateViewModel>(() => SendTemplateViewModel(
|
2022-10-12 17:09:57 +00:00
|
|
|
getIt.get<AppStore>().wallet!,
|
2020-08-25 16:32:40 +00:00
|
|
|
getIt.get<AppStore>().settingsStore,
|
2020-10-07 05:58:22 +00:00
|
|
|
getIt.get<SendTemplateStore>(),
|
2022-01-21 13:02:00 +00:00
|
|
|
getIt.get<FiatConversionStore>()));
|
2021-07-16 09:32:36 +00:00
|
|
|
|
2023-08-04 13:49:26 +00:00
|
|
|
getIt.registerFactory<SendViewModel>(
|
|
|
|
() => SendViewModel(
|
2023-09-01 15:06:18 +00:00
|
|
|
getIt.get<AppStore>(),
|
2021-07-16 09:32:36 +00:00
|
|
|
getIt.get<SendTemplateViewModel>(),
|
2020-11-06 18:54:00 +00:00
|
|
|
getIt.get<FiatConversionStore>(),
|
2022-04-22 15:00:28 +00:00
|
|
|
getIt.get<BalanceViewModel>(),
|
2023-08-04 13:49:26 +00:00
|
|
|
getIt.get<ContactListViewModel>(),
|
|
|
|
_transactionDescriptionBox,
|
|
|
|
),
|
|
|
|
);
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2022-11-08 14:56:27 +00:00
|
|
|
getIt.registerFactoryParam<SendPage, PaymentRequest?, void>(
|
|
|
|
(PaymentRequest? initialPaymentRequest, _) => SendPage(
|
2023-05-17 14:43:23 +00:00
|
|
|
sendViewModel: getIt.get<SendViewModel>(),
|
2023-08-04 13:49:26 +00:00
|
|
|
authService: getIt.get<AuthService>(),
|
2023-05-17 14:43:23 +00:00
|
|
|
initialPaymentRequest: initialPaymentRequest,
|
|
|
|
));
|
2022-12-05 19:14:46 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(
|
|
|
|
() => SendTemplatePage(sendTemplateViewModel: getIt.get<SendTemplateViewModel>()));
|
2020-07-29 16:55:42 +00:00
|
|
|
|
2023-04-14 04:39:08 +00:00
|
|
|
if (DeviceInfo.instance.isMobile) {
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(
|
|
|
|
() => WalletListViewModel(
|
2023-04-14 04:39:08 +00:00
|
|
|
_walletInfoSource,
|
|
|
|
getIt.get<AppStore>(),
|
|
|
|
getIt.get<WalletLoadingService>(),
|
|
|
|
getIt.get<AuthService>(),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
// register wallet list view model as singleton on desktop since it can be accessed
|
|
|
|
// from multiple places at the same time (Wallets DropDown, Wallets List in settings)
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerLazySingleton(
|
|
|
|
() => WalletListViewModel(
|
2023-04-14 04:39:08 +00:00
|
|
|
_walletInfoSource,
|
|
|
|
getIt.get<AppStore>(),
|
|
|
|
getIt.get<WalletLoadingService>(),
|
|
|
|
getIt.get<AuthService>(),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
2020-06-20 07:10:00 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(() => WalletListPage(
|
|
|
|
walletListViewModel: getIt.get<WalletListViewModel>(),
|
|
|
|
authService: getIt.get<AuthService>(),
|
|
|
|
));
|
2020-06-20 07:10:00 +00:00
|
|
|
|
2023-07-12 23:20:11 +00:00
|
|
|
getIt.registerFactoryParam<WalletEditViewModel, WalletListViewModel, void>(
|
2023-08-04 13:49:26 +00:00
|
|
|
(WalletListViewModel walletListViewModel, _) =>
|
|
|
|
WalletEditViewModel(walletListViewModel, getIt.get<WalletLoadingService>()));
|
2023-07-12 23:20:11 +00:00
|
|
|
|
|
|
|
getIt.registerFactoryParam<WalletEditPage, List<dynamic>, void>((args, _) {
|
|
|
|
final walletListViewModel = args.first as WalletListViewModel;
|
|
|
|
final editingWallet = args.last as WalletListItem;
|
|
|
|
return WalletEditPage(
|
|
|
|
walletEditViewModel: getIt.get<WalletEditViewModel>(param1: walletListViewModel),
|
|
|
|
authService: getIt.get<AuthService>(),
|
|
|
|
walletNewVM: getIt.get<WalletNewVM>(param1: editingWallet.type),
|
|
|
|
editingWallet: editingWallet);
|
|
|
|
});
|
|
|
|
|
2023-10-05 01:09:07 +00:00
|
|
|
getIt.registerFactory<NanoAccountListViewModel>(() {
|
2022-10-12 17:09:57 +00:00
|
|
|
final wallet = getIt.get<AppStore>().wallet!;
|
2023-10-05 01:09:07 +00:00
|
|
|
if (wallet.type == WalletType.nano || wallet.type == WalletType.banano) {
|
|
|
|
return NanoAccountListViewModel(wallet);
|
|
|
|
}
|
|
|
|
throw Exception(
|
|
|
|
'Unexpected wallet type: ${wallet.type} for generate Nano/Banano AccountListViewModel');
|
|
|
|
});
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2023-10-05 01:09:07 +00:00
|
|
|
getIt.registerFactory<MoneroAccountListViewModel>(() {
|
|
|
|
final wallet = getIt.get<AppStore>().wallet!;
|
2022-03-30 15:57:04 +00:00
|
|
|
if (wallet.type == WalletType.monero || wallet.type == WalletType.haven) {
|
2020-07-06 20:09:03 +00:00
|
|
|
return MoneroAccountListViewModel(wallet);
|
|
|
|
}
|
2023-05-17 14:43:23 +00:00
|
|
|
throw Exception(
|
2023-10-05 12:18:35 +00:00
|
|
|
'Unexpected wallet type: ${wallet.type} for generate Monero AccountListViewModel');
|
2020-06-20 07:10:00 +00:00
|
|
|
});
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(
|
|
|
|
() => MoneroAccountListPage(accountListViewModel: getIt.get<MoneroAccountListViewModel>()));
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2023-10-05 01:09:07 +00:00
|
|
|
getIt.registerFactory(
|
|
|
|
() => NanoAccountListPage(accountListViewModel: getIt.get<NanoAccountListViewModel>()));
|
|
|
|
|
2020-11-17 18:16:58 +00:00
|
|
|
/*getIt.registerFactory(() {
|
2020-07-06 20:09:03 +00:00
|
|
|
final wallet = getIt.get<AppStore>().wallet;
|
|
|
|
|
|
|
|
if (wallet is MoneroWallet) {
|
|
|
|
return MoneroAccountEditOrCreateViewModel(wallet.accountList);
|
|
|
|
}
|
|
|
|
|
|
|
|
// FIXME: throw exception.
|
|
|
|
return null;
|
|
|
|
});
|
|
|
|
|
|
|
|
getIt.registerFactory(() => MoneroAccountEditOrCreatePage(
|
|
|
|
moneroAccountCreationViewModel:
|
2020-11-17 18:16:58 +00:00
|
|
|
getIt.get<MoneroAccountEditOrCreateViewModel>()));*/
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<MoneroAccountEditOrCreateViewModel, AccountListItem?, void>(
|
2022-10-24 19:25:14 +00:00
|
|
|
(AccountListItem? account, _) => MoneroAccountEditOrCreateViewModel(
|
2022-10-12 17:09:57 +00:00
|
|
|
monero!.getAccountList(getIt.get<AppStore>().wallet!),
|
|
|
|
haven?.getAccountList(getIt.get<AppStore>().wallet!),
|
|
|
|
wallet: getIt.get<AppStore>().wallet!,
|
2021-01-13 16:43:34 +00:00
|
|
|
accountListItem: account));
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<MoneroAccountEditOrCreatePage, AccountListItem?, void>(
|
2022-10-24 19:25:14 +00:00
|
|
|
(AccountListItem? account, _) => MoneroAccountEditOrCreatePage(
|
2020-11-17 18:16:58 +00:00
|
|
|
moneroAccountCreationViewModel:
|
2021-01-13 16:43:34 +00:00
|
|
|
getIt.get<MoneroAccountEditOrCreateViewModel>(param1: account)));
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2023-10-05 01:09:07 +00:00
|
|
|
getIt.registerFactoryParam<NanoAccountEditOrCreateViewModel, NanoAccount?, void>(
|
|
|
|
(NanoAccount? account, _) =>
|
|
|
|
NanoAccountEditOrCreateViewModel(nano!.getAccountList(getIt.get<AppStore>().wallet!),
|
|
|
|
// banano?.getAccountList(getIt.get<AppStore>().wallet!),
|
|
|
|
wallet: getIt.get<AppStore>().wallet!,
|
|
|
|
accountListItem: account));
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<NanoAccountEditOrCreatePage, NanoAccount?, void>(
|
|
|
|
(NanoAccount? account, _) => NanoAccountEditOrCreatePage(
|
|
|
|
nanoAccountCreationViewModel:
|
|
|
|
getIt.get<NanoAccountEditOrCreateViewModel>(param1: account)));
|
|
|
|
|
2020-08-25 16:32:40 +00:00
|
|
|
getIt.registerFactory(() {
|
2022-11-25 20:51:07 +00:00
|
|
|
return DisplaySettingsViewModel(getIt.get<SettingsStore>());
|
2020-08-25 16:32:40 +00:00
|
|
|
});
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2022-11-23 17:06:41 +00:00
|
|
|
getIt.registerFactory(() {
|
2023-08-04 17:01:49 +00:00
|
|
|
return PrivacySettingsViewModel(getIt.get<SettingsStore>(), getIt.get<AppStore>().wallet!);
|
2022-11-23 17:06:41 +00:00
|
|
|
});
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2023-11-16 23:23:34 +00:00
|
|
|
getIt.registerFactory(() => TrocadorProvidersViewModel(getIt.get<SettingsStore>()));
|
|
|
|
|
2022-11-23 17:06:41 +00:00
|
|
|
getIt.registerFactory(() {
|
2022-11-26 00:33:37 +00:00
|
|
|
return OtherSettingsViewModel(getIt.get<SettingsStore>(), getIt.get<AppStore>().wallet!);
|
2022-11-23 17:06:41 +00:00
|
|
|
});
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2022-11-23 17:06:41 +00:00
|
|
|
getIt.registerFactory(() {
|
2022-12-05 19:14:46 +00:00
|
|
|
return SecuritySettingsViewModel(getIt.get<SettingsStore>(), getIt.get<AuthService>());
|
2022-11-23 17:06:41 +00:00
|
|
|
});
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(() => WalletSeedViewModel(getIt.get<AppStore>().wallet!));
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2023-12-09 01:37:39 +00:00
|
|
|
getIt.registerFactory<SeedTypeViewModel>(() => SeedTypeViewModel(getIt.get<AppStore>()));
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<WalletSeedPage, bool, void>((bool isWalletCreated, _) =>
|
|
|
|
WalletSeedPage(getIt.get<WalletSeedViewModel>(), isNewWalletCreated: isWalletCreated));
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(() => WalletKeysViewModel(getIt.get<AppStore>()));
|
2020-07-06 20:09:03 +00:00
|
|
|
|
|
|
|
getIt.registerFactory(() => WalletKeysPage(getIt.get<WalletKeysViewModel>()));
|
|
|
|
|
2022-10-12 17:09:57 +00:00
|
|
|
getIt.registerFactoryParam<ContactViewModel, ContactRecord?, void>(
|
2023-05-17 14:43:23 +00:00
|
|
|
(ContactRecord? contact, _) => ContactViewModel(_contactSource, contact: contact));
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2022-12-05 16:37:35 +00:00
|
|
|
getIt.registerFactoryParam<ContactListViewModel, CryptoCurrency?, void>(
|
2023-08-04 13:49:26 +00:00
|
|
|
(CryptoCurrency? cur, _) =>
|
|
|
|
ContactListViewModel(_contactSource, _walletInfoSource, cur, getIt.get<SettingsStore>()));
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2023-08-04 13:49:26 +00:00
|
|
|
getIt.registerFactoryParam<ContactListPage, CryptoCurrency?, void>((CryptoCurrency? cur, _) =>
|
|
|
|
ContactListPage(getIt.get<ContactListViewModel>(param1: cur), getIt.get<AuthService>()));
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2022-10-12 17:09:57 +00:00
|
|
|
getIt.registerFactoryParam<ContactPage, ContactRecord?, void>(
|
2023-05-17 14:43:23 +00:00
|
|
|
(ContactRecord? contact, _) => ContactPage(getIt.get<ContactViewModel>(param1: contact)));
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2020-08-27 16:54:34 +00:00
|
|
|
getIt.registerFactory(() {
|
|
|
|
final appStore = getIt.get<AppStore>();
|
2023-04-14 04:39:08 +00:00
|
|
|
return NodeListViewModel(_nodeSource, appStore);
|
2020-08-27 16:54:34 +00:00
|
|
|
});
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2023-10-05 01:09:07 +00:00
|
|
|
getIt.registerFactory(() {
|
|
|
|
final appStore = getIt.get<AppStore>();
|
|
|
|
return PowNodeListViewModel(_powNodeSource, appStore);
|
|
|
|
});
|
|
|
|
|
2023-12-13 14:03:07 +00:00
|
|
|
getIt.registerFactory(() => ConnectionSyncPage(getIt.get<DashboardViewModel>()));
|
2022-11-16 07:29:14 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(
|
|
|
|
() => SecurityBackupPage(getIt.get<SecuritySettingsViewModel>(), getIt.get<AuthService>()));
|
2022-11-16 07:29:14 +00:00
|
|
|
|
2022-11-23 17:06:41 +00:00
|
|
|
getIt.registerFactory(() => PrivacyPage(getIt.get<PrivacySettingsViewModel>()));
|
2022-11-16 07:29:14 +00:00
|
|
|
|
2023-11-16 23:23:34 +00:00
|
|
|
getIt.registerFactory(() => TrocadorProvidersPage(getIt.get<TrocadorProvidersViewModel>()));
|
|
|
|
|
2023-11-03 19:23:11 +00:00
|
|
|
getIt.registerFactory(() => DomainLookupsPage(getIt.get<PrivacySettingsViewModel>()));
|
|
|
|
|
2022-11-23 17:06:41 +00:00
|
|
|
getIt.registerFactory(() => DisplaySettingsPage(getIt.get<DisplaySettingsViewModel>()));
|
2022-11-16 07:29:14 +00:00
|
|
|
|
2022-11-23 17:06:41 +00:00
|
|
|
getIt.registerFactory(() => OtherSettingsPage(getIt.get<OtherSettingsViewModel>()));
|
2022-11-16 07:29:14 +00:00
|
|
|
|
2023-11-17 18:35:46 +00:00
|
|
|
getIt.registerFactory(() => NanoChangeRepPage(
|
|
|
|
settingsStore: getIt.get<AppStore>().settingsStore,
|
|
|
|
wallet: getIt.get<AppStore>().wallet!,
|
|
|
|
));
|
2023-10-05 01:09:07 +00:00
|
|
|
|
|
|
|
getIt.registerFactoryParam<NodeCreateOrEditViewModel, WalletType?, bool?>(
|
|
|
|
(WalletType? type, bool? isPow) => NodeCreateOrEditViewModel(
|
|
|
|
(isPow ?? false) ? _powNodeSource : _nodeSource,
|
|
|
|
type ?? getIt.get<AppStore>().wallet!.type,
|
|
|
|
getIt.get<SettingsStore>()));
|
2020-07-06 20:09:03 +00:00
|
|
|
|
2023-03-15 13:24:38 +00:00
|
|
|
getIt.registerFactoryParam<NodeCreateOrEditPage, Node?, bool?>(
|
2023-05-17 14:43:23 +00:00
|
|
|
(Node? editingNode, bool? isSelected) => NodeCreateOrEditPage(
|
2023-10-05 01:09:07 +00:00
|
|
|
nodeCreateOrEditViewModel: getIt.get<NodeCreateOrEditViewModel>(param2: false),
|
|
|
|
editingNode: editingNode,
|
|
|
|
isSelected: isSelected));
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<PowNodeCreateOrEditPage, Node?, bool?>(
|
|
|
|
(Node? editingNode, bool? isSelected) => PowNodeCreateOrEditPage(
|
|
|
|
nodeCreateOrEditViewModel: getIt.get<NodeCreateOrEditViewModel>(param2: true),
|
2023-03-15 13:24:38 +00:00
|
|
|
editingNode: editingNode,
|
|
|
|
isSelected: isSelected));
|
2020-07-31 15:29:21 +00:00
|
|
|
|
2023-09-14 19:14:49 +00:00
|
|
|
getIt.registerFactory<RobinhoodBuyProvider>(
|
|
|
|
() => RobinhoodBuyProvider(wallet: getIt.get<AppStore>().wallet!));
|
|
|
|
|
2023-12-19 13:16:15 +00:00
|
|
|
getIt
|
|
|
|
.registerFactory<DFXBuyProvider>(() => DFXBuyProvider(wallet: getIt.get<AppStore>().wallet!));
|
2023-12-08 14:05:52 +00:00
|
|
|
|
2023-12-28 19:20:59 +00:00
|
|
|
getIt.registerFactory<MoonPaySellProvider>(() => MoonPaySellProvider(
|
|
|
|
settingsStore: getIt.get<AppStore>().settingsStore,
|
|
|
|
wallet: getIt.get<AppStore>().wallet!));
|
2023-12-08 14:05:52 +00:00
|
|
|
|
2023-04-14 04:39:08 +00:00
|
|
|
getIt.registerFactory<OnRamperBuyProvider>(() => OnRamperBuyProvider(
|
2023-12-28 19:20:59 +00:00
|
|
|
getIt.get<AppStore>().settingsStore,
|
2023-05-17 14:43:23 +00:00
|
|
|
wallet: getIt.get<AppStore>().wallet!,
|
|
|
|
));
|
2023-03-31 18:34:39 +00:00
|
|
|
|
2023-06-13 23:15:10 +00:00
|
|
|
getIt.registerFactoryParam<WebViewPage, String, Uri>((title, uri) => WebViewPage(title, uri));
|
2023-04-14 04:39:08 +00:00
|
|
|
|
|
|
|
getIt.registerFactory<PayfuraBuyProvider>(() => PayfuraBuyProvider(
|
2023-05-17 14:43:23 +00:00
|
|
|
settingsStore: getIt.get<AppStore>().settingsStore,
|
|
|
|
wallet: getIt.get<AppStore>().wallet!,
|
|
|
|
));
|
2023-04-14 04:39:08 +00:00
|
|
|
|
2020-09-01 11:18:07 +00:00
|
|
|
getIt.registerFactory(() => ExchangeViewModel(
|
2023-09-01 15:06:18 +00:00
|
|
|
getIt.get<AppStore>(),
|
2023-08-04 13:49:26 +00:00
|
|
|
_tradesSource,
|
|
|
|
getIt.get<ExchangeTemplateStore>(),
|
|
|
|
getIt.get<TradesStore>(),
|
|
|
|
getIt.get<AppStore>().settingsStore,
|
|
|
|
getIt.get<SharedPreferences>(),
|
|
|
|
getIt.get<ContactListViewModel>()));
|
2020-08-26 17:31:23 +00:00
|
|
|
|
2020-09-01 11:18:07 +00:00
|
|
|
getIt.registerFactory(() => ExchangeTradeViewModel(
|
2022-10-12 17:09:57 +00:00
|
|
|
wallet: getIt.get<AppStore>().wallet!,
|
2021-01-15 17:41:30 +00:00
|
|
|
trades: _tradesSource,
|
2020-10-30 16:32:21 +00:00
|
|
|
tradesStore: getIt.get<TradesStore>(),
|
|
|
|
sendViewModel: getIt.get<SendViewModel>()));
|
2020-07-31 15:29:21 +00:00
|
|
|
|
2023-08-04 13:49:26 +00:00
|
|
|
getIt.registerFactory(
|
|
|
|
() => ExchangePage(getIt.get<ExchangeViewModel>(), getIt.get<AuthService>()));
|
2020-07-31 15:29:21 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(() => ExchangeConfirmPage(tradesStore: getIt.get<TradesStore>()));
|
2020-09-15 20:35:49 +00:00
|
|
|
|
2022-12-05 19:14:46 +00:00
|
|
|
getIt.registerFactory(
|
2023-05-17 14:43:23 +00:00
|
|
|
() => ExchangeTradePage(exchangeTradeViewModel: getIt.get<ExchangeTradeViewModel>()));
|
|
|
|
|
|
|
|
getIt.registerFactory(() => ExchangeTemplatePage(getIt.get<ExchangeViewModel>()));
|
2022-12-05 19:14:46 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<WalletService, WalletType, void>((WalletType param1, __) {
|
2020-09-15 20:35:49 +00:00
|
|
|
switch (param1) {
|
2022-03-30 15:57:04 +00:00
|
|
|
case WalletType.haven:
|
2022-10-12 17:09:57 +00:00
|
|
|
return haven!.createHavenWalletService(_walletInfoSource);
|
2020-09-15 20:35:49 +00:00
|
|
|
case WalletType.monero:
|
2023-08-24 13:54:05 +00:00
|
|
|
return monero!.createMoneroWalletService(_walletInfoSource, _unspentCoinsInfoSource);
|
2020-09-15 20:35:49 +00:00
|
|
|
case WalletType.bitcoin:
|
2023-08-24 13:54:05 +00:00
|
|
|
return bitcoin!.createBitcoinWalletService(_walletInfoSource, _unspentCoinsInfoSource);
|
2021-05-07 07:36:38 +00:00
|
|
|
case WalletType.litecoin:
|
2023-08-24 13:54:05 +00:00
|
|
|
return bitcoin!.createLitecoinWalletService(_walletInfoSource, _unspentCoinsInfoSource);
|
2023-08-04 17:01:49 +00:00
|
|
|
case WalletType.ethereum:
|
|
|
|
return ethereum!.createEthereumWalletService(_walletInfoSource);
|
2023-10-12 22:50:16 +00:00
|
|
|
case WalletType.bitcoinCash:
|
2023-11-17 18:35:46 +00:00
|
|
|
return bitcoinCash!
|
2023-12-09 01:37:39 +00:00
|
|
|
.createBitcoinCashWalletService(_walletInfoSource, _unspentCoinsInfoSource);
|
2023-10-05 01:09:07 +00:00
|
|
|
case WalletType.nano:
|
|
|
|
return nano!.createNanoWalletService(_walletInfoSource);
|
2023-12-02 02:26:43 +00:00
|
|
|
case WalletType.polygon:
|
|
|
|
return polygon!.createPolygonWalletService(_walletInfoSource);
|
2020-09-15 20:35:49 +00:00
|
|
|
default:
|
2022-10-12 17:09:57 +00:00
|
|
|
throw Exception('Unexpected token: ${param1.toString()} for generating of WalletService');
|
2020-09-15 20:35:49 +00:00
|
|
|
}
|
|
|
|
});
|
2020-09-21 11:50:26 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory<SetupPinCodeViewModel>(
|
|
|
|
() => SetupPinCodeViewModel(getIt.get<AuthService>(), getIt.get<SettingsStore>()));
|
2020-09-21 11:50:26 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<SetupPinCodePage, void Function(PinCodeState<PinCodeWidget>, String),
|
|
|
|
void>(
|
|
|
|
(onSuccessfulPinSetup, _) => SetupPinCodePage(getIt.get<SetupPinCodeViewModel>(),
|
2020-09-21 11:50:26 +00:00
|
|
|
onSuccessfulPinSetup: onSuccessfulPinSetup));
|
|
|
|
|
2022-10-12 17:09:57 +00:00
|
|
|
getIt.registerFactory(() => RescanViewModel(getIt.get<AppStore>().wallet!));
|
2020-09-21 11:50:26 +00:00
|
|
|
|
|
|
|
getIt.registerFactory(() => RescanPage(getIt.get<RescanViewModel>()));
|
2020-08-20 17:43:54 +00:00
|
|
|
|
2020-09-28 15:47:43 +00:00
|
|
|
getIt.registerFactory(() => FaqPage(getIt.get<SettingsStore>()));
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<WalletRestoreViewModel, WalletType, void>((type, _) =>
|
|
|
|
WalletRestoreViewModel(
|
|
|
|
getIt.get<AppStore>(), getIt.get<WalletCreationService>(param1: type), _walletInfoSource,
|
2020-10-13 21:11:04 +00:00
|
|
|
type: type));
|
|
|
|
|
2023-12-09 01:37:39 +00:00
|
|
|
getIt.registerFactoryParam<WalletRestorePage, WalletType, void>((type, _) => WalletRestorePage(
|
|
|
|
getIt.get<WalletRestoreViewModel>(param1: type), getIt.get<SeedTypeViewModel>()));
|
2020-11-06 18:54:00 +00:00
|
|
|
|
2023-10-05 01:09:07 +00:00
|
|
|
getIt.registerFactoryParam<WalletRestoreChooseDerivationViewModel, List<DerivationInfo>, void>(
|
|
|
|
(derivations, _) => WalletRestoreChooseDerivationViewModel(derivationInfos: derivations));
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<WalletRestoreChooseDerivationPage, List<DerivationInfo>, void>(
|
|
|
|
(credentials, _) =>
|
|
|
|
WalletRestoreChooseDerivationPage(getIt.get<WalletRestoreChooseDerivationViewModel>(
|
|
|
|
param1: credentials,
|
|
|
|
)));
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<TransactionDetailsViewModel, TransactionInfo, void>(
|
|
|
|
(TransactionInfo transactionInfo, _) {
|
2022-10-12 17:09:57 +00:00
|
|
|
final wallet = getIt.get<AppStore>().wallet!;
|
2022-01-21 13:02:00 +00:00
|
|
|
return TransactionDetailsViewModel(
|
|
|
|
transactionInfo: transactionInfo,
|
|
|
|
transactionDescriptionBox: _transactionDescriptionBox,
|
|
|
|
wallet: wallet,
|
|
|
|
settingsStore: getIt.get<SettingsStore>());
|
|
|
|
});
|
2020-12-22 18:42:30 +00:00
|
|
|
|
2020-11-06 18:54:00 +00:00
|
|
|
getIt.registerFactoryParam<TransactionDetailsPage, TransactionInfo, void>(
|
|
|
|
(TransactionInfo transactionInfo, _) => TransactionDetailsPage(
|
2021-01-08 18:10:37 +00:00
|
|
|
transactionDetailsViewModel:
|
|
|
|
getIt.get<TransactionDetailsViewModel>(param1: transactionInfo)));
|
2020-11-27 11:08:17 +00:00
|
|
|
|
2023-08-04 17:01:49 +00:00
|
|
|
getIt.registerFactoryParam<NewWalletTypePage, void Function(BuildContext, WalletType), bool?>(
|
|
|
|
(param1, isCreate) => NewWalletTypePage(onTypeSelected: param1, isCreate: isCreate ?? true));
|
2020-12-11 18:10:06 +00:00
|
|
|
|
2023-12-30 19:55:17 +00:00
|
|
|
getIt.registerFactoryParam<PreSeedPage, int, void>(
|
2023-11-22 21:37:05 +00:00
|
|
|
(seedPhraseLength, _)
|
2023-12-30 19:55:17 +00:00
|
|
|
=> PreSeedPage(seedPhraseLength));
|
2020-12-18 12:42:53 +00:00
|
|
|
|
|
|
|
getIt.registerFactoryParam<TradeDetailsViewModel, Trade, void>((trade, _) =>
|
2023-05-17 14:43:23 +00:00
|
|
|
TradeDetailsViewModel(
|
|
|
|
tradeForDetails: trade,
|
|
|
|
trades: _tradesSource,
|
2022-09-02 13:10:54 +00:00
|
|
|
settingsStore: getIt.get<SettingsStore>()));
|
2021-01-13 16:43:34 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(() => BackupService(getIt.get<FlutterSecureStorage>(), _walletInfoSource,
|
|
|
|
getIt.get<KeyService>(), getIt.get<SharedPreferences>()));
|
2021-01-13 16:43:34 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(() => BackupViewModel(
|
|
|
|
getIt.get<FlutterSecureStorage>(), getIt.get<SecretStore>(), getIt.get<BackupService>()));
|
2021-01-13 16:43:34 +00:00
|
|
|
|
|
|
|
getIt.registerFactory(() => BackupPage(getIt.get<BackupViewModel>()));
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(() =>
|
|
|
|
EditBackupPasswordViewModel(getIt.get<FlutterSecureStorage>(), getIt.get<SecretStore>()));
|
2021-01-13 16:43:34 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(() => EditBackupPasswordPage(getIt.get<EditBackupPasswordViewModel>()));
|
2023-04-21 18:36:47 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<RestoreOptionsPage, bool, void>(
|
|
|
|
(bool isNewInstall, _) => RestoreOptionsPage(isNewInstall: isNewInstall));
|
2021-01-13 16:43:34 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(() => RestoreFromBackupViewModel(getIt.get<BackupService>()));
|
2021-01-13 16:43:34 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(() => RestoreFromBackupPage(getIt.get<RestoreFromBackupViewModel>()));
|
2021-01-13 17:18:28 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<TradeDetailsPage, Trade, void>(
|
|
|
|
(Trade trade, _) => TradeDetailsPage(getIt.get<TradeDetailsViewModel>(param1: trade)));
|
2021-01-15 17:41:30 +00:00
|
|
|
|
2021-04-12 18:22:22 +00:00
|
|
|
getIt.registerFactory(() => BuyAmountViewModel());
|
|
|
|
|
2023-12-28 19:20:59 +00:00
|
|
|
getIt.registerFactoryParam<BuySellOptionsPage, bool, void>(
|
|
|
|
(isBuyOption, _) => BuySellOptionsPage(getIt.get<DashboardViewModel>(), isBuyOption));
|
2023-09-14 19:14:49 +00:00
|
|
|
|
2021-04-12 18:22:22 +00:00
|
|
|
getIt.registerFactory(() {
|
|
|
|
final wallet = getIt.get<AppStore>().wallet;
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
return BuyViewModel(_ordersSource, getIt.get<OrdersStore>(), getIt.get<SettingsStore>(),
|
|
|
|
getIt.get<BuyAmountViewModel>(),
|
2022-10-12 17:09:57 +00:00
|
|
|
wallet: wallet!);
|
2021-04-12 18:22:22 +00:00
|
|
|
});
|
|
|
|
|
2023-10-05 12:18:35 +00:00
|
|
|
getIt.registerFactoryParam<BuyWebViewPage, List<dynamic>, void>((List<dynamic> args, _) {
|
2022-01-21 13:02:00 +00:00
|
|
|
final url = args.first as String;
|
|
|
|
final buyViewModel = args[1] as BuyViewModel;
|
2021-04-15 17:10:23 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
return BuyWebViewPage(
|
|
|
|
buyViewModel: buyViewModel, ordersStore: getIt.get<OrdersStore>(), url: url);
|
2022-01-21 13:02:00 +00:00
|
|
|
});
|
2021-04-13 18:40:44 +00:00
|
|
|
|
2022-01-21 13:02:00 +00:00
|
|
|
getIt.registerFactoryParam<OrderDetailsViewModel, Order, void>((order, _) {
|
|
|
|
final wallet = getIt.get<AppStore>().wallet;
|
2021-04-13 18:40:44 +00:00
|
|
|
|
2022-10-12 17:09:57 +00:00
|
|
|
return OrderDetailsViewModel(wallet: wallet!, orderForDetails: order);
|
2022-01-21 13:02:00 +00:00
|
|
|
});
|
2021-03-23 17:19:01 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<OrderDetailsPage, Order, void>(
|
|
|
|
(Order order, _) => OrderDetailsPage(getIt.get<OrderDetailsViewModel>(param1: order)));
|
2021-03-23 17:19:01 +00:00
|
|
|
|
2021-02-25 18:25:52 +00:00
|
|
|
getIt.registerFactory(() => SupportViewModel());
|
|
|
|
|
|
|
|
getIt.registerFactory(() => SupportPage(getIt.get<SupportViewModel>()));
|
|
|
|
|
2023-10-03 14:56:10 +00:00
|
|
|
getIt.registerFactory(() => SupportChatPage(getIt.get<SupportViewModel>(),
|
|
|
|
secureStorage: getIt.get<FlutterSecureStorage>()));
|
2023-08-15 00:47:25 +00:00
|
|
|
|
|
|
|
getIt.registerFactory(() => SupportOtherLinksPage(getIt.get<SupportViewModel>()));
|
|
|
|
|
2021-07-05 13:52:24 +00:00
|
|
|
getIt.registerFactory(() {
|
|
|
|
final wallet = getIt.get<AppStore>().wallet;
|
|
|
|
|
2023-10-05 12:18:35 +00:00
|
|
|
return UnspentCoinsListViewModel(wallet: wallet!, unspentCoinsInfo: _unspentCoinsInfoSource);
|
2021-07-05 13:52:24 +00:00
|
|
|
});
|
2021-05-25 17:32:36 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(() =>
|
|
|
|
UnspentCoinsListPage(unspentCoinsListViewModel: getIt.get<UnspentCoinsListViewModel>()));
|
2021-05-25 17:32:36 +00:00
|
|
|
|
2022-01-21 13:02:00 +00:00
|
|
|
getIt.registerFactoryParam<UnspentCoinsDetailsViewModel, UnspentCoinsItem,
|
|
|
|
UnspentCoinsListViewModel>(
|
2023-05-17 14:43:23 +00:00
|
|
|
(item, model) =>
|
|
|
|
UnspentCoinsDetailsViewModel(unspentCoinsItem: item, unspentCoinsListViewModel: model));
|
2021-07-05 13:52:24 +00:00
|
|
|
|
2023-10-05 12:18:35 +00:00
|
|
|
getIt.registerFactoryParam<UnspentCoinsDetailsPage, List<dynamic>, void>((List<dynamic> args, _) {
|
2022-01-21 13:02:00 +00:00
|
|
|
final item = args.first as UnspentCoinsItem;
|
|
|
|
final unspentCoinsListViewModel = args[1] as UnspentCoinsListViewModel;
|
|
|
|
|
|
|
|
return UnspentCoinsDetailsPage(
|
|
|
|
unspentCoinsDetailsViewModel: getIt.get<UnspentCoinsDetailsViewModel>(
|
|
|
|
param1: item, param2: unspentCoinsListViewModel));
|
2021-07-05 13:52:24 +00:00
|
|
|
});
|
2021-05-27 17:57:51 +00:00
|
|
|
|
2022-03-15 09:11:53 +00:00
|
|
|
getIt.registerFactory(() => YatService());
|
|
|
|
|
2023-11-22 17:43:26 +00:00
|
|
|
getIt.registerFactory(() => AddressResolver(
|
|
|
|
yatService: getIt.get<YatService>(),
|
|
|
|
wallet: getIt.get<AppStore>().wallet!,
|
|
|
|
settingsStore: getIt.get<SettingsStore>()));
|
2022-06-23 09:25:00 +00:00
|
|
|
|
2023-04-21 18:03:42 +00:00
|
|
|
getIt.registerFactoryParam<FullscreenQRPage, QrViewData, void>(
|
2023-05-17 14:43:23 +00:00
|
|
|
(QrViewData viewData, _) => FullscreenQRPage(qrViewData: viewData));
|
2022-10-05 17:28:11 +00:00
|
|
|
|
2022-07-28 17:03:16 +00:00
|
|
|
getIt.registerFactory(() => IoniaApi());
|
|
|
|
|
|
|
|
getIt.registerFactory(() => AnyPayApi());
|
|
|
|
|
|
|
|
getIt.registerFactory<IoniaService>(
|
|
|
|
() => IoniaService(getIt.get<FlutterSecureStorage>(), getIt.get<IoniaApi>()));
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory<IoniaAnyPay>(() => IoniaAnyPay(
|
|
|
|
getIt.get<IoniaService>(), getIt.get<AnyPayApi>(), getIt.get<AppStore>().wallet!));
|
2022-07-28 17:03:16 +00:00
|
|
|
|
|
|
|
getIt.registerFactory(() => IoniaGiftCardsListViewModel(ioniaService: getIt.get<IoniaService>()));
|
|
|
|
|
2023-08-04 13:49:26 +00:00
|
|
|
getIt.registerFactory(() => MarketPlaceViewModel(getIt.get<IoniaService>()));
|
2023-06-07 23:16:52 +00:00
|
|
|
|
2022-07-28 17:03:16 +00:00
|
|
|
getIt.registerFactory(() => IoniaAuthViewModel(ioniaService: getIt.get<IoniaService>()));
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<IoniaMerchPurchaseViewModel, double, IoniaMerchant>(
|
|
|
|
(double amount, merchant) {
|
2022-07-28 17:03:16 +00:00
|
|
|
return IoniaMerchPurchaseViewModel(
|
2023-05-17 14:43:23 +00:00
|
|
|
ioniaAnyPayService: getIt.get<IoniaAnyPay>(),
|
|
|
|
amount: amount,
|
|
|
|
ioniaMerchant: merchant,
|
|
|
|
sendViewModel: getIt.get<SendViewModel>());
|
2022-07-28 17:03:16 +00:00
|
|
|
});
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<IoniaBuyCardViewModel, IoniaMerchant, void>(
|
|
|
|
(IoniaMerchant merchant, _) {
|
2022-07-28 17:03:16 +00:00
|
|
|
return IoniaBuyCardViewModel(ioniaMerchant: merchant);
|
|
|
|
});
|
|
|
|
|
|
|
|
getIt.registerFactory(() => IoniaAccountViewModel(ioniaService: getIt.get<IoniaService>()));
|
|
|
|
|
|
|
|
getIt.registerFactory(() => IoniaCreateAccountPage(getIt.get<IoniaAuthViewModel>()));
|
|
|
|
|
|
|
|
getIt.registerFactory(() => IoniaLoginPage(getIt.get<IoniaAuthViewModel>()));
|
|
|
|
|
2023-10-05 12:18:35 +00:00
|
|
|
getIt.registerFactoryParam<IoniaVerifyIoniaOtp, List<dynamic>, void>((List<dynamic> args, _) {
|
2022-07-28 17:03:16 +00:00
|
|
|
final email = args.first as String;
|
|
|
|
final isSignIn = args[1] as bool;
|
|
|
|
|
|
|
|
return IoniaVerifyIoniaOtp(getIt.get<IoniaAuthViewModel>(), email, isSignIn);
|
|
|
|
});
|
|
|
|
|
2023-06-07 23:16:52 +00:00
|
|
|
getIt.registerFactory(() => IoniaWelcomePage());
|
2022-07-28 17:03:16 +00:00
|
|
|
|
2023-10-05 12:18:35 +00:00
|
|
|
getIt.registerFactoryParam<IoniaBuyGiftCardPage, List<dynamic>, void>((List<dynamic> args, _) {
|
2022-07-28 17:03:16 +00:00
|
|
|
final merchant = args.first as IoniaMerchant;
|
|
|
|
|
|
|
|
return IoniaBuyGiftCardPage(getIt.get<IoniaBuyCardViewModel>(param1: merchant));
|
|
|
|
});
|
|
|
|
|
2023-10-05 12:18:35 +00:00
|
|
|
getIt.registerFactoryParam<IoniaBuyGiftCardDetailPage, List<dynamic>, void>(
|
|
|
|
(List<dynamic> args, _) {
|
2022-07-28 17:03:16 +00:00
|
|
|
final amount = args.first as double;
|
|
|
|
final merchant = args.last as IoniaMerchant;
|
2023-05-17 14:43:23 +00:00
|
|
|
return IoniaBuyGiftCardDetailPage(
|
|
|
|
getIt.get<IoniaMerchPurchaseViewModel>(param1: amount, param2: merchant));
|
2022-07-28 17:03:16 +00:00
|
|
|
});
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<IoniaGiftCardDetailsViewModel, IoniaGiftCard, void>(
|
|
|
|
(IoniaGiftCard giftCard, _) {
|
|
|
|
return IoniaGiftCardDetailsViewModel(
|
|
|
|
ioniaService: getIt.get<IoniaService>(), giftCard: giftCard);
|
2022-07-28 17:03:16 +00:00
|
|
|
});
|
2022-10-05 17:28:11 +00:00
|
|
|
|
2023-10-05 12:18:35 +00:00
|
|
|
getIt.registerFactoryParam<IoniaCustomTipViewModel, List<dynamic>, void>((List<dynamic> args, _) {
|
2023-05-17 14:43:23 +00:00
|
|
|
final amount = args[0] as double;
|
|
|
|
final merchant = args[1] as IoniaMerchant;
|
|
|
|
final tip = args[2] as IoniaTip;
|
2022-10-05 17:28:11 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
return IoniaCustomTipViewModel(amount: amount, tip: tip, ioniaMerchant: merchant);
|
2022-09-01 16:29:58 +00:00
|
|
|
});
|
2022-10-05 17:28:11 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<IoniaGiftCardDetailPage, IoniaGiftCard, void>(
|
|
|
|
(IoniaGiftCard giftCard, _) {
|
|
|
|
return IoniaGiftCardDetailPage(getIt.get<IoniaGiftCardDetailsViewModel>(param1: giftCard));
|
2022-07-28 17:03:16 +00:00
|
|
|
});
|
|
|
|
|
2023-10-05 12:18:35 +00:00
|
|
|
getIt.registerFactoryParam<IoniaMoreOptionsPage, List<dynamic>, void>((List<dynamic> args, _) {
|
2022-09-02 13:47:45 +00:00
|
|
|
final giftCard = args.first as IoniaGiftCard;
|
2022-10-05 17:28:11 +00:00
|
|
|
|
|
|
|
return IoniaMoreOptionsPage(giftCard);
|
2022-09-02 13:47:45 +00:00
|
|
|
});
|
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<IoniaCustomRedeemViewModel, IoniaGiftCard, void>(
|
|
|
|
(IoniaGiftCard giftCard, _) =>
|
|
|
|
IoniaCustomRedeemViewModel(giftCard: giftCard, ioniaService: getIt.get<IoniaService>()));
|
2022-09-02 13:47:45 +00:00
|
|
|
|
2023-10-05 12:18:35 +00:00
|
|
|
getIt.registerFactoryParam<IoniaCustomRedeemPage, List<dynamic>, void>((List<dynamic> args, _) {
|
2022-09-02 13:47:45 +00:00
|
|
|
final giftCard = args.first as IoniaGiftCard;
|
2022-10-05 17:28:11 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
return IoniaCustomRedeemPage(getIt.get<IoniaCustomRedeemViewModel>(param1: giftCard));
|
2022-12-05 12:33:17 +00:00
|
|
|
});
|
2022-09-02 13:47:45 +00:00
|
|
|
|
2023-10-05 12:18:35 +00:00
|
|
|
getIt.registerFactoryParam<IoniaCustomTipPage, List<dynamic>, void>((List<dynamic> args, _) {
|
2022-09-01 16:29:58 +00:00
|
|
|
return IoniaCustomTipPage(getIt.get<IoniaCustomTipViewModel>(param1: args));
|
2022-07-28 17:03:16 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
getIt.registerFactory(() => IoniaManageCardsPage(getIt.get<IoniaGiftCardsListViewModel>()));
|
|
|
|
|
|
|
|
getIt.registerFactory(() => IoniaDebitCardPage(getIt.get<IoniaGiftCardsListViewModel>()));
|
|
|
|
|
|
|
|
getIt.registerFactory(() => IoniaActivateDebitCardPage(getIt.get<IoniaGiftCardsListViewModel>()));
|
|
|
|
|
|
|
|
getIt.registerFactory(() => IoniaAccountPage(getIt.get<IoniaAccountViewModel>()));
|
|
|
|
|
|
|
|
getIt.registerFactory(() => IoniaAccountCardsPage(getIt.get<IoniaAccountViewModel>()));
|
2023-04-14 04:39:08 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(() => AnonPayApi(
|
|
|
|
useTorOnly: getIt.get<SettingsStore>().exchangeStatus == ExchangeApiMode.torOnly,
|
|
|
|
wallet: getIt.get<AppStore>().wallet!));
|
2023-03-24 15:26:42 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactory(() =>
|
|
|
|
DesktopWalletSelectionDropDown(getIt.get<WalletListViewModel>(), getIt.get<AuthService>()));
|
2023-04-14 04:39:08 +00:00
|
|
|
|
|
|
|
getIt.registerFactory(() => DesktopSidebarViewModel());
|
|
|
|
|
2023-03-24 15:26:42 +00:00
|
|
|
getIt.registerFactoryParam<AnonpayDetailsViewModel, AnonpayInvoiceInfo, void>(
|
2023-05-17 14:43:23 +00:00
|
|
|
(AnonpayInvoiceInfo anonpayInvoiceInfo, _) => AnonpayDetailsViewModel(
|
|
|
|
anonPayApi: getIt.get<AnonPayApi>(),
|
|
|
|
anonpayInvoiceInfo: anonpayInvoiceInfo,
|
|
|
|
settingsStore: getIt.get<SettingsStore>(),
|
|
|
|
));
|
2023-03-24 15:26:42 +00:00
|
|
|
|
|
|
|
getIt.registerFactoryParam<AnonPayReceivePage, AnonpayInfoBase, void>(
|
2023-05-17 14:43:23 +00:00
|
|
|
(AnonpayInfoBase anonpayInvoiceInfo, _) =>
|
|
|
|
AnonPayReceivePage(invoiceInfo: anonpayInvoiceInfo));
|
2023-03-24 15:26:42 +00:00
|
|
|
|
|
|
|
getIt.registerFactoryParam<AnonpayDetailsPage, AnonpayInvoiceInfo, void>(
|
2023-05-17 14:43:23 +00:00
|
|
|
(AnonpayInvoiceInfo anonpayInvoiceInfo, _) => AnonpayDetailsPage(
|
|
|
|
anonpayDetailsViewModel: getIt.get<AnonpayDetailsViewModel>(param1: anonpayInvoiceInfo)));
|
2022-07-28 17:03:16 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<IoniaPaymentStatusViewModel, IoniaAnyPayPaymentInfo,
|
|
|
|
AnyPayPaymentCommittedInfo>(
|
|
|
|
(IoniaAnyPayPaymentInfo paymentInfo, AnyPayPaymentCommittedInfo committedInfo) =>
|
|
|
|
IoniaPaymentStatusViewModel(getIt.get<IoniaService>(),
|
|
|
|
paymentInfo: paymentInfo, committedInfo: committedInfo));
|
2022-12-05 12:33:17 +00:00
|
|
|
|
2023-05-17 14:43:23 +00:00
|
|
|
getIt.registerFactoryParam<IoniaPaymentStatusPage, IoniaAnyPayPaymentInfo,
|
|
|
|
AnyPayPaymentCommittedInfo>(
|
|
|
|
(IoniaAnyPayPaymentInfo paymentInfo, AnyPayPaymentCommittedInfo committedInfo) =>
|
|
|
|
IoniaPaymentStatusPage(
|
|
|
|
getIt.get<IoniaPaymentStatusViewModel>(param1: paymentInfo, param2: committedInfo)));
|
2022-06-23 09:25:00 +00:00
|
|
|
|
2023-08-04 17:01:49 +00:00
|
|
|
getIt.registerFactoryParam<HomeSettingsPage, BalanceViewModel, void>((balanceViewModel, _) =>
|
|
|
|
HomeSettingsPage(getIt.get<HomeSettingsViewModel>(param1: balanceViewModel)));
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<HomeSettingsViewModel, BalanceViewModel, void>(
|
|
|
|
(balanceViewModel, _) => HomeSettingsViewModel(getIt.get<SettingsStore>(), balanceViewModel));
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<EditTokenPage, HomeSettingsViewModel, Map<String, dynamic>>(
|
|
|
|
(homeSettingsViewModel, arguments) => EditTokenPage(
|
|
|
|
homeSettingsViewModel: homeSettingsViewModel,
|
|
|
|
erc20token: arguments['token'] as Erc20Token?,
|
|
|
|
initialContractAddress: arguments['contractAddress'] as String?,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
2023-10-05 01:09:07 +00:00
|
|
|
getIt.registerFactoryParam<ManageNodesPage, bool, void>((bool isPow, _) {
|
|
|
|
if (isPow) {
|
|
|
|
return ManageNodesPage(isPow, powNodeListViewModel: getIt.get<PowNodeListViewModel>());
|
|
|
|
}
|
|
|
|
return ManageNodesPage(isPow, nodeListViewModel: getIt.get<NodeListViewModel>());
|
|
|
|
});
|
2023-08-04 17:55:56 +00:00
|
|
|
|
2023-11-02 14:41:11 +00:00
|
|
|
getIt.registerFactory(
|
|
|
|
() => WalletConnectConnectionsView(web3walletService: getIt.get<Web3WalletService>()));
|
|
|
|
|
2023-11-22 17:43:26 +00:00
|
|
|
getIt.registerFactory(() => NFTViewModel(appStore, getIt.get<BottomSheetService>()));
|
2023-11-18 13:43:15 +00:00
|
|
|
getIt.registerFactory<TorPage>(() => TorPage(getIt.get<AppStore>()));
|
2023-11-02 14:41:11 +00:00
|
|
|
|
2021-01-15 17:41:30 +00:00
|
|
|
_isSetupFinished = true;
|
2023-05-17 14:43:23 +00:00
|
|
|
}
|