none<T, E> static method

Rule<Iterable<T>, E> none<T, E>(
  1. bool predicate(
    1. T
    ), {
  2. required E error,
})

Validates that no items match the predicate.

CollectionRules.none((item) => item.isEmpty, error: 'No empty items allowed')

Implementation

static Rule<Iterable<T>, E> none<T, E>(
  bool Function(T) predicate, {
  required E error,
}) =>
    PredicateRule(
      predicate: (value) => !value.any(predicate),
      error: error,
    );