firstOrNull property

T? firstOrNull

Returns the first element, or null if the list is empty.

Implementation

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