exclude method

List<T> exclude(
  1. Iterable<T> subset
)

Returns a new list containing all of the elements in this list that aren't also contained within subset.

Implementation

List<T> exclude(Iterable<T> subset) {
  final elements = <T>[];
  for (var element in this) {
    if (!subset.contains(element)) elements.add(element);
  }
  return elements;
}