copyAllExcept<T> static method

List<T> copyAllExcept<T>(
  1. List<T> original,
  2. bool exclude(
    1. T t
    )
)

Implementation

static List<T> copyAllExcept<T>(
    List<T> original, bool Function(T t) exclude) {
  var newList = <T>[];
  for (var element in original) {
    if (!exclude(element)) newList.add(element);
  }
  return newList;
}