From 3f66112938822798b02531142981ec8e56ff8e0f Mon Sep 17 00:00:00 2001 From: codaMW Date: Tue, 30 Jun 2026 19:11:08 +0200 Subject: [PATCH] fix(invoice): make Add Lightning Invoice screen scrollable so Submit stays reachable with keyboard open Wraps the invoice form Column in a SingleChildScrollView. On smaller or taller-keyboard viewports the Column overflowed when the soft keyboard shrank the available height, clipping the Submit button's hit area so taps did nothing (issue #635). Scrolling keeps the button reachable on any screen size. Fixes #635 --- .../widgets/add_lightning_invoice_widget.dart | 150 +++++++++--------- 1 file changed, 77 insertions(+), 73 deletions(-) diff --git a/lib/shared/widgets/add_lightning_invoice_widget.dart b/lib/shared/widgets/add_lightning_invoice_widget.dart index c56c717a3..f0e5a0e9c 100644 --- a/lib/shared/widgets/add_lightning_invoice_widget.dart +++ b/lib/shared/widgets/add_lightning_invoice_widget.dart @@ -30,89 +30,93 @@ class AddLightningInvoiceWidget extends StatefulWidget { class _AddLightningInvoiceWidgetState extends State { @override Widget build(BuildContext context) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - S.of(context)!.pleaseEnterLightningInvoiceFor( - widget.amount.toString(), - widget.fiatCode, - widget.fiatAmount, - widget.orderId, - ), - style: const TextStyle( - color: AppTheme.textPrimary, - fontSize: 16, - fontWeight: FontWeight.w500, - ), - ), - const SizedBox(height: 16), - Container( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), - decoration: BoxDecoration( - color: AppTheme.backgroundInput, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: Colors.white.withValues(alpha: 0.1)), + return SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + S.of(context)!.pleaseEnterLightningInvoiceFor( + widget.amount.toString(), + widget.fiatCode, + widget.fiatAmount, + widget.orderId, + ), + style: const TextStyle( + color: AppTheme.textPrimary, + fontSize: 16, + fontWeight: FontWeight.w500, + ), ), - child: TextFormField( - key: const Key('invoiceTextField'), - controller: widget.controller, - style: const TextStyle(color: AppTheme.textPrimary), - decoration: InputDecoration( - labelText: S.of(context)!.lightningInvoice, - labelStyle: const TextStyle(color: AppTheme.textSecondary), - hintText: S.of(context)!.enterInvoiceHere, - hintStyle: const TextStyle(color: AppTheme.textSecondary), - border: InputBorder.none, - contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), - alignLabelWithHint: true, + const SizedBox(height: 16), + Container( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), + decoration: BoxDecoration( + color: AppTheme.backgroundInput, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.white.withValues(alpha: 0.1)), + ), + child: TextFormField( + key: const Key('invoiceTextField'), + controller: widget.controller, + style: const TextStyle(color: AppTheme.textPrimary), + decoration: InputDecoration( + labelText: S.of(context)!.lightningInvoice, + labelStyle: const TextStyle(color: AppTheme.textSecondary), + hintText: S.of(context)!.enterInvoiceHere, + hintStyle: const TextStyle(color: AppTheme.textSecondary), + border: InputBorder.none, + contentPadding: + const EdgeInsets.symmetric(horizontal: 12, vertical: 8), + alignLabelWithHint: true, + ), + maxLines: 6, ), - maxLines: 6, ), - ), - const SizedBox(height: 16), - Row( - children: [ - Expanded( - child: TextButton( - key: const Key('cancelInvoiceButton'), - onPressed: widget.onCancel, - child: Text( - S.of(context)!.cancel, - style: const TextStyle( - color: AppTheme.textSecondary, - fontSize: 16, - fontWeight: FontWeight.w500, + const SizedBox(height: 16), + Row( + children: [ + Expanded( + child: TextButton( + key: const Key('cancelInvoiceButton'), + onPressed: widget.onCancel, + child: Text( + S.of(context)!.cancel, + style: const TextStyle( + color: AppTheme.textSecondary, + fontSize: 16, + fontWeight: FontWeight.w500, + ), + textAlign: TextAlign.center, ), - textAlign: TextAlign.center, ), ), - ), - const SizedBox(width: 12), - Expanded( - child: ElevatedButton( - key: const Key('submitInvoiceButton'), - onPressed: widget.onSubmit, - style: ElevatedButton.styleFrom( - backgroundColor: AppTheme.activeColor, - foregroundColor: Colors.black, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8), + const SizedBox(width: 12), + Expanded( + child: ElevatedButton( + key: const Key('submitInvoiceButton'), + onPressed: widget.onSubmit, + style: ElevatedButton.styleFrom( + backgroundColor: AppTheme.activeColor, + foregroundColor: Colors.black, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + padding: const EdgeInsets.symmetric( + horizontal: 12, vertical: 12), ), - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12), - ), - child: Text( - S.of(context)!.submit, - style: const TextStyle( - fontSize: 16, - fontWeight: FontWeight.w500, + child: Text( + S.of(context)!.submit, + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w500, + ), ), ), ), - ), - ], - ), - ], + ], + ), + ], + ), ); } }