firstOrNull property

T? get firstOrNull

The first element of this iterator, or null if the iterable is empty.

Implementation

T? get firstOrNull {
  var iterator = this.iterator;
  if (iterator.moveNext()) return iterator.current;
  return null;
}