nullFreeIterable method

Iterable<E> nullFreeIterable({
  1. E? replaceWith = null,
})

Iterable-returning counterpart of nullFree. Consult nullFree for further documentation.

Implementation

Iterable<E> nullFreeIterable({E? replaceWith = null}) => replaceWith == null
    ? where((element) => element != null)
    : map((e) => e ?? replaceWith);