removeLast method Null safety

E removeLast()
override

Removes and returns the last element of the queue.

The queue must not be empty when this method is called.

Implementation

E removeLast() {
  // Hits sentinel's `_remove` if queue is empty.
  E result = _sentinel._previousLink!._remove();
  _elementCount--;
  return result;
}