tryFirst property

E? get tryFirst

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

Implementation

E? get tryFirst => isNotEmpty ? first : null;