firstOrNone property

Option<T> get firstOrNone

Returns the first element as a Some, or None if the Iterable is empty.

Implementation

Option<T> get firstOrNone {
  final it = iterator;
  return it.moveNext() ? Some(it.current) : const None();
}