notContains<T, E> static method

Rule<Iterable<T>, E> notContains<T, E>(
  1. T item, {
  2. required E error,
})

Validates that the collection does not contain item.

CollectionRules.notContains('banned', error: 'Banned item not allowed')

Implementation

static Rule<Iterable<T>, E> notContains<T, E>(T item, {required E error}) =>
    PredicateRule(
      predicate: (value) => !value.contains(item),
      error: error,
    );