popBack method

void popBack()

Removes the last element from the vector.

Guarantees memory safety by throwing a StateError if the vector is empty.

Implementation

void popBack() {
  if (_data.isEmpty) {
    throw StateError('Cannot popBack from an empty vector');
  }
  _data.removeLast();
}