exclude method

Iterable<T> exclude (
  1. T value,
  2. {bool comparer(
    1. T value,
    2. T element
    )}
)

Returns all elements in this iterable except those that are equal to the specified value.

Implementation

Iterable<T> exclude(
  T value, {
  bool Function(T value, T element) comparer,
}) sync* {
  checkNullError(this);
  comparer ??= EqualityComparer.forType<T>()?.compare ?? (a, b) => a == b;

  for (var o in this) {
    if (!comparer(value, o)) {
      yield (o);
    }
  }
}