handleUpdateFormDataEvent method
FutureOr<void>
handleUpdateFormDataEvent(
- BlocxFormEventUpdateFormData<
P> event, - Emitter<
BlocxFormState< emitF, E> >
inherited
Handles replacing the full form data from a new payload.
This is useful when switching between create and update modes without recreating the bloc.
Implementation
FutureOr<void> handleUpdateFormDataEvent(
BlocxFormEventUpdateFormData<P> event,
Emitter<BlocxFormState<F, E>> emit,
) async {
_isUpdate = event.isUpdate;
formData = await applyPayloadToFormData(event.payload);
emit(BlocxFormStateApplyInitialDataToForm(formData: formData));
await validateForm(formData, forceFullValidation: true);
emitState(emit);
}