From 3beaba806a4ae44c2770d92994c374ed1cb519b3 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sun, 20 Jul 2025 18:18:20 +0200 Subject: [PATCH] Can clear cost value quickly --- moneymgr_mobile/lib/widgets/expense_editor.dart | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/moneymgr_mobile/lib/widgets/expense_editor.dart b/moneymgr_mobile/lib/widgets/expense_editor.dart index c0f9c8d..85799a5 100644 --- a/moneymgr_mobile/lib/widgets/expense_editor.dart +++ b/moneymgr_mobile/lib/widgets/expense_editor.dart @@ -40,6 +40,11 @@ class ExpenseEditor extends HookConsumerWidget { final (:pending, :snapshot, :hasError) = useAsyncTask(); + // Clear cost value + handleClearCost() { + costController.text = ""; + } + // Pick a new date handlePickDate() async { final date = await showDatePicker( @@ -137,7 +142,13 @@ class ExpenseEditor extends HookConsumerWidget { decimal: true, signed: false, ), - decoration: const InputDecoration(labelText: 'Cost'), + decoration: InputDecoration( + labelText: 'Cost', + suffixIcon: IconButton( + onPressed: handleClearCost, + icon: const Icon(Icons.clear), + ), + ), textInputAction: TextInputAction.done, ),