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, ),