difference method

  1. @useResult
List<T> difference(
  1. Iterable<T> other
)

Elements in this iterable that are not in other. Uses Object.== and hashCode.

Returns a new list of elements in this iterable not present in other.

Implementation

@useResult
List<T> difference(Iterable<T> other) {
  final Set<T> otherSet = other.toSet();
  return where((T x) => !otherSet.contains(x)).toList();
}