Skip to content

Commit

Permalink
fix selecting bill for transaction
Browse files Browse the repository at this point in the history
fixes #413
  • Loading branch information
dreautall committed Jul 6, 2024
1 parent 172ca70 commit 208f79c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
1 change: 1 addition & 0 deletions lib/pages/transaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1930,6 +1930,7 @@ class _TransactionPageState extends State<TransactionPage>
onPressed: () async {
BillRead? newBill = await showDialog<BillRead>(
context: context,
barrierDismissible: false,
builder: (BuildContext context) =>
BillDialog(currentBill: _bills[i]),
);
Expand Down
25 changes: 14 additions & 11 deletions lib/pages/transaction/bill.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class _BillDialogState extends State<BillDialog> {
icon: const Icon(Icons.calendar_today),
title: Text(S.of(context).transactionDialogBillTitle),
clipBehavior: Clip.hardEdge,
scrollable: false,
actions: <Widget>[
TextButton(
child: Text(S.of(context).transactionDialogBillNoBill),
Expand Down Expand Up @@ -88,17 +89,19 @@ class _BillDialogState extends State<BillDialog> {
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 {
Expand Down

0 comments on commit 208f79c

Please sign in to comment.