Can clear cost value quickly
This commit is contained in:
@@ -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,
|
||||
),
|
||||
|
||||
|
Reference in New Issue
Block a user