mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-09 12:29:31 +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(),
|
actionLeftButton: () => Navigator.of(context).pop(),
|
||||||
feeFiatAmount: widget.disableFiat ? ''
|
feeFiatAmount: widget.exchangeTradeViewModel
|
||||||
: widget.exchangeTradeViewModel.sendViewModel.pendingTransactionFeeFiatAmount
|
.pendingTransactionFeeFiatAmountFormatted,
|
||||||
+ ' ' + widget.exchangeTradeViewModel.sendViewModel.fiat.title,
|
fiatAmountValue: widget.exchangeTradeViewModel
|
||||||
fiatAmountValue: widget.disableFiat ? ''
|
.pendingTransactionFiatAmountValueFormatted,
|
||||||
: widget.exchangeTradeViewModel.sendViewModel
|
|
||||||
.pendingTransactionFiatAmount +
|
|
||||||
' ' +
|
|
||||||
widget.exchangeTradeViewModel.sendViewModel.fiat.title,
|
|
||||||
outputs: widget.exchangeTradeViewModel.sendViewModel
|
outputs: widget.exchangeTradeViewModel.sendViewModel
|
||||||
.outputs);
|
.outputs);
|
||||||
});
|
});
|
||||||
|
|
|
@ -386,14 +386,10 @@ class SendPage extends BasePage {
|
||||||
amount: S.of(context).send_amount,
|
amount: S.of(context).send_amount,
|
||||||
amountValue:
|
amountValue:
|
||||||
sendViewModel.pendingTransaction!.amountFormatted,
|
sendViewModel.pendingTransaction!.amountFormatted,
|
||||||
fiatAmountValue: sendViewModel.balanceViewModel.disableFiat
|
fiatAmountValue: sendViewModel.pendingTransactionFiatAmountFormatted,
|
||||||
? '' : sendViewModel.pendingTransactionFiatAmount +
|
|
||||||
' ' + sendViewModel.fiat.title,
|
|
||||||
fee: S.of(context).send_fee,
|
fee: S.of(context).send_fee,
|
||||||
feeValue: sendViewModel.pendingTransaction!.feeFormatted,
|
feeValue: sendViewModel.pendingTransaction!.feeFormatted,
|
||||||
feeFiatAmount: sendViewModel.balanceViewModel.disableFiat
|
feeFiatAmount: sendViewModel.pendingTransactionFeeFiatAmountFormatted,
|
||||||
? '' : sendViewModel.pendingTransactionFeeFiatAmount +
|
|
||||||
' ' + sendViewModel.fiat.title,
|
|
||||||
outputs: sendViewModel.outputs,
|
outputs: sendViewModel.outputs,
|
||||||
rightButtonText: S.of(context).ok,
|
rightButtonText: S.of(context).ok,
|
||||||
leftButtonText: S.of(context).cancel,
|
leftButtonText: S.of(context).cancel,
|
||||||
|
|
|
@ -72,6 +72,18 @@ abstract class ExchangeTradeViewModelBase with Store {
|
||||||
? '\n\n' + S.current.xrp_extra_info
|
? '\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
|
@observable
|
||||||
ObservableList<ExchangeTradeItem> items;
|
ObservableList<ExchangeTradeItem> items;
|
||||||
|
|
||||||
|
|
|
@ -139,6 +139,16 @@ abstract class SendViewModelBase with Store {
|
||||||
@computed
|
@computed
|
||||||
String get balance => balanceViewModel.availableBalance ?? '0.0';
|
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
|
@computed
|
||||||
bool get isReadyForSend => _wallet.syncStatus is SyncedSyncStatus;
|
bool get isReadyForSend => _wallet.syncStatus is SyncedSyncStatus;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue