setupForm method

  1. @override
Future<void> setupForm(
  1. Map<T, FormXField> inputs, {
  2. bool applySoftValidation = true,
})

Implementations of this method should setup the form with the given inputs.

When applySoftValidation is true, it updates the state of the form when setting it up. This way if the form is invalid, the errors won't show up but FormXState.isFormValid will be false.

Implementation

@override
Future<void> setupForm(
  Map<T, FormXField> inputs, {
  bool applySoftValidation = true,
}) async {
  emit(FormXState<T>(inputs));
  if (applySoftValidation) await validateForm(softValidation: true);
}