mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
move view model into di.dart
This commit is contained in:
parent
5960c390a4
commit
f85ec0631b
2 changed files with 6 additions and 3 deletions
|
@ -746,6 +746,7 @@ Future<void> setup({
|
|||
_transactionDescriptionBox,
|
||||
getIt.get<AppStore>().wallet!.isHardwareWallet ? getIt.get<LedgerViewModel>() : null,
|
||||
coinTypeToSpendFrom: coinTypeToSpendFrom ?? UnspentCoinType.any,
|
||||
getIt.get<UnspentCoinsListViewModel>(param1: coinTypeToSpendFrom),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
@ -65,6 +65,8 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
|||
wallet.type == WalletType.tron;
|
||||
}
|
||||
|
||||
UnspentCoinsListViewModel unspentCoinsListViewModel;
|
||||
|
||||
SendViewModelBase(
|
||||
AppStore appStore,
|
||||
this.sendTemplateViewModel,
|
||||
|
@ -72,7 +74,8 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
|||
this.balanceViewModel,
|
||||
this.contactListViewModel,
|
||||
this.transactionDescriptionBox,
|
||||
this.ledgerViewModel, {
|
||||
this.ledgerViewModel,
|
||||
this.unspentCoinsListViewModel, {
|
||||
this.coinTypeToSpendFrom = UnspentCoinType.any,
|
||||
}) : state = InitialExecutionState(),
|
||||
currencies = appStore.wallet!.balance.keys.toList(),
|
||||
|
@ -532,9 +535,8 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
|||
}
|
||||
|
||||
if (hasCoinControl) {
|
||||
final vm = getIt.get<UnspentCoinsListViewModel>(param1: coinTypeToSpendFrom);
|
||||
bool isCoinSelected = false;
|
||||
for (var coin in vm.items) {
|
||||
for (var coin in unspentCoinsListViewModel.items) {
|
||||
isCoinSelected = isCoinSelected || (coin.isSending && !coin.isFrozen);
|
||||
}
|
||||
if (!isCoinSelected) {
|
||||
|
|
Loading…
Reference in a new issue