-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Migrate flutter_manifest to null safety #80392
New issue
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
Conversation
This library has a lot of casts, so a close review would be appreciated. |
List<DeferredComponent> get deferredComponents => _deferredComponents ??= computeDeferredComponents(); | ||
List<DeferredComponent> _deferredComponents; | ||
List<DeferredComponent> computeDeferredComponents() { | ||
List<DeferredComponent>? get deferredComponents => _deferredComponents ??= computeDeferredComponents(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably fine, but its a little weird to do the _deferredComponents ??=
trick on a field that could be nullable. Instead, you could make this late final
(which lacks many of the problems of regular late:
late final deferredComponents = computeDeferredComponents();
Then computeDeferredComponents
will only ever run once, even if it is null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, late final
. Good call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might be able to simplify some of the casting or improve the safety by changing all usage of dynamic
to Object?
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👻
We're at the mercy of |
That is if you use |
This pull request is not suitable for automatic merging in its current state.
|
Sorry, I forgot this wasn't approved yet. Thanks bot bro! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Part of #71511