pull<T> function

void pull<T>(
  1. Iterable<T> list,
  2. Iterable<T> values
)

删除List中在 values中出现的值

Implementation

void pull<T>(Iterable<T> list, Iterable<T> values) {
  Set<T> tset = Set.from(values);
  if (list is List) {
    (list as List).removeWhere((e) => tset.contains(e));
    return;
  }
  if (list is Set) {
    (list as Set).removeWhere((e) => tset.contains(e));
    return;
  }
  throw FlutterError('只支持传入Set Or List');
}