Force refresh of expenses editor
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -40,6 +40,15 @@ class ExpenseEditor extends HookConsumerWidget {
|
||||
|
||||
final (:pending, :snapshot, :hasError) = useAsyncTask();
|
||||
|
||||
// Force refresh of field if required
|
||||
final previousData = useState<BaseExpenseInfo?>(null);
|
||||
if (initialData != previousData.value) {
|
||||
previousData.value = initialData;
|
||||
labelController.text = initialData?.label ?? "";
|
||||
costController.text = initialData?.cost.toString() ?? "";
|
||||
timeController.value = initialData?.time ?? DateTime.now();
|
||||
}
|
||||
|
||||
// Clear cost value
|
||||
handleClearCost() {
|
||||
costController.text = "";
|
||||
|
Reference in New Issue
Block a user