firstOrNull property

T? get firstOrNull

Returns first element or null otherwise

Implementation

T? get firstOrNull => isNullOrEmpty() ? null : this!.first;