CAKE-296 | added receiveCurrencies (list of crypto currencies without xlm and xrp) to exchange_view_model.dart; applied receiveCurrencies to receive card in the exchange_page.dart

This commit is contained in:
OleksandrSobol
2021-04-06 20:11:26 +03:00
parent d9752e5709
commit 68c12cbb79
3 changed files with 9 additions and 22 deletions
@@ -57,10 +57,12 @@ abstract class ExchangeViewModelBase with Store {
_onPairChange();
}
});
receiveCurrencies = CryptoCurrency.all.where((cryptoCurrency) =>
(cryptoCurrency != CryptoCurrency.xlm)&&
(cryptoCurrency != CryptoCurrency.xrp)).toList();
_defineIsReceiveAmountEditable();
isFixedRateMode = false;
isReceiveAmountEntered = false;
isDisabledExchangeButton = false;
loadLimits();
}
@@ -114,9 +116,6 @@ abstract class ExchangeViewModelBase with Store {
@observable
bool isFixedRateMode;
@observable
bool isDisabledExchangeButton;
@computed
SyncStatus get status => wallet.syncStatus;
@@ -127,6 +126,8 @@ abstract class ExchangeViewModelBase with Store {
bool get hasAllAmount =>
wallet.type == WalletType.bitcoin && depositCurrency == wallet.currency;
List<CryptoCurrency> receiveCurrencies;
Limits limits;
NumberFormat _cryptoNumberFormat;
@@ -378,14 +379,11 @@ abstract class ExchangeViewModelBase with Store {
_providerForPair(from: depositCurrency, to: receiveCurrency);
if (provider != null) {
isDisabledExchangeButton = false;
changeProvider(provider: provider);
}
} else {
isDisabledExchangeButton = true;
depositAmount = '';
receiveAmount = '';
limitsState = LimitsLoadedFailure(error: 'Pair is not exists');
}
}