firstOrOption method
Returns the first element of an iterator, None if empty.
Implementation
@pragma('vm:prefer-inline')
Option<T> firstOrOption() {
final first = firstOrNull;
if (first == null) {
return None;
}
return Some(first);
}
Returns the first element of an iterator, None if empty.
@pragma('vm:prefer-inline')
Option<T> firstOrOption() {
final first = firstOrNull;
if (first == null) {
return None;
}
return Some(first);
}