first property Null safety

E first
override

Returns the next element that will be returned by removeFirst.

The element is not removed from the queue.

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

Implementation

@override
E get first {
  if (_length == 0) throw StateError('No element');
  return _elementAt(0);
}