singleOrOption method

Option<T> singleOrOption()

Returns the single element of an iterator, None if this is empty or has more than one element.

Implementation

@pragma('vm:prefer-inline')
Option<T> singleOrOption() => Option.from(singleOrNull);