firstOrNull property

T? get firstOrNull

Returns the first element in the set, or null if the set is empty.

Implementation

T? get firstOrNull => isNotEmpty ? value.first : null;