lastOrNull property
TValue?
lastOrNull
Returns the last element of the iterable if not empty, null otherwise.
Implementation
TValue? get lastOrNull => isNotEmpty ? last : null;
Returns the last element of the iterable if not empty, null otherwise.
TValue? get lastOrNull => isNotEmpty ? last : null;