unless method

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

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

Implementation

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