Allow null AccountListItem for create purpose not just editing (#558)

This commit is contained in:
Omar Hatem 2022-10-24 21:25:14 +02:00 committed by GitHub
parent fb8017a93c
commit d9415af4de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -419,16 +419,16 @@ Future setup(
getIt.get<MoneroAccountEditOrCreateViewModel>()));*/ getIt.get<MoneroAccountEditOrCreateViewModel>()));*/
getIt.registerFactoryParam<MoneroAccountEditOrCreateViewModel, getIt.registerFactoryParam<MoneroAccountEditOrCreateViewModel,
AccountListItem, void>( AccountListItem?, void>(
(AccountListItem account, _) => MoneroAccountEditOrCreateViewModel( (AccountListItem? account, _) => MoneroAccountEditOrCreateViewModel(
monero!.getAccountList(getIt.get<AppStore>().wallet!), monero!.getAccountList(getIt.get<AppStore>().wallet!),
haven?.getAccountList(getIt.get<AppStore>().wallet!), haven?.getAccountList(getIt.get<AppStore>().wallet!),
wallet: getIt.get<AppStore>().wallet!, wallet: getIt.get<AppStore>().wallet!,
accountListItem: account)); accountListItem: account));
getIt.registerFactoryParam<MoneroAccountEditOrCreatePage, AccountListItem, getIt.registerFactoryParam<MoneroAccountEditOrCreatePage, AccountListItem?,
void>( void>(
(AccountListItem account, _) => MoneroAccountEditOrCreatePage( (AccountListItem? account, _) => MoneroAccountEditOrCreatePage(
moneroAccountCreationViewModel: moneroAccountCreationViewModel:
getIt.get<MoneroAccountEditOrCreateViewModel>(param1: account))); getIt.get<MoneroAccountEditOrCreateViewModel>(param1: account)));

View file

@ -293,7 +293,7 @@ Route<dynamic> createRoute(RouteSettings settings) {
case Routes.accountCreation: case Routes.accountCreation:
return CupertinoPageRoute<String>( return CupertinoPageRoute<String>(
builder: (_) => getIt.get<MoneroAccountEditOrCreatePage>( builder: (_) => getIt.get<MoneroAccountEditOrCreatePage>(
param1: settings.arguments as AccountListItem)); param1: settings.arguments as AccountListItem?));
case Routes.addressBook: case Routes.addressBook:
return MaterialPageRoute<void>( return MaterialPageRoute<void>(