nullIfEmpty property

Queue<T>? get nullIfEmpty

Returns null if the Queue is empty, otherwise returns the Queue.

Implementation

Queue<T>? get nullIfEmpty {
  return isEmpty ? null : this;
}