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.registerFactoryParam<MoneroAccountEditOrCreateViewModel,
AccountListItem, void>(
(AccountListItem account, _) => 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,
getIt.registerFactoryParam<MoneroAccountEditOrCreatePage, AccountListItem?,
void>(
(AccountListItem account, _) => MoneroAccountEditOrCreatePage(
(AccountListItem? account, _) => MoneroAccountEditOrCreatePage(
moneroAccountCreationViewModel:
getIt.get<MoneroAccountEditOrCreateViewModel>(param1: account)));

View file

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