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:
OleksandrSobol
2021-02-16 21:06:23 +02:00
parent 35aabcd248
commit 317ef8f3e4
3 changed files with 71 additions and 7 deletions
@@ -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