nonNull property Null safety

Iterable<E> nonNull

Returns a new lazy Iterable with all non-null elements, or an empty iterable if the receiver is null.

See Iterable.where

Implementation

Iterable<E> get nonNull => this?.where((e) => e != null) ?? Iterable.empty();