lastOrNull property

T? lastOrNull

Returns the last or null when the collection is empty

Implementation

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