lastOrNull property

T? get lastOrNull

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

Implementation

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