Improve implementation around widget management #13818
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What it does
Mainly, this PR ensures that any widget promises returned by the
WidgetManager
will only resolve when the entire widget creation process has completed successfully, including the 'onWillCreateWidget` part.(Prior to the fix, some widget promises returned by the
WidgetManager
could resolve as soon as the widget was created by its factory, which did not take into account the other parts of the widget creation process, such as the 'onWillCreateWidget' part.)How to test
This PR is intended to be verified mainly by code inspection, but it is important to make sure that no regressions are introduced: all tests should still pass, and everything related to widget management should still work normally.
Review checklist
Reminder for reviewers