pop method

T pop()

Removes and returns the top element from the stack. Throws a StateError if the stack is empty.

Implementation

T pop() {
  if (empty) {
    throw StateError('Cannot pop from an empty Stack');
  }
  return _container.deleteLast();
}