withOut<T> function

List<T> withOut<T>(
  1. Iterable<T> list,
  2. Iterable<T> values
)

创建一个剔除所有给定值的新数组

Implementation

List<T> withOut<T>(Iterable<T> list, Iterable<T> values) {
  Set<T> tset = Set.from(values);
  List<T> rl = [];
  for (var e in list) {
    if (!tset.contains(e)) {
      rl.add(e);
    }
  }
  return rl;
}