set amount text to max if >max

This commit is contained in:
sneurlax 2023-01-26 15:40:32 -06:00
parent e68385a6ae
commit 9a3e9f345d

View file

@ -508,6 +508,10 @@ class _BuyFormState extends ConsumerState<BuyForm> {
_BuyFormState.maxCrypto = Decimal.parse(errorMessage.substring( _BuyFormState.maxCrypto = Decimal.parse(errorMessage.substring(
errorMessage.indexOf("$minCrypto and ") + "$minCrypto and ".length, errorMessage.indexOf("$minCrypto and ") + "$minCrypto and ".length,
errorMessage.length)); errorMessage.length));
if (Decimal.parse(_buyAmountController.text) >
_BuyFormState.maxCrypto) {
_buyAmountController.text = _BuyFormState.maxCrypto.toString();
}
} }
await showDialog<dynamic>( await showDialog<dynamic>(
context: context, context: context,