lastOption property

Option<T> get lastOption

Returns the last element as an Option. If the list is empty, it will return None.

Implementation

Option<T> get lastOption => isEmpty ? kNone : some(last);