firstOrNull property

E? firstOrNull

Returns the first element or null if this is empty.

Implementation

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