CAKE-185 | removed isValidAmount() from exchange_view_model.dart and exchange_page.dart; throw exception in the createTrade() (xmrto_exchange_provider.dart) if number of fractional digits of amount more than 8

This commit is contained in:
OleksandrSobol
2020-12-03 23:22:56 +02:00
parent 27cfad5d95
commit df01fa0314
3 changed files with 20 additions and 31 deletions
@@ -311,20 +311,6 @@ abstract class ExchangeViewModelBase with Store {
void removeTemplate({ExchangeTemplate template}) =>
_exchangeTemplateStore.remove(template: template);
bool isValidAmount() {
bool isValid = true;
if (provider is XMRTOExchangeProvider) {
final amount = isReceiveAmountEntered
? receiveAmount
: depositAmount;
final pattern = '^([0-9]+([.\,][0-9]{0,8})?|[.\,][0-9]{1,8})\$';
isValid = RegExp(pattern).hasMatch(amount);
}
return isValid;
}
List<ExchangeProvider> providersForCurrentPair() {
return _providersForPair(from: depositCurrency, to: receiveCurrency);
}