last method

Option<T> last()

Returns the last element of an iterator, None if empty.

Implementation

Option<T> last() {
  final last = _list.lastOrNull;
  if (last == null) {
    return None;
  }
  return Some(last);
}