whereNotNull method

List<T> whereNotNull()

Returns a new list with every null element removed.

Implementation

List<T> whereNotNull() => [
      for (final element in this)
        if (element != null) element
    ];