mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-09 04:19:36 +00:00
move logic to viewmodels
This commit is contained in:
parent
9ce8a1944b
commit
92328c4102
4 changed files with 28 additions and 14 deletions
|
@ -381,14 +381,10 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
|
|||
});
|
||||
},
|
||||
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);
|
||||
});
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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<ExchangeTradeItem> items;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue