firstOrNull property

E? get firstOrNull

Returns the first element, or null if this iterable is empty.

Implementation

E? get firstOrNull => isEmpty ? null : first;