|
|
|
@ -31,6 +31,10 @@ import 'package:cake_wallet/src/screens/dashboard/widgets/balance_page.dart';
|
|
|
|
|
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';
|
|
|
|
|
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';
|
|
|
|
|
import 'package:cw_core/unspent_coins_info.dart';
|
|
|
|
|
import 'package:cake_wallet/core/backup_service.dart';
|
|
|
|
|
import 'package:cw_core/wallet_service.dart';
|
|
|
|
@ -54,7 +58,6 @@ import 'package:cake_wallet/src/screens/exchange_trade/exchange_trade_page.dart'
|
|
|
|
|
import 'package:cake_wallet/src/screens/faq/faq_page.dart';
|
|
|
|
|
import 'package:cake_wallet/src/screens/new_wallet/new_wallet_type_page.dart';
|
|
|
|
|
import 'package:cake_wallet/src/screens/nodes/node_create_or_edit_page.dart';
|
|
|
|
|
import 'package:cake_wallet/src/screens/nodes/nodes_list_page.dart';
|
|
|
|
|
import 'package:cake_wallet/src/screens/order_details/order_details_page.dart';
|
|
|
|
|
import 'package:cake_wallet/src/screens/pin_code/pin_code_widget.dart';
|
|
|
|
|
import 'package:cake_wallet/src/screens/rescan/rescan_page.dart';
|
|
|
|
@ -119,7 +122,6 @@ import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_v
|
|
|
|
|
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';
|
|
|
|
|
import 'package:cake_wallet/view_model/send/send_view_model.dart';
|
|
|
|
|
import 'package:cake_wallet/view_model/settings/settings_view_model.dart';
|
|
|
|
|
import 'package:cake_wallet/view_model/wallet_keys_view_model.dart';
|
|
|
|
|
import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart';
|
|
|
|
|
import 'package:cake_wallet/view_model/wallet_restore_view_model.dart';
|
|
|
|
@ -192,8 +194,7 @@ Future setup(
|
|
|
|
|
_unspentCoinsInfoSource = unspentCoinsInfoSource;
|
|
|
|
|
|
|
|
|
|
if (!_isSetupFinished) {
|
|
|
|
|
getIt.registerSingletonAsync<SharedPreferences>(
|
|
|
|
|
() => SharedPreferences.getInstance());
|
|
|
|
|
getIt.registerSingletonAsync<SharedPreferences>(() => SharedPreferences.getInstance());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final isBitcoinBuyEnabled = (secrets.wyreSecretKey?.isNotEmpty ?? false) &&
|
|
|
|
@ -219,73 +220,64 @@ Future setup(
|
|
|
|
|
walletList: getIt.get<WalletListStore>(),
|
|
|
|
|
settingsStore: getIt.get<SettingsStore>(),
|
|
|
|
|
nodeListStore: getIt.get<NodeListStore>()));
|
|
|
|
|
getIt.registerSingleton<TradesStore>(TradesStore(
|
|
|
|
|
tradesSource: _tradesSource, settingsStore: getIt.get<SettingsStore>()));
|
|
|
|
|
getIt.registerSingleton<OrdersStore>(OrdersStore(
|
|
|
|
|
ordersSource: _ordersSource, settingsStore: getIt.get<SettingsStore>()));
|
|
|
|
|
getIt.registerSingleton<TradesStore>(
|
|
|
|
|
TradesStore(tradesSource: _tradesSource, settingsStore: getIt.get<SettingsStore>()));
|
|
|
|
|
getIt.registerSingleton<OrdersStore>(
|
|
|
|
|
OrdersStore(ordersSource: _ordersSource, settingsStore: getIt.get<SettingsStore>()));
|
|
|
|
|
getIt.registerSingleton<TradeFilterStore>(TradeFilterStore());
|
|
|
|
|
getIt.registerSingleton<TransactionFilterStore>(TransactionFilterStore());
|
|
|
|
|
getIt.registerSingleton<FiatConversionStore>(FiatConversionStore());
|
|
|
|
|
getIt.registerSingleton<SendTemplateStore>(
|
|
|
|
|
SendTemplateStore(templateSource: _templates));
|
|
|
|
|
getIt.registerSingleton<SendTemplateStore>(SendTemplateStore(templateSource: _templates));
|
|
|
|
|
getIt.registerSingleton<ExchangeTemplateStore>(
|
|
|
|
|
ExchangeTemplateStore(templateSource: _exchangeTemplates));
|
|
|
|
|
getIt.registerSingleton<YatStore>(YatStore(
|
|
|
|
|
appStore: getIt.get<AppStore>(),
|
|
|
|
|
secureStorage: getIt.get<FlutterSecureStorage>())
|
|
|
|
|
..init());
|
|
|
|
|
getIt.registerSingleton<YatStore>(
|
|
|
|
|
YatStore(appStore: getIt.get<AppStore>(), secureStorage: getIt.get<FlutterSecureStorage>())
|
|
|
|
|
..init());
|
|
|
|
|
|
|
|
|
|
final secretStore =
|
|
|
|
|
await SecretStoreBase.load(getIt.get<FlutterSecureStorage>());
|
|
|
|
|
final secretStore = await SecretStoreBase.load(getIt.get<FlutterSecureStorage>());
|
|
|
|
|
|
|
|
|
|
getIt.registerSingleton<SecretStore>(secretStore);
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory<KeyService>(
|
|
|
|
|
() => KeyService(getIt.get<FlutterSecureStorage>()));
|
|
|
|
|
getIt.registerFactory<KeyService>(() => KeyService(getIt.get<FlutterSecureStorage>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<WalletCreationService, WalletType, void>(
|
|
|
|
|
(type, _) => WalletCreationService(
|
|
|
|
|
getIt.registerFactoryParam<WalletCreationService, WalletType, void>((type, _) =>
|
|
|
|
|
WalletCreationService(
|
|
|
|
|
initialType: type,
|
|
|
|
|
keyService: getIt.get<KeyService>(),
|
|
|
|
|
secureStorage: getIt.get<FlutterSecureStorage>(),
|
|
|
|
|
sharedPreferences: getIt.get<SharedPreferences>(),
|
|
|
|
|
walletInfoSource: _walletInfoSource));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory<WalletLoadingService>(
|
|
|
|
|
() => WalletLoadingService(
|
|
|
|
|
getIt.registerFactory<WalletLoadingService>(() => WalletLoadingService(
|
|
|
|
|
getIt.get<SharedPreferences>(),
|
|
|
|
|
getIt.get<KeyService>(),
|
|
|
|
|
(WalletType type) => getIt.get<WalletService>(param1: type)));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<WalletNewVM, WalletType, void>((type, _) =>
|
|
|
|
|
WalletNewVM(getIt.get<AppStore>(),
|
|
|
|
|
getIt.get<WalletCreationService>(param1: type), _walletInfoSource,
|
|
|
|
|
type: type));
|
|
|
|
|
getIt.registerFactoryParam<WalletNewVM, WalletType, void>((type, _) => WalletNewVM(
|
|
|
|
|
getIt.get<AppStore>(), getIt.get<WalletCreationService>(param1: type), _walletInfoSource,
|
|
|
|
|
type: type));
|
|
|
|
|
|
|
|
|
|
getIt
|
|
|
|
|
.registerFactoryParam<WalletRestorationFromSeedVM, List, void>((args, _) {
|
|
|
|
|
getIt.registerFactoryParam<WalletRestorationFromSeedVM, List, void>((args, _) {
|
|
|
|
|
final type = args.first as WalletType;
|
|
|
|
|
final language = args[1] as String;
|
|
|
|
|
final mnemonic = args[2] as String;
|
|
|
|
|
|
|
|
|
|
return WalletRestorationFromSeedVM(getIt.get<AppStore>(),
|
|
|
|
|
getIt.get<WalletCreationService>(param1: type), _walletInfoSource,
|
|
|
|
|
return WalletRestorationFromSeedVM(
|
|
|
|
|
getIt.get<AppStore>(), getIt.get<WalletCreationService>(param1: type), _walletInfoSource,
|
|
|
|
|
type: type, language: language, seed: mnemonic);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt
|
|
|
|
|
.registerFactoryParam<WalletRestorationFromKeysVM, List, void>((args, _) {
|
|
|
|
|
getIt.registerFactoryParam<WalletRestorationFromKeysVM, List, void>((args, _) {
|
|
|
|
|
final type = args.first as WalletType;
|
|
|
|
|
final language = args[1] as String;
|
|
|
|
|
|
|
|
|
|
return WalletRestorationFromKeysVM(getIt.get<AppStore>(),
|
|
|
|
|
getIt.get<WalletCreationService>(param1: type), _walletInfoSource,
|
|
|
|
|
return WalletRestorationFromKeysVM(
|
|
|
|
|
getIt.get<AppStore>(), getIt.get<WalletCreationService>(param1: type), _walletInfoSource,
|
|
|
|
|
type: type, language: language);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory<WalletAddressListViewModel>(() =>
|
|
|
|
|
WalletAddressListViewModel(
|
|
|
|
|
appStore: getIt.get<AppStore>(), yatStore: getIt.get<YatStore>()));
|
|
|
|
|
WalletAddressListViewModel(appStore: getIt.get<AppStore>(), yatStore: getIt.get<YatStore>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => BalanceViewModel(
|
|
|
|
|
appStore: getIt.get<AppStore>(),
|
|
|
|
@ -306,15 +298,12 @@ Future setup(
|
|
|
|
|
secureStorage: getIt.get<FlutterSecureStorage>(),
|
|
|
|
|
sharedPreferences: getIt.get<SharedPreferences>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory<AuthViewModel>(() => AuthViewModel(
|
|
|
|
|
getIt.get<AuthService>(),
|
|
|
|
|
getIt.get<SharedPreferences>(),
|
|
|
|
|
getIt.get<SettingsStore>(),
|
|
|
|
|
BiometricAuth()));
|
|
|
|
|
getIt.registerFactory<AuthViewModel>(() => AuthViewModel(getIt.get<AuthService>(),
|
|
|
|
|
getIt.get<SharedPreferences>(), getIt.get<SettingsStore>(), BiometricAuth()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory<AuthPage>(
|
|
|
|
|
() => AuthPage(getIt.get<AuthViewModel>(), onAuthenticationFinished:
|
|
|
|
|
(isAuthenticated, AuthPageState authPageState) {
|
|
|
|
|
() => AuthPage(getIt.get<AuthViewModel>(),
|
|
|
|
|
onAuthenticationFinished: (isAuthenticated, AuthPageState authPageState) {
|
|
|
|
|
if (!isAuthenticated) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -329,8 +318,7 @@ Future setup(
|
|
|
|
|
authPageState.changeProcessText('Loading the wallet');
|
|
|
|
|
|
|
|
|
|
if (loginError != null) {
|
|
|
|
|
authPageState
|
|
|
|
|
.changeProcessText('ERROR: ${loginError.toString()}');
|
|
|
|
|
authPageState.changeProcessText('ERROR: ${loginError.toString()}');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ReactionDisposer? _reaction;
|
|
|
|
@ -341,28 +329,29 @@ Future setup(
|
|
|
|
|
}, closable: false),
|
|
|
|
|
instanceName: 'login');
|
|
|
|
|
|
|
|
|
|
getIt
|
|
|
|
|
.registerFactoryParam<AuthPage, void Function(bool, AuthPageState), bool>(
|
|
|
|
|
(onAuthFinished, closable) => AuthPage(getIt.get<AuthViewModel>(),
|
|
|
|
|
onAuthenticationFinished: onAuthFinished,
|
|
|
|
|
closable: closable ?? false));
|
|
|
|
|
getIt.registerFactoryParam<AuthPage, void Function(bool, AuthPageState), bool>(
|
|
|
|
|
(onAuthFinished, closable) => AuthPage(getIt.get<AuthViewModel>(),
|
|
|
|
|
onAuthenticationFinished: onAuthFinished, closable: closable ?? false));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() =>
|
|
|
|
|
BalancePage(dashboardViewModel: getIt.get<DashboardViewModel>(), settingsStore: getIt.get<SettingsStore>()));
|
|
|
|
|
getIt.registerFactory(() => BalancePage(
|
|
|
|
|
dashboardViewModel: getIt.get<DashboardViewModel>(),
|
|
|
|
|
settingsStore: getIt.get<SettingsStore>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory<DashboardPage>(() => DashboardPage( balancePage: getIt.get<BalancePage>(), walletViewModel: getIt.get<DashboardViewModel>(), addressListViewModel: getIt.get<WalletAddressListViewModel>()));
|
|
|
|
|
getIt.registerFactory<ReceivePage>(() => ReceivePage(
|
|
|
|
|
getIt.registerFactory<DashboardPage>(() => DashboardPage(
|
|
|
|
|
balancePage: getIt.get<BalancePage>(),
|
|
|
|
|
walletViewModel: getIt.get<DashboardViewModel>(),
|
|
|
|
|
addressListViewModel: getIt.get<WalletAddressListViewModel>()));
|
|
|
|
|
getIt.registerFactory<ReceivePage>(
|
|
|
|
|
() => ReceivePage(addressListViewModel: getIt.get<WalletAddressListViewModel>()));
|
|
|
|
|
getIt.registerFactory<AddressPage>(() => AddressPage(
|
|
|
|
|
addressListViewModel: getIt.get<WalletAddressListViewModel>(),
|
|
|
|
|
walletViewModel: getIt.get<DashboardViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<WalletAddressEditOrCreateViewModel, dynamic, void>(
|
|
|
|
|
(dynamic item, _) => WalletAddressEditOrCreateViewModel(
|
|
|
|
|
wallet: getIt.get<AppStore>().wallet!, item: item));
|
|
|
|
|
getIt.registerFactoryParam<WalletAddressEditOrCreateViewModel, dynamic, void>((dynamic item, _) =>
|
|
|
|
|
WalletAddressEditOrCreateViewModel(wallet: getIt.get<AppStore>().wallet!, item: item));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<AddressEditOrCreatePage, dynamic, void>(
|
|
|
|
|
(dynamic item, _) => AddressEditOrCreatePage(
|
|
|
|
|
getIt.registerFactoryParam<AddressEditOrCreatePage, dynamic, void>((dynamic item, _) =>
|
|
|
|
|
AddressEditOrCreatePage(
|
|
|
|
|
addressEditOrCreateViewModel:
|
|
|
|
|
getIt.get<WalletAddressEditOrCreateViewModel>(param1: item)));
|
|
|
|
|
|
|
|
|
@ -380,20 +369,16 @@ Future setup(
|
|
|
|
|
getIt.get<BalanceViewModel>(),
|
|
|
|
|
_transactionDescriptionBox));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(
|
|
|
|
|
() => SendPage(sendViewModel: getIt.get<SendViewModel>(),
|
|
|
|
|
settingsViewModel: getIt.get<SettingsViewModel>()));
|
|
|
|
|
getIt.registerFactory(() => SendPage(sendViewModel: getIt.get<SendViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => SendTemplatePage(
|
|
|
|
|
sendTemplateViewModel: getIt.get<SendTemplateViewModel>()));
|
|
|
|
|
getIt.registerFactory(
|
|
|
|
|
() => SendTemplatePage(sendTemplateViewModel: getIt.get<SendTemplateViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => WalletListViewModel(
|
|
|
|
|
_walletInfoSource,
|
|
|
|
|
getIt.get<AppStore>(),
|
|
|
|
|
getIt.get<WalletLoadingService>()));
|
|
|
|
|
_walletInfoSource, getIt.get<AppStore>(), getIt.get<WalletLoadingService>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() =>
|
|
|
|
|
WalletListPage(walletListViewModel: getIt.get<WalletListViewModel>()));
|
|
|
|
|
getIt
|
|
|
|
|
.registerFactory(() => WalletListPage(walletListViewModel: getIt.get<WalletListViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() {
|
|
|
|
|
final wallet = getIt.get<AppStore>().wallet!;
|
|
|
|
@ -402,11 +387,12 @@ Future setup(
|
|
|
|
|
return MoneroAccountListViewModel(wallet);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
throw Exception('Unexpected wallet type: ${wallet.type} for generate MoneroAccountListViewModel');
|
|
|
|
|
throw Exception(
|
|
|
|
|
'Unexpected wallet type: ${wallet.type} for generate MoneroAccountListViewModel');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => MoneroAccountListPage(
|
|
|
|
|
accountListViewModel: getIt.get<MoneroAccountListViewModel>()));
|
|
|
|
|
getIt.registerFactory(
|
|
|
|
|
() => MoneroAccountListPage(accountListViewModel: getIt.get<MoneroAccountListViewModel>()));
|
|
|
|
|
|
|
|
|
|
/*getIt.registerFactory(() {
|
|
|
|
|
final wallet = getIt.get<AppStore>().wallet;
|
|
|
|
@ -423,92 +409,86 @@ Future setup(
|
|
|
|
|
moneroAccountCreationViewModel:
|
|
|
|
|
getIt.get<MoneroAccountEditOrCreateViewModel>()));*/
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<MoneroAccountEditOrCreateViewModel,
|
|
|
|
|
AccountListItem?, void>(
|
|
|
|
|
getIt.registerFactoryParam<MoneroAccountEditOrCreateViewModel, AccountListItem?, void>(
|
|
|
|
|
(AccountListItem? account, _) => MoneroAccountEditOrCreateViewModel(
|
|
|
|
|
monero!.getAccountList(getIt.get<AppStore>().wallet!),
|
|
|
|
|
haven?.getAccountList(getIt.get<AppStore>().wallet!),
|
|
|
|
|
wallet: getIt.get<AppStore>().wallet!,
|
|
|
|
|
accountListItem: account));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<MoneroAccountEditOrCreatePage, AccountListItem?,
|
|
|
|
|
void>(
|
|
|
|
|
getIt.registerFactoryParam<MoneroAccountEditOrCreatePage, AccountListItem?, void>(
|
|
|
|
|
(AccountListItem? account, _) => MoneroAccountEditOrCreatePage(
|
|
|
|
|
moneroAccountCreationViewModel:
|
|
|
|
|
getIt.get<MoneroAccountEditOrCreateViewModel>(param1: account)));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() {
|
|
|
|
|
final appStore = getIt.get<AppStore>();
|
|
|
|
|
final yatStore = getIt.get<YatStore>();
|
|
|
|
|
final authService = getIt.get<AuthService>();
|
|
|
|
|
return SettingsViewModel(appStore.settingsStore, yatStore, authService, appStore.wallet!);
|
|
|
|
|
return DisplaySettingsViewModel(getIt.get<SettingsStore>());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt
|
|
|
|
|
.registerFactory(() => WalletSeedViewModel(getIt.get<AppStore>().wallet!));
|
|
|
|
|
getIt.registerFactory(() {
|
|
|
|
|
return PrivacySettingsViewModel(getIt.get<SettingsStore>());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<WalletSeedPage, bool, void>(
|
|
|
|
|
(bool isWalletCreated, _) => WalletSeedPage(
|
|
|
|
|
getIt.get<WalletSeedViewModel>(),
|
|
|
|
|
isNewWalletCreated: isWalletCreated));
|
|
|
|
|
getIt.registerFactory(() {
|
|
|
|
|
return OtherSettingsViewModel(getIt.get<SettingsStore>(), getIt.get<AppStore>().wallet!);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt
|
|
|
|
|
.registerFactory(() => WalletKeysViewModel(getIt.get<AppStore>().wallet!));
|
|
|
|
|
getIt.registerFactory(() {
|
|
|
|
|
return SecuritySettingsViewModel(getIt.get<SettingsStore>());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => WalletSeedViewModel(getIt.get<AppStore>().wallet!));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<WalletSeedPage, bool, void>((bool isWalletCreated, _) =>
|
|
|
|
|
WalletSeedPage(getIt.get<WalletSeedViewModel>(), isNewWalletCreated: isWalletCreated));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => WalletKeysViewModel(getIt.get<AppStore>().wallet!));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => WalletKeysPage(getIt.get<WalletKeysViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<ContactViewModel, ContactRecord?, void>(
|
|
|
|
|
(ContactRecord? contact, _) =>
|
|
|
|
|
ContactViewModel(_contactSource, contact: contact));
|
|
|
|
|
(ContactRecord? contact, _) => ContactViewModel(_contactSource, contact: contact));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(
|
|
|
|
|
() => ContactListViewModel(_contactSource, _walletInfoSource));
|
|
|
|
|
getIt.registerFactory(() => ContactListViewModel(_contactSource, _walletInfoSource));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<ContactListPage, bool, void>(
|
|
|
|
|
(bool isEditable, _) => ContactListPage(getIt.get<ContactListViewModel>(),
|
|
|
|
|
isEditable: isEditable));
|
|
|
|
|
getIt.registerFactoryParam<ContactListPage, bool, void>((bool isEditable, _) =>
|
|
|
|
|
ContactListPage(getIt.get<ContactListViewModel>(), isEditable: isEditable));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<ContactPage, ContactRecord?, void>(
|
|
|
|
|
(ContactRecord? contact, _) =>
|
|
|
|
|
ContactPage(getIt.get<ContactViewModel>(param1: contact)));
|
|
|
|
|
(ContactRecord? contact, _) => ContactPage(getIt.get<ContactViewModel>(param1: contact)));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() {
|
|
|
|
|
final appStore = getIt.get<AppStore>();
|
|
|
|
|
return NodeListViewModel(
|
|
|
|
|
_nodeSource, appStore.wallet!, appStore.settingsStore);
|
|
|
|
|
return NodeListViewModel(_nodeSource, appStore.wallet!, appStore.settingsStore);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => NodeListPage(getIt.get<NodeListViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => ConnectionSyncPage(getIt.get<NodeListViewModel>(), getIt.get<DashboardViewModel>()));
|
|
|
|
|
getIt.registerFactory(
|
|
|
|
|
() => ConnectionSyncPage(getIt.get<NodeListViewModel>(), getIt.get<DashboardViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => SecurityBackupPage(getIt.get<SettingsViewModel>()));
|
|
|
|
|
getIt.registerFactory(() => SecurityBackupPage(getIt.get<SecuritySettingsViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => PrivacyPage(getIt.get<SettingsViewModel>()));
|
|
|
|
|
getIt.registerFactory(() => PrivacyPage(getIt.get<PrivacySettingsViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => DisplaySettingsPage(getIt.get<SettingsViewModel>()));
|
|
|
|
|
getIt.registerFactory(() => DisplaySettingsPage(getIt.get<DisplaySettingsViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => OtherSettingsPage(getIt.get<SettingsViewModel>()));
|
|
|
|
|
getIt.registerFactory(() => OtherSettingsPage(getIt.get<OtherSettingsViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() =>
|
|
|
|
|
NodeCreateOrEditViewModel(_nodeSource, getIt.get<AppStore>().wallet!));
|
|
|
|
|
getIt
|
|
|
|
|
.registerFactory(() => NodeCreateOrEditViewModel(_nodeSource, getIt.get<AppStore>().wallet!));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(
|
|
|
|
|
() => NodeCreateOrEditPage(getIt.get<NodeCreateOrEditViewModel>()));
|
|
|
|
|
getIt.registerFactory(() => NodeCreateOrEditPage(getIt.get<NodeCreateOrEditViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => OnRamperPage(
|
|
|
|
|
settingsStore: getIt.get<AppStore>().settingsStore,
|
|
|
|
|
wallet: getIt.get<AppStore>().wallet!));
|
|
|
|
|
settingsStore: getIt.get<AppStore>().settingsStore, wallet: getIt.get<AppStore>().wallet!));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => ExchangeViewModel(
|
|
|
|
|
getIt.get<AppStore>().wallet!,
|
|
|
|
|
_tradesSource,
|
|
|
|
|
getIt.get<ExchangeTemplateStore>(),
|
|
|
|
|
getIt.get<TradesStore>(),
|
|
|
|
|
getIt.get<AppStore>().settingsStore,
|
|
|
|
|
getIt.get<SharedPreferences>(),
|
|
|
|
|
getIt.get<SettingsViewModel>(),
|
|
|
|
|
));
|
|
|
|
|
getIt.get<AppStore>().wallet!,
|
|
|
|
|
_tradesSource,
|
|
|
|
|
getIt.get<ExchangeTemplateStore>(),
|
|
|
|
|
getIt.get<TradesStore>(),
|
|
|
|
|
getIt.get<AppStore>().settingsStore,
|
|
|
|
|
getIt.get<SharedPreferences>(),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => ExchangeTradeViewModel(
|
|
|
|
|
wallet: getIt.get<AppStore>().wallet!,
|
|
|
|
@ -518,40 +498,34 @@ Future setup(
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => ExchangePage(getIt.get<ExchangeViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(
|
|
|
|
|
() => ExchangeConfirmPage(tradesStore: getIt.get<TradesStore>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => ExchangeTradePage(
|
|
|
|
|
exchangeTradeViewModel: getIt.get<ExchangeTradeViewModel>()));
|
|
|
|
|
getIt.registerFactory(() => ExchangeConfirmPage(tradesStore: getIt.get<TradesStore>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(
|
|
|
|
|
() => ExchangeTemplatePage(getIt.get<ExchangeViewModel>()));
|
|
|
|
|
() => ExchangeTradePage(exchangeTradeViewModel: getIt.get<ExchangeTradeViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => ExchangeTemplatePage(getIt.get<ExchangeViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<WalletService, WalletType, void>(
|
|
|
|
|
(WalletType param1, __) {
|
|
|
|
|
getIt.registerFactoryParam<WalletService, WalletType, void>((WalletType param1, __) {
|
|
|
|
|
switch (param1) {
|
|
|
|
|
case WalletType.haven:
|
|
|
|
|
return haven!.createHavenWalletService(_walletInfoSource);
|
|
|
|
|
case WalletType.monero:
|
|
|
|
|
return monero!.createMoneroWalletService(_walletInfoSource);
|
|
|
|
|
case WalletType.bitcoin:
|
|
|
|
|
return bitcoin!.createBitcoinWalletService(
|
|
|
|
|
_walletInfoSource, _unspentCoinsInfoSource!);
|
|
|
|
|
return bitcoin!.createBitcoinWalletService(_walletInfoSource, _unspentCoinsInfoSource!);
|
|
|
|
|
case WalletType.litecoin:
|
|
|
|
|
return bitcoin!.createLitecoinWalletService(
|
|
|
|
|
_walletInfoSource, _unspentCoinsInfoSource!);
|
|
|
|
|
return bitcoin!.createLitecoinWalletService(_walletInfoSource, _unspentCoinsInfoSource!);
|
|
|
|
|
default:
|
|
|
|
|
throw Exception('Unexpected token: ${param1.toString()} for generating of WalletService');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory<SetupPinCodeViewModel>(() => SetupPinCodeViewModel(
|
|
|
|
|
getIt.get<AuthService>(), getIt.get<SettingsStore>()));
|
|
|
|
|
getIt.registerFactory<SetupPinCodeViewModel>(
|
|
|
|
|
() => SetupPinCodeViewModel(getIt.get<AuthService>(), getIt.get<SettingsStore>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<SetupPinCodePage,
|
|
|
|
|
void Function(PinCodeState<PinCodeWidget>, String), void>(
|
|
|
|
|
(onSuccessfulPinSetup, _) => SetupPinCodePage(
|
|
|
|
|
getIt.get<SetupPinCodeViewModel>(),
|
|
|
|
|
getIt.registerFactoryParam<SetupPinCodePage, void Function(PinCodeState<PinCodeWidget>, String),
|
|
|
|
|
void>(
|
|
|
|
|
(onSuccessfulPinSetup, _) => SetupPinCodePage(getIt.get<SetupPinCodeViewModel>(),
|
|
|
|
|
onSuccessfulPinSetup: onSuccessfulPinSetup));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => RescanViewModel(getIt.get<AppStore>().wallet!));
|
|
|
|
@ -560,17 +534,16 @@ Future setup(
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => FaqPage(getIt.get<SettingsStore>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<WalletRestoreViewModel, WalletType, void>(
|
|
|
|
|
(type, _) => WalletRestoreViewModel(getIt.get<AppStore>(),
|
|
|
|
|
getIt.get<WalletCreationService>(param1: type), _walletInfoSource,
|
|
|
|
|
getIt.registerFactoryParam<WalletRestoreViewModel, WalletType, void>((type, _) =>
|
|
|
|
|
WalletRestoreViewModel(
|
|
|
|
|
getIt.get<AppStore>(), getIt.get<WalletCreationService>(param1: type), _walletInfoSource,
|
|
|
|
|
type: type));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<WalletRestorePage, WalletType, void>((type, _) =>
|
|
|
|
|
WalletRestorePage(getIt.get<WalletRestoreViewModel>(param1: type)));
|
|
|
|
|
getIt.registerFactoryParam<WalletRestorePage, WalletType, void>(
|
|
|
|
|
(type, _) => WalletRestorePage(getIt.get<WalletRestoreViewModel>(param1: type)));
|
|
|
|
|
|
|
|
|
|
getIt
|
|
|
|
|
.registerFactoryParam<TransactionDetailsViewModel, TransactionInfo, void>(
|
|
|
|
|
(TransactionInfo transactionInfo, _) {
|
|
|
|
|
getIt.registerFactoryParam<TransactionDetailsViewModel, TransactionInfo, void>(
|
|
|
|
|
(TransactionInfo transactionInfo, _) {
|
|
|
|
|
final wallet = getIt.get<AppStore>().wallet!;
|
|
|
|
|
return TransactionDetailsViewModel(
|
|
|
|
|
transactionInfo: transactionInfo,
|
|
|
|
@ -584,52 +557,47 @@ Future setup(
|
|
|
|
|
transactionDetailsViewModel:
|
|
|
|
|
getIt.get<TransactionDetailsViewModel>(param1: transactionInfo)));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<NewWalletTypePage,
|
|
|
|
|
void Function(BuildContext, WalletType), void>(
|
|
|
|
|
getIt.registerFactoryParam<NewWalletTypePage, void Function(BuildContext, WalletType), void>(
|
|
|
|
|
(param1, _) => NewWalletTypePage(onTypeSelected: param1));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<PreSeedPage, WalletType, void>(
|
|
|
|
|
(WalletType type, _) => PreSeedPage(type));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<TradeDetailsViewModel, Trade, void>((trade, _) =>
|
|
|
|
|
TradeDetailsViewModel(tradeForDetails: trade, trades: _tradesSource,
|
|
|
|
|
TradeDetailsViewModel(
|
|
|
|
|
tradeForDetails: trade,
|
|
|
|
|
trades: _tradesSource,
|
|
|
|
|
settingsStore: getIt.get<SettingsStore>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => BackupService(
|
|
|
|
|
getIt.get<FlutterSecureStorage>(),
|
|
|
|
|
_walletInfoSource,
|
|
|
|
|
getIt.get<KeyService>(),
|
|
|
|
|
getIt.get<SharedPreferences>()));
|
|
|
|
|
getIt.registerFactory(() => BackupService(getIt.get<FlutterSecureStorage>(), _walletInfoSource,
|
|
|
|
|
getIt.get<KeyService>(), getIt.get<SharedPreferences>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => BackupViewModel(getIt.get<FlutterSecureStorage>(),
|
|
|
|
|
getIt.get<SecretStore>(), getIt.get<BackupService>()));
|
|
|
|
|
getIt.registerFactory(() => BackupViewModel(
|
|
|
|
|
getIt.get<FlutterSecureStorage>(), getIt.get<SecretStore>(), getIt.get<BackupService>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => BackupPage(getIt.get<BackupViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(
|
|
|
|
|
() => EditBackupPasswordViewModel(getIt.get<FlutterSecureStorage>(), getIt.get<SecretStore>()));
|
|
|
|
|
getIt.registerFactory(() =>
|
|
|
|
|
EditBackupPasswordViewModel(getIt.get<FlutterSecureStorage>(), getIt.get<SecretStore>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(
|
|
|
|
|
() => EditBackupPasswordPage(getIt.get<EditBackupPasswordViewModel>()));
|
|
|
|
|
getIt.registerFactory(() => EditBackupPasswordPage(getIt.get<EditBackupPasswordViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => RestoreOptionsPage());
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(
|
|
|
|
|
() => RestoreFromBackupViewModel(getIt.get<BackupService>()));
|
|
|
|
|
getIt.registerFactory(() => RestoreFromBackupViewModel(getIt.get<BackupService>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(
|
|
|
|
|
() => RestoreFromBackupPage(getIt.get<RestoreFromBackupViewModel>()));
|
|
|
|
|
getIt.registerFactory(() => RestoreFromBackupPage(getIt.get<RestoreFromBackupViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<TradeDetailsPage, Trade, void>((Trade trade, _) =>
|
|
|
|
|
TradeDetailsPage(getIt.get<TradeDetailsViewModel>(param1: trade)));
|
|
|
|
|
getIt.registerFactoryParam<TradeDetailsPage, Trade, void>(
|
|
|
|
|
(Trade trade, _) => TradeDetailsPage(getIt.get<TradeDetailsViewModel>(param1: trade)));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => BuyAmountViewModel());
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() {
|
|
|
|
|
final wallet = getIt.get<AppStore>().wallet;
|
|
|
|
|
|
|
|
|
|
return BuyViewModel(_ordersSource, getIt.get<OrdersStore>(),
|
|
|
|
|
getIt.get<SettingsStore>(), getIt.get<BuyAmountViewModel>(),
|
|
|
|
|
return BuyViewModel(_ordersSource, getIt.get<OrdersStore>(), getIt.get<SettingsStore>(),
|
|
|
|
|
getIt.get<BuyAmountViewModel>(),
|
|
|
|
|
wallet: wallet!);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -641,7 +609,8 @@ Future setup(
|
|
|
|
|
final url = args.first as String;
|
|
|
|
|
final buyViewModel = args[1] as BuyViewModel;
|
|
|
|
|
|
|
|
|
|
return BuyWebViewPage(buyViewModel: buyViewModel, ordersStore: getIt.get<OrdersStore>(), url: url);
|
|
|
|
|
return BuyWebViewPage(
|
|
|
|
|
buyViewModel: buyViewModel, ordersStore: getIt.get<OrdersStore>(), url: url);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<OrderDetailsViewModel, Order, void>((order, _) {
|
|
|
|
@ -650,8 +619,8 @@ Future setup(
|
|
|
|
|
return OrderDetailsViewModel(wallet: wallet!, orderForDetails: order);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<OrderDetailsPage, Order, void>((Order order, _) =>
|
|
|
|
|
OrderDetailsPage(getIt.get<OrderDetailsViewModel>(param1: order)));
|
|
|
|
|
getIt.registerFactoryParam<OrderDetailsPage, Order, void>(
|
|
|
|
|
(Order order, _) => OrderDetailsPage(getIt.get<OrderDetailsViewModel>(param1: order)));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => SupportViewModel());
|
|
|
|
|
|
|
|
|
@ -660,20 +629,18 @@ Future setup(
|
|
|
|
|
getIt.registerFactory(() {
|
|
|
|
|
final wallet = getIt.get<AppStore>().wallet;
|
|
|
|
|
|
|
|
|
|
return UnspentCoinsListViewModel(
|
|
|
|
|
wallet: wallet!, unspentCoinsInfo: _unspentCoinsInfoSource!);
|
|
|
|
|
return UnspentCoinsListViewModel(wallet: wallet!, unspentCoinsInfo: _unspentCoinsInfoSource!);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => UnspentCoinsListPage(
|
|
|
|
|
unspentCoinsListViewModel: getIt.get<UnspentCoinsListViewModel>()));
|
|
|
|
|
getIt.registerFactory(() =>
|
|
|
|
|
UnspentCoinsListPage(unspentCoinsListViewModel: getIt.get<UnspentCoinsListViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<UnspentCoinsDetailsViewModel, UnspentCoinsItem,
|
|
|
|
|
UnspentCoinsListViewModel>(
|
|
|
|
|
(item, model) => UnspentCoinsDetailsViewModel(
|
|
|
|
|
unspentCoinsItem: item, unspentCoinsListViewModel: model));
|
|
|
|
|
(item, model) =>
|
|
|
|
|
UnspentCoinsDetailsViewModel(unspentCoinsItem: item, unspentCoinsListViewModel: model));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<UnspentCoinsDetailsPage, List, void>(
|
|
|
|
|
(List args, _) {
|
|
|
|
|
getIt.registerFactoryParam<UnspentCoinsDetailsPage, List, void>((List args, _) {
|
|
|
|
|
final item = args.first as UnspentCoinsItem;
|
|
|
|
|
final unspentCoinsListViewModel = args[1] as UnspentCoinsListViewModel;
|
|
|
|
|
|
|
|
|
@ -686,12 +653,15 @@ Future setup(
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => YatService());
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => AddressResolver(yatService: getIt.get<YatService>(),
|
|
|
|
|
walletType: getIt.get<AppStore>().wallet!.type));
|
|
|
|
|
getIt.registerFactory(() => AddressResolver(
|
|
|
|
|
yatService: getIt.get<YatService>(), walletType: getIt.get<AppStore>().wallet!.type));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<FullscreenQRPage, String, bool>(
|
|
|
|
|
(String qrData, bool isLight) => FullscreenQRPage(qrData: qrData, isLight: isLight,));
|
|
|
|
|
|
|
|
|
|
(String qrData, bool isLight) => FullscreenQRPage(
|
|
|
|
|
qrData: qrData,
|
|
|
|
|
isLight: isLight,
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => IoniaApi());
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => AnyPayApi());
|
|
|
|
@ -699,26 +669,24 @@ Future setup(
|
|
|
|
|
getIt.registerFactory<IoniaService>(
|
|
|
|
|
() => IoniaService(getIt.get<FlutterSecureStorage>(), getIt.get<IoniaApi>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory<IoniaAnyPay>(
|
|
|
|
|
() => IoniaAnyPay(
|
|
|
|
|
getIt.get<IoniaService>(),
|
|
|
|
|
getIt.get<AnyPayApi>(),
|
|
|
|
|
getIt.get<AppStore>().wallet!));
|
|
|
|
|
getIt.registerFactory<IoniaAnyPay>(() => IoniaAnyPay(
|
|
|
|
|
getIt.get<IoniaService>(), getIt.get<AnyPayApi>(), getIt.get<AppStore>().wallet!));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => IoniaGiftCardsListViewModel(ioniaService: getIt.get<IoniaService>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => IoniaAuthViewModel(ioniaService: getIt.get<IoniaService>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<IoniaMerchPurchaseViewModel, double, IoniaMerchant>((double amount, merchant) {
|
|
|
|
|
getIt.registerFactoryParam<IoniaMerchPurchaseViewModel, double, IoniaMerchant>(
|
|
|
|
|
(double amount, merchant) {
|
|
|
|
|
return IoniaMerchPurchaseViewModel(
|
|
|
|
|
ioniaAnyPayService: getIt.get<IoniaAnyPay>(),
|
|
|
|
|
amount: amount,
|
|
|
|
|
ioniaMerchant: merchant,
|
|
|
|
|
sendViewModel: getIt.get<SendViewModel>()
|
|
|
|
|
);
|
|
|
|
|
ioniaAnyPayService: getIt.get<IoniaAnyPay>(),
|
|
|
|
|
amount: amount,
|
|
|
|
|
ioniaMerchant: merchant,
|
|
|
|
|
sendViewModel: getIt.get<SendViewModel>());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<IoniaBuyCardViewModel, IoniaMerchant, void>((IoniaMerchant merchant, _) {
|
|
|
|
|
getIt.registerFactoryParam<IoniaBuyCardViewModel, IoniaMerchant, void>(
|
|
|
|
|
(IoniaMerchant merchant, _) {
|
|
|
|
|
return IoniaBuyCardViewModel(ioniaMerchant: merchant);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -746,41 +714,43 @@ Future setup(
|
|
|
|
|
getIt.registerFactoryParam<IoniaBuyGiftCardDetailPage, List, void>((List args, _) {
|
|
|
|
|
final amount = args.first as double;
|
|
|
|
|
final merchant = args.last as IoniaMerchant;
|
|
|
|
|
return IoniaBuyGiftCardDetailPage(getIt.get<IoniaMerchPurchaseViewModel>(param1: amount, param2: merchant));
|
|
|
|
|
return IoniaBuyGiftCardDetailPage(
|
|
|
|
|
getIt.get<IoniaMerchPurchaseViewModel>(param1: amount, param2: merchant));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<IoniaGiftCardDetailsViewModel, IoniaGiftCard, void>((IoniaGiftCard giftCard, _) {
|
|
|
|
|
return IoniaGiftCardDetailsViewModel(
|
|
|
|
|
ioniaService: getIt.get<IoniaService>(),
|
|
|
|
|
giftCard: giftCard);
|
|
|
|
|
getIt.registerFactoryParam<IoniaGiftCardDetailsViewModel, IoniaGiftCard, void>(
|
|
|
|
|
(IoniaGiftCard giftCard, _) {
|
|
|
|
|
return IoniaGiftCardDetailsViewModel(
|
|
|
|
|
ioniaService: getIt.get<IoniaService>(), giftCard: giftCard);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<IoniaCustomTipViewModel, List, void>((List args, _) {
|
|
|
|
|
final amount = args[0] as double;
|
|
|
|
|
final merchant = args[1] as IoniaMerchant;
|
|
|
|
|
final tip = args[2] as IoniaTip;
|
|
|
|
|
|
|
|
|
|
return IoniaCustomTipViewModel(amount: amount, tip: tip, ioniaMerchant: merchant);
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<IoniaCustomTipViewModel, List, void>((List args, _) {
|
|
|
|
|
final amount = args[0] as double;
|
|
|
|
|
final merchant = args[1] as IoniaMerchant;
|
|
|
|
|
final tip = args[2] as IoniaTip;
|
|
|
|
|
|
|
|
|
|
return IoniaCustomTipViewModel(amount: amount, tip: tip, ioniaMerchant: merchant);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<IoniaGiftCardDetailPage, IoniaGiftCard, void>((IoniaGiftCard giftCard, _) {
|
|
|
|
|
return IoniaGiftCardDetailPage(getIt.get<IoniaGiftCardDetailsViewModel>(param1: giftCard));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<IoniaGiftCardDetailPage, IoniaGiftCard, void>(
|
|
|
|
|
(IoniaGiftCard giftCard, _) {
|
|
|
|
|
return IoniaGiftCardDetailPage(getIt.get<IoniaGiftCardDetailsViewModel>(param1: giftCard));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<IoniaMoreOptionsPage, List, void>((List args, _){
|
|
|
|
|
getIt.registerFactoryParam<IoniaMoreOptionsPage, List, void>((List args, _) {
|
|
|
|
|
final giftCard = args.first as IoniaGiftCard;
|
|
|
|
|
|
|
|
|
|
return IoniaMoreOptionsPage(giftCard);
|
|
|
|
|
|
|
|
|
|
return IoniaMoreOptionsPage(giftCard);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<IoniaCustomRedeemViewModel, IoniaGiftCard, void>((IoniaGiftCard giftCard, _) => IoniaCustomRedeemViewModel(giftCard));
|
|
|
|
|
getIt.registerFactoryParam<IoniaCustomRedeemViewModel, IoniaGiftCard, void>(
|
|
|
|
|
(IoniaGiftCard giftCard, _) => IoniaCustomRedeemViewModel(giftCard));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<IoniaCustomRedeemPage, List, void>((List args, _){
|
|
|
|
|
getIt.registerFactoryParam<IoniaCustomRedeemPage, List, void>((List args, _) {
|
|
|
|
|
final giftCard = args.first as IoniaGiftCard;
|
|
|
|
|
|
|
|
|
|
return IoniaCustomRedeemPage(getIt.get<IoniaCustomRedeemViewModel>(param1: giftCard) );
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return IoniaCustomRedeemPage(getIt.get<IoniaCustomRedeemViewModel>(param1: giftCard));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<IoniaCustomTipPage, List, void>((List args, _) {
|
|
|
|
|
return IoniaCustomTipPage(getIt.get<IoniaCustomTipViewModel>(param1: args));
|
|
|
|
@ -796,16 +766,17 @@ Future setup(
|
|
|
|
|
|
|
|
|
|
getIt.registerFactory(() => IoniaAccountCardsPage(getIt.get<IoniaAccountViewModel>()));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<IoniaPaymentStatusViewModel, IoniaAnyPayPaymentInfo, AnyPayPaymentCommittedInfo>(
|
|
|
|
|
(IoniaAnyPayPaymentInfo paymentInfo, AnyPayPaymentCommittedInfo committedInfo)
|
|
|
|
|
=> IoniaPaymentStatusViewModel(
|
|
|
|
|
getIt.get<IoniaService>(),
|
|
|
|
|
paymentInfo: paymentInfo,
|
|
|
|
|
committedInfo: committedInfo));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<IoniaPaymentStatusPage, IoniaAnyPayPaymentInfo, AnyPayPaymentCommittedInfo>(
|
|
|
|
|
(IoniaAnyPayPaymentInfo paymentInfo, AnyPayPaymentCommittedInfo committedInfo)
|
|
|
|
|
=> IoniaPaymentStatusPage(getIt.get<IoniaPaymentStatusViewModel>(param1: paymentInfo, param2: committedInfo)));
|
|
|
|
|
getIt.registerFactoryParam<IoniaPaymentStatusViewModel, IoniaAnyPayPaymentInfo,
|
|
|
|
|
AnyPayPaymentCommittedInfo>(
|
|
|
|
|
(IoniaAnyPayPaymentInfo paymentInfo, AnyPayPaymentCommittedInfo committedInfo) =>
|
|
|
|
|
IoniaPaymentStatusViewModel(getIt.get<IoniaService>(),
|
|
|
|
|
paymentInfo: paymentInfo, committedInfo: committedInfo));
|
|
|
|
|
|
|
|
|
|
getIt.registerFactoryParam<IoniaPaymentStatusPage, IoniaAnyPayPaymentInfo,
|
|
|
|
|
AnyPayPaymentCommittedInfo>(
|
|
|
|
|
(IoniaAnyPayPaymentInfo paymentInfo, AnyPayPaymentCommittedInfo committedInfo) =>
|
|
|
|
|
IoniaPaymentStatusPage(
|
|
|
|
|
getIt.get<IoniaPaymentStatusViewModel>(param1: paymentInfo, param2: committedInfo)));
|
|
|
|
|
|
|
|
|
|
_isSetupFinished = true;
|
|
|
|
|
}
|
|
|
|
|