We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_addRawLog(Log log) { ... if (log.type == LogType.error) { _hasError = true; _emit(FlowLogEvent.error, this); } else { _emit(FlowLogEvent.log, this); } this.logs!.add(log); ... }
The 'newLog' event will be emitted before it is added to the logs, which means the listener has no way to know the content of the latest log.
I think it's better to move the _emit part after this.logs!.add(log), so the listener is able to access the latest log by using logs[logs.length - 1]
_emit
this.logs!.add(log)
logs[logs.length - 1]
Also, it is possible to change List<Log>? logs to List<Log> logs by giving a default [], so we don't need to do null-check elsewhere.
List<Log>? logs
List<Log> logs
[]
The text was updated successfully, but these errors were encountered:
zmtzawqlp
No branches or pull requests
Content
The 'newLog' event will be emitted before it is added to the logs, which means the listener has no way to know the content of the latest log.
I think it's better to move the
_emit
part afterthis.logs!.add(log)
, so the listener is able to access the latest log by usinglogs[logs.length - 1]
Also, it is possible to change
List<Log>? logs
toList<Log> logs
by giving a default[]
, so we don't need to do null-check elsewhere.The text was updated successfully, but these errors were encountered: