diff --git a/lib/src/screens/exchange_trade/exchange_trade_page.dart b/lib/src/screens/exchange_trade/exchange_trade_page.dart index 4128fb9f2..001c13ba9 100644 --- a/lib/src/screens/exchange_trade/exchange_trade_page.dart +++ b/lib/src/screens/exchange_trade/exchange_trade_page.dart @@ -381,14 +381,10 @@ class ExchangeTradeState extends State { }); }, actionLeftButton: () => Navigator.of(context).pop(), - feeFiatAmount: widget.disableFiat ? '' - : widget.exchangeTradeViewModel.sendViewModel.pendingTransactionFeeFiatAmount - + ' ' + widget.exchangeTradeViewModel.sendViewModel.fiat.title, - fiatAmountValue: widget.disableFiat ? '' - : widget.exchangeTradeViewModel.sendViewModel - .pendingTransactionFiatAmount + - ' ' + - widget.exchangeTradeViewModel.sendViewModel.fiat.title, + feeFiatAmount: widget.exchangeTradeViewModel + .pendingTransactionFeeFiatAmountFormatted, + fiatAmountValue: widget.exchangeTradeViewModel + .pendingTransactionFiatAmountValueFormatted, outputs: widget.exchangeTradeViewModel.sendViewModel .outputs); }); diff --git a/lib/src/screens/send/send_page.dart b/lib/src/screens/send/send_page.dart index 8815d8c58..b0891c6e5 100644 --- a/lib/src/screens/send/send_page.dart +++ b/lib/src/screens/send/send_page.dart @@ -386,14 +386,10 @@ class SendPage extends BasePage { amount: S.of(context).send_amount, amountValue: sendViewModel.pendingTransaction!.amountFormatted, - fiatAmountValue: sendViewModel.balanceViewModel.disableFiat - ? '' : sendViewModel.pendingTransactionFiatAmount + - ' ' + sendViewModel.fiat.title, + fiatAmountValue: sendViewModel.pendingTransactionFiatAmountFormatted, fee: S.of(context).send_fee, feeValue: sendViewModel.pendingTransaction!.feeFormatted, - feeFiatAmount: sendViewModel.balanceViewModel.disableFiat - ? '' : sendViewModel.pendingTransactionFeeFiatAmount + - ' ' + sendViewModel.fiat.title, + feeFiatAmount: sendViewModel.pendingTransactionFeeFiatAmountFormatted, outputs: sendViewModel.outputs, rightButtonText: S.of(context).ok, leftButtonText: S.of(context).cancel, diff --git a/lib/view_model/exchange/exchange_trade_view_model.dart b/lib/view_model/exchange/exchange_trade_view_model.dart index 796397429..133b4a228 100644 --- a/lib/view_model/exchange/exchange_trade_view_model.dart +++ b/lib/view_model/exchange/exchange_trade_view_model.dart @@ -72,6 +72,18 @@ abstract class ExchangeTradeViewModelBase with Store { ? '\n\n' + S.current.xrp_extra_info : ''; + @computed + String get pendingTransactionFiatAmountValueFormatted => + sendViewModel.balanceViewModel.disableFiat + ? '' : sendViewModel.pendingTransactionFiatAmount + + ' ' + sendViewModel.fiat.title; + + @computed + String get pendingTransactionFeeFiatAmountFormatted => + sendViewModel.balanceViewModel.disableFiat + ? '' : sendViewModel.pendingTransactionFeeFiatAmount + + ' ' + sendViewModel.fiat.title; + @observable ObservableList items; diff --git a/lib/view_model/send/send_view_model.dart b/lib/view_model/send/send_view_model.dart index cdef6faba..fbfba2313 100644 --- a/lib/view_model/send/send_view_model.dart +++ b/lib/view_model/send/send_view_model.dart @@ -139,6 +139,16 @@ abstract class SendViewModelBase with Store { @computed String get balance => balanceViewModel.availableBalance ?? '0.0'; + @computed + String get pendingTransactionFiatAmountFormatted => + balanceViewModel.disableFiat ? '' : pendingTransactionFiatAmount + + ' ' + fiat.title; + + @computed + String get pendingTransactionFeeFiatAmountFormatted => + balanceViewModel.disableFiat ? '' : pendingTransactionFeeFiatAmount + + ' ' + fiat.title; + @computed bool get isReadyForSend => _wallet.syncStatus is SyncedSyncStatus;