back method

T back()

Retrieves the last element of the list. Throws a StateError if the list is empty.

Implementation

T back() {
  if (_tail == null) {
    throw StateError('Cannot get back of an empty SList');
  }
  return _tail!.value;
}