getAndRemoveFirstError method Null safety

UserException? getAndRemoveFirstError()

Gets the first error from the error queue, and removes it from the queue.

Implementation

UserException? getAndRemoveFirstError() => (_errors.isEmpty)
    ? //
    null
    : _errors.removeFirst();