copyWithRemovedItems method

List<T> copyWithRemovedItems(
  1. Iterable<T> itemsToRemove
)

Returns a copy with all specified items removed

Implementation

List<T> copyWithRemovedItems(Iterable<T> itemsToRemove) {
  if (itemsToRemove.isEmpty) return List.of(this);
  final toRemove = itemsToRemove.toSet();
  return where((e) => !toRemove.contains(e)).toList();
}