lastOrNull property

T? lastOrNull

Returns the last element, or null if the set is empty.

Implementation

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