firstOrNull property
T?
get
firstOrNull
Returns null instead of throwing if the list is empty.
Implementation
T? get firstOrNull => isEmpty ? null : first;
Returns null instead of throwing if the list is empty.
T? get firstOrNull => isEmpty ? null : first;