multiple method

FormFieldValidator multiple (
  1. List<FormFieldValidator<String>> validators
)

Implementation

static FormFieldValidator multiple(
    List<FormFieldValidator<String>> validators) {
  return (fieldValue) {
    for (FormFieldValidator validator in validators) {
      var outcome = validator(fieldValue);
      if (outcome != null) return outcome;
    }
    return null; // all validators were passed
  };
}