updateAndValidateField method

  1. @override
Future<void> updateAndValidateField(
  1. dynamic newValue,
  2. T key, {
  3. bool softValidation = false,
})

Implementations of this method should call FormX.updateAndValidateField

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> updateAndValidateField(
  dynamic newValue,
  T key, {
  bool softValidation = false,
}) async {
  final formX = await FormX.fromState(state)
      .updateAndValidateField(newValue, key, softValidation: softValidation);
  emit(formX.state);
}