addError method
Reports an error
which triggers onError
with an optional StackTrace.
Implementation
@protected
@mustCallSuper
@override
void addError(Object error, [StackTrace? stackTrace]) {
onError(error, stackTrace ?? StackTrace.current);
}