filterNot method

List<T> filterNot(
  1. bool test(
    1. T element
    )
)

Returns a list containing all elements not matching the given predicate and will filter nulls as well.

Implementation

List<T> filterNot(bool test(T element)) {
  final result = <T>[];
  forEach((e) {
    if (e != null && !test(e)) {
      result.add(e);
    }
  });
  return result;
}