all<T> static method

FormeValidator<T> all<T>(
  1. List<FormeValidator<T>> validators, {
  2. String errorText = '',
})

when valid

  1. every validator return null

Implementation

static FormeValidator<T> all<T>(List<FormeValidator<T>> validators,
    {String errorText = ''}) {
  return (f, T v) {
    for (final FormeValidator<T> validator in validators) {
      final String? resultText = validator(f, v);
      if (resultText != null) {
        return resultText == '' ? errorText : resultText;
      }
    }
    return null;
  };
}