hidden mode for balance on send screen (#344)

This commit is contained in:
Serhii 2022-04-22 18:00:28 +03:00 committed by GitHub
parent 1874d7b2de
commit 2e17c59a00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -339,6 +339,7 @@ Future setup(
getIt.get<AppStore>().settingsStore,
getIt.get<SendTemplateViewModel>(),
getIt.get<FiatConversionStore>(),
getIt.get<BalanceViewModel>(),
_transactionDescriptionBox));
getIt.registerFactory(

View file

@ -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<TransactionDescription> transactionDescriptionBox;