pop method

T pop()

get the top of the stack and delete it.

Implementation

T pop() {
  if (isEmpty) {
    throw IllegalOperationException(
      'Can\'t use pop with empty stack\n consider '
      'checking for size or isEmpty before calling pop',
    );
  }
  T res = _list.last;
  _list.removeLast();
  return res;
}