From 7c0bfce3c2026fc030978a8671063837e24b6be0 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 27 Jan 2023 15:11:29 -0600 Subject: [PATCH] clear field to minimum value --- lib/pages/buy_view/buy_form.dart | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/pages/buy_view/buy_form.dart b/lib/pages/buy_view/buy_form.dart index ebc5ac48e..cc4bd88f0 100644 --- a/lib/pages/buy_view/buy_form.dart +++ b/lib/pages/buy_view/buy_form.dart @@ -1016,11 +1016,20 @@ class _BuyFormState extends ConsumerState { _buyAmountController.text.isNotEmpty ? TextFieldIconButton( key: const Key( - "buyViewClearAddressFieldButtonKey"), + "buyViewClearAmountFieldButtonKey"), onTap: () { - _buyAmountController.text = ""; - // _receiveAddress = ""; - setState(() {}); + if (_BuyFormState.buyWithFiat) { + _buyAmountController.text = _BuyFormState + .minFiat + .toStringAsFixed(2); + } else { + if (selectedCrypto?.ticker == + _BuyFormState.boundedCryptoTicker) { + _buyAmountController.text = _BuyFormState + .minCrypto + .toStringAsFixed(8); + } + } }, child: const XIcon(), )