From 2e17c59a005f1d7935c3892e1766f5ffbc8f7f3b Mon Sep 17 00:00:00 2001 From: Serhii Date: Fri, 22 Apr 2022 18:00:28 +0300 Subject: [PATCH] hidden mode for balance on send screen (#344) --- lib/di.dart | 1 + lib/view_model/send/send_view_model.dart | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/di.dart b/lib/di.dart index 3cc4dacae..dc6ec367d 100644 --- a/lib/di.dart +++ b/lib/di.dart @@ -339,6 +339,7 @@ Future setup( getIt.get().settingsStore, getIt.get(), getIt.get(), + getIt.get(), _transactionDescriptionBox)); getIt.registerFactory( diff --git a/lib/view_model/send/send_view_model.dart b/lib/view_model/send/send_view_model.dart index 5c4a15c27..d82dd979f 100644 --- a/lib/view_model/send/send_view_model.dart +++ b/lib/view_model/send/send_view_model.dart @@ -1,5 +1,6 @@ import 'package:cake_wallet/entities/balance_display_mode.dart'; import 'package:cake_wallet/entities/transaction_description.dart'; +import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart'; import 'package:cw_core/transaction_priority.dart'; import 'package:cake_wallet/view_model/send/output.dart'; import 'package:cake_wallet/view_model/send/send_template_view_model.dart'; @@ -36,6 +37,7 @@ abstract class SendViewModelBase with Store { this._settingsStore, this.sendTemplateViewModel, this._fiatConversationStore, + this.balanceViewModel, this.transactionDescriptionBox) : state = InitialExecutionState() { final priority = _settingsStore.priority[_wallet.type]; @@ -128,7 +130,7 @@ abstract class SendViewModelBase with Store { PendingTransaction pendingTransaction; @computed - String get balance => _wallet.balance[selectedCryptoCurrency].formattedAvailableBalance ?? '0.0'; + String get balance => balanceViewModel.availableBalance ?? '0.0'; @computed bool get isReadyForSend => _wallet.syncStatus is SyncedSyncStatus; @@ -160,6 +162,7 @@ abstract class SendViewModelBase with Store { final WalletBase _wallet; final SettingsStore _settingsStore; final SendTemplateViewModel sendTemplateViewModel; + final BalanceViewModel balanceViewModel; final FiatConversionStore _fiatConversationStore; final Box transactionDescriptionBox;