diff --git a/lib/pages/buy_view/buy_form.dart b/lib/pages/buy_view/buy_form.dart index d7168f6b3..24143f574 100644 --- a/lib/pages/buy_view/buy_form.dart +++ b/lib/pages/buy_view/buy_form.dart @@ -563,7 +563,7 @@ class _BuyFormState extends ConsumerState { signed: false, decimal: true, ), - textAlign: TextAlign.right, + textAlign: TextAlign.left, inputFormatters: [ // regex to validate a crypto amount with 8 decimal places or // 2 if fiat @@ -582,9 +582,13 @@ class _BuyFormState extends ConsumerState { ], decoration: InputDecoration( contentPadding: const EdgeInsets.only( - top: 22, - right: 12, - bottom: 22, + // top: 22, + // right: 12, + // bottom: 22, + left: 0, + top: 8, + bottom: 10, + right: 5, ), hintText: "0", hintStyle: STextStyles.desktopTextExtraSmall(context).copyWith( @@ -607,6 +611,47 @@ class _BuyFormState extends ConsumerState { ), ), ), + suffixIcon: Padding( + padding: const EdgeInsets.all(0), + child: UnconstrainedBox( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + _buyAmountController.text.isNotEmpty + ? TextFieldIconButton( + key: const Key( + "buyViewClearAddressFieldButtonKey"), + onTap: () { + _buyAmountController.text = ""; + // _receiveAddress = ""; + setState(() {}); + }, + child: const XIcon(), + ) + : TextFieldIconButton( + key: const Key( + "buyViewPasteAddressFieldButtonKey"), + onTap: () async { + final ClipboardData? data = await clipboard + .getData(Clipboard.kTextPlain); + + final amountString = + Decimal.tryParse(data?.text ?? ""); + if (amountString != null) { + _buyAmountController.text = + amountString.toString(); + + setState(() {}); + } + }, + child: _buyAmountController.text.isEmpty + ? const ClipboardIcon() + : const XIcon(), + ), + ], + ), + ), + ), ), ), SizedBox( @@ -690,8 +735,7 @@ class _BuyFormState extends ConsumerState { focusNode: _receiveAddressFocusNode, style: STextStyles.field(context), decoration: standardInputDecoration( - /*"Enter ${coin.ticker} address",*/ - "Enter address", + "Enter ${selectedCrypto?.ticker} address", _receiveAddressFocusNode, context, ).copyWith(