Can clear cost value quickly

This commit is contained in:
2025-07-20 18:18:20 +02:00
parent 1788e7f184
commit 3beaba806a

View File

@@ -40,6 +40,11 @@ class ExpenseEditor extends HookConsumerWidget {
final (:pending, :snapshot, :hasError) = useAsyncTask(); final (:pending, :snapshot, :hasError) = useAsyncTask();
// Clear cost value
handleClearCost() {
costController.text = "";
}
// Pick a new date // Pick a new date
handlePickDate() async { handlePickDate() async {
final date = await showDatePicker( final date = await showDatePicker(
@@ -137,7 +142,13 @@ class ExpenseEditor extends HookConsumerWidget {
decimal: true, decimal: true,
signed: false, signed: false,
), ),
decoration: const InputDecoration(labelText: 'Cost'), decoration: InputDecoration(
labelText: 'Cost',
suffixIcon: IconButton(
onPressed: handleClearCost,
icon: const Icon(Icons.clear),
),
),
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
), ),