firstOrNull property

T? get firstOrNull

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

Implementation

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