mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-04 12:34:14 +01:00
CAKE-278 | added isReceiveAmountEditable and isFixedRateMode to exchange_view_model.dart; fixed changeReceiveAmount() in the exchange_view_model.dart; applied StandardCheckbox to exchange_page.dart for checking fixed rate mode; applied alert dialog to exchange_page.dart when receive amount has focus and fixed rate mode is not checked; added reaction for isFixedRateMode in the exchange_page.dart; added key and changeValue() to standard_checkbox.dart
This commit is contained in:
@@ -58,6 +58,9 @@ abstract class ExchangeViewModelBase with Store {
|
||||
}
|
||||
});
|
||||
|
||||
isReceiveAmountEditable = provider is ChangeNowExchangeProvider;
|
||||
isFixedRateMode = false;
|
||||
|
||||
isReceiveAmountEntered = false;
|
||||
loadLimits();
|
||||
}
|
||||
@@ -106,6 +109,12 @@ abstract class ExchangeViewModelBase with Store {
|
||||
@observable
|
||||
bool isReceiveAmountEntered;
|
||||
|
||||
@observable
|
||||
bool isReceiveAmountEditable;
|
||||
|
||||
@observable
|
||||
bool isFixedRateMode;
|
||||
|
||||
@computed
|
||||
SyncStatus get status => wallet.syncStatus;
|
||||
|
||||
@@ -127,6 +136,7 @@ abstract class ExchangeViewModelBase with Store {
|
||||
this.provider = provider;
|
||||
depositAmount = '';
|
||||
receiveAmount = '';
|
||||
isReceiveAmountEditable = provider is ChangeNowExchangeProvider;
|
||||
loadLimits();
|
||||
}
|
||||
|
||||
@@ -160,8 +170,8 @@ abstract class ExchangeViewModelBase with Store {
|
||||
|
||||
provider
|
||||
.calculateAmount(
|
||||
from: depositCurrency,
|
||||
to: receiveCurrency,
|
||||
from: receiveCurrency,
|
||||
to: depositCurrency,
|
||||
amount: _amount,
|
||||
isReceiveAmount: true)
|
||||
.then((amount) => _cryptoNumberFormat
|
||||
|
||||
Reference in New Issue
Block a user