clear method

void clear()

removes all elements from the stack

Implementation

void clear() {
  while (isNotEmpty) {
    _list.removeLast();
  }
}