firstOrOption property

Option<T> get firstOrOption

Returns the first element of an iterator, None if empty.

Implementation

Option<T> get firstOrOption {
  final first = _list.firstOrNull;
  if (first == null) {
    return None;
  }
  return Some(first);
}