From b8f74e50db1920ec8c93eb870b60f16b45d3672b Mon Sep 17 00:00:00 2001 From: Serhii Date: Fri, 20 Jan 2023 14:48:44 +0200 Subject: [PATCH] [skip ci] specify class type --- .../wallet_address_edit_or_create_view_model.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/view_model/wallet_address_list/wallet_address_edit_or_create_view_model.dart b/lib/view_model/wallet_address_list/wallet_address_edit_or_create_view_model.dart index c9d2c77f5..c29a256df 100644 --- a/lib/view_model/wallet_address_list/wallet_address_edit_or_create_view_model.dart +++ b/lib/view_model/wallet_address_list/wallet_address_edit_or_create_view_model.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_item.dart'; import 'package:mobx/mobx.dart'; import 'package:flutter/foundation.dart'; import 'package:cw_core/wallet_base.dart'; @@ -27,10 +28,10 @@ class AddressEditOrCreateStateFailure extends AddressEditOrCreateState { abstract class WalletAddressEditOrCreateViewModelBase with Store { WalletAddressEditOrCreateViewModelBase( - {required WalletBase wallet, dynamic item}) + {required WalletBase wallet, WalletAddressListItem? item}) : isEdit = item != null, state = AddressEditOrCreateStateInitial(), - label = item?.name as String? ?? '', + label = item?.name ?? '', _item = item, _wallet = wallet; @@ -42,7 +43,7 @@ abstract class WalletAddressEditOrCreateViewModelBase with Store { bool isEdit; - final dynamic _item; + final WalletAddressListItem? _item; final WalletBase _wallet; Future save() async { @@ -105,7 +106,7 @@ abstract class WalletAddressEditOrCreateViewModelBase with Store { .setLabelSubaddress( wallet, accountIndex: monero!.getCurrentAccount(wallet).id, - addressIndex: _item.id as int, + addressIndex: _item?.id as int, label: label); await wallet.save(); } @@ -116,7 +117,7 @@ abstract class WalletAddressEditOrCreateViewModelBase with Store { .setLabelSubaddress( wallet, accountIndex: haven!.getCurrentAccount(wallet).id, - addressIndex: _item.id as int, + addressIndex: _item?.id as int, label: label); await wallet.save(); }