whereNotIn method

List<T> whereNotIn(
  1. String key,
  2. List<num> params
)

Removes elements from the list that have a specified item value

that is not contained within the given list

Example:

list.whereNotIn("key", [value1, value2])

Implementation

List<T> whereNotIn(String key, List<num> params) {
  if (isEmpty) {
    return <T>[];
  }
  final List<T> result = toList();
  for (final num param in params) {
    result.removeWhere(
      (T map) =>
          map is Map<String, T> && map.containsKey(key) && map[key] == param,
    );
  }
  return result;
}