minLength<T, E> static method

Rule<Iterable<T>, E> minLength<T, E>(
  1. int min, {
  2. required E error,
})

Validates that the collection has at least min items.

CollectionRules.minLength(1, error: 'At least one item required')

Implementation

static Rule<Iterable<T>, E> minLength<T, E>(int min, {required E error}) =>
    PredicateRule(
      predicate: (value) => value.length >= min,
      error: error,
    );