lastOrNull property

T? get lastOrNull

Returns the last item in the list, or null if empty.

Implementation

T? get lastOrNull => value.isEmpty ? null : value.last;