when method

FormFieldValidator<T> when(
  1. bool condition(
    1. T? value
    )
)

Adds a condition to apply the validator only if the condition is met.

Implementation

FormFieldValidator<T> when(bool Function(T? value) condition) {
  return FormBuilderValidators.conditional(condition, this);
}