mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-02-02 19:26:37 +00:00
only validate fiat amounts
TODO make sure exchange rate doesn't push fiat value over max
This commit is contained in:
parent
f25392379e
commit
e05b0658d1
1 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue