whereNotNullSync method

Iterable<FutureOr<T?>> whereNotNullSync()

Selects the non-null elements T of this iterable.

Note that Future with null values won't be identified as null elements, since they are not resolved yet.

Implementation

Iterable<FutureOr<T?>> whereNotNullSync() sync* {
  for (var element in this) {
    if (element != null) {
      yield element;
    }
  }
}