From 208f79cc4f24261bc65cdba2227c3802a071cf3f Mon Sep 17 00:00:00 2001 From: dreautall <109872040+dreautall@users.noreply.github.com> Date: Sat, 6 Jul 2024 18:32:54 +0000 Subject: [PATCH] fix selecting bill for transaction fixes #413 --- lib/pages/transaction.dart | 1 + lib/pages/transaction/bill.dart | 25 ++++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/pages/transaction.dart b/lib/pages/transaction.dart index ac1ada80..058cec42 100644 --- a/lib/pages/transaction.dart +++ b/lib/pages/transaction.dart @@ -1930,6 +1930,7 @@ class _TransactionPageState extends State onPressed: () async { BillRead? newBill = await showDialog( context: context, + barrierDismissible: false, builder: (BuildContext context) => BillDialog(currentBill: _bills[i]), ); diff --git a/lib/pages/transaction/bill.dart b/lib/pages/transaction/bill.dart index 0639c09d..36e9442b 100644 --- a/lib/pages/transaction/bill.dart +++ b/lib/pages/transaction/bill.dart @@ -51,6 +51,7 @@ class _BillDialogState extends State { icon: const Icon(Icons.calendar_today), title: Text(S.of(context).transactionDialogBillTitle), clipBehavior: Clip.hardEdge, + scrollable: false, actions: [ TextButton( child: Text(S.of(context).transactionDialogBillNoBill), @@ -88,17 +89,19 @@ class _BillDialogState extends State { displayStringForOption: (AutocompleteBill option) => option.name, onSelected: (AutocompleteBill option) { log.finer(() => "selected bill ${option.id}"); - _bill = BillRead( - type: "bill", - id: option.id, - attributes: Bill( - name: option.name, - amountMin: "", - amountMax: "", - date: DateTime.now(), - repeatFreq: BillRepeatFrequency.swaggerGeneratedUnknown, - ), - ); + setState(() { + _bill = BillRead( + type: "bill", + id: option.id, + attributes: Bill( + name: option.name, + amountMin: "", + amountMax: "", + date: DateTime.now(), + repeatFreq: BillRepeatFrequency.swaggerGeneratedUnknown, + ), + ); + }); }, optionsBuilder: (TextEditingValue textEditingValue) async { try {