diff --git a/lib/routes/home/widgets/bottom_actions_bar/enter_payment_info_page.dart b/lib/routes/home/widgets/bottom_actions_bar/enter_payment_info_page.dart index 27ab7a50..9f1fd56e 100644 --- a/lib/routes/home/widgets/bottom_actions_bar/enter_payment_info_page.dart +++ b/lib/routes/home/widgets/bottom_actions_bar/enter_payment_info_page.dart @@ -28,6 +28,14 @@ class _EnterPaymentInfoPageState extends State { String errorMessage = ""; ModalRoute? _loaderRoute; + @override + void initState() { + super.initState(); + _paymentInfoController.addListener(() { + setState(() {}); + }); + } + @override Widget build(BuildContext context) { final texts = context.texts(); @@ -89,14 +97,13 @@ class _EnterPaymentInfoPageState extends State { ), ), ), - bottomNavigationBar: SingleButtonBottomBar( - text: _paymentInfoController.text.isNotEmpty && errorMessage.isEmpty - ? texts.payment_info_dialog_action_approve - : texts.payment_info_dialog_action_cancel, - onPressed: _paymentInfoController.text.isNotEmpty && errorMessage.isEmpty - ? _onApprovePressed - : () => Navigator.pop(context), - ), + bottomNavigationBar: _paymentInfoController.text.isNotEmpty + ? SingleButtonBottomBar( + stickToBottom: true, + text: texts.withdraw_funds_action_next, + onPressed: _onApprovePressed, + ) + : const SizedBox.shrink(), ); } @@ -157,7 +164,7 @@ class _EnterPaymentInfoPageState extends State { if (_formKey.currentState!.validate()) { _setLoading(false); if (mounted) Navigator.pop(context); - inputCubit.addIncomingInput(_paymentInfoController.text, InputSource.inputField); + inputCubit.addIncomingInput(_paymentInfoController.text.trim(), InputSource.inputField); } } catch (error) { _setLoading(false); @@ -167,6 +174,8 @@ class _EnterPaymentInfoPageState extends State { errorMessage = context.texts().payment_info_dialog_error; }); } + } finally { + _setLoading(false); } } diff --git a/lib/routes/lnurl/payment/lnurl_payment_page.dart b/lib/routes/lnurl/payment/lnurl_payment_page.dart index 18331b7e..1ec61b11 100644 --- a/lib/routes/lnurl/payment/lnurl_payment_page.dart +++ b/lib/routes/lnurl/payment/lnurl_payment_page.dart @@ -300,7 +300,7 @@ class LnUrlPaymentPageState extends State { }, ), ), - if (errorMessage.isNotEmpty) ...[ + if (!_isFormEnabled || _isFixedAmount && errorMessage.isNotEmpty) ...[ const SizedBox(height: 8.0), AutoSizeText( errorMessage, @@ -359,7 +359,7 @@ class LnUrlPaymentPageState extends State { _fetchLightningLimits(); }, ) - : errorMessage.isNotEmpty + : !_isFormEnabled || _isFixedAmount && errorMessage.isNotEmpty ? SingleButtonBottomBar( stickToBottom: true, text: texts.qr_code_dialog_action_close, @@ -370,7 +370,7 @@ class LnUrlPaymentPageState extends State { : !_isFixedAmount ? SingleButtonBottomBar( stickToBottom: true, - text: texts.lnurl_fetch_invoice_action_continue, + text: texts.withdraw_funds_action_next, onPressed: () async { if (_formKey.currentState?.validate() ?? false) { await _openConfirmationPage(); @@ -380,7 +380,7 @@ class LnUrlPaymentPageState extends State { : _prepareResponse != null ? SingleButtonBottomBar( stickToBottom: true, - text: texts.lnurl_payment_page_action_pay, + text: texts.bottom_action_bar_send, onPressed: () async { Navigator.pop(context, _prepareResponse); }, diff --git a/lib/routes/receive_payment/lnurl/lnurl_withdraw_page.dart b/lib/routes/receive_payment/lnurl/lnurl_withdraw_page.dart index 0f9c80ba..296e7d8a 100644 --- a/lib/routes/receive_payment/lnurl/lnurl_withdraw_page.dart +++ b/lib/routes/receive_payment/lnurl/lnurl_withdraw_page.dart @@ -288,7 +288,7 @@ class LnUrlWithdrawPageState extends State { _fetchLightningLimits(); }, ) - : errorMessage.isNotEmpty + : !_isFormEnabled || _isFixedAmount && errorMessage.isNotEmpty ? SingleButtonBottomBar( stickToBottom: true, text: texts.qr_code_dialog_action_close,