empty method

bool empty()

Returns true if the stack contains no elements.

Example:

final stack = Stack<String>();
print(stack.empty()); // true
stack.push('item');
print(stack.empty()); // false

Implementation

bool empty() {
  return _elements.isEmpty;
}