only validate fiat amounts

TODO make sure exchange rate doesn't push fiat value over max
This commit is contained in:
sneurlax 2023-01-26 10:58:00 -06:00
parent f25392379e
commit e05b0658d1

View file

@ -1262,11 +1262,15 @@ class NumericalRangeFormatter extends TextInputFormatter {
) {
if (newValue.text == '') {
return newValue;
} else if (Decimal.parse(newValue.text) < min) {
newValue =
const TextEditingValue().copyWith(text: min.toStringAsFixed(2));
} else {
newValue = Decimal.parse(newValue.text) > max ? oldValue : newValue;
if (buyWithFiat) {
if (Decimal.parse(newValue.text) < min) {
newValue =
const TextEditingValue().copyWith(text: min.toStringAsFixed(2));
} else {
newValue = Decimal.parse(newValue.text) > max ? oldValue : newValue;
}
}
}
final regexString = buyWithFiat