Page-subclasses to take children instead of builder#66694
Merged
fluttergithubbot merged 2 commits intoflutter:masterfrom Sep 27, 2020
Merged
Page-subclasses to take children instead of builder#66694fluttergithubbot merged 2 commits intoflutter:masterfrom
fluttergithubbot merged 2 commits intoflutter:masterfrom
Conversation
Contributor
|
internal test failure, looks like some projects have started using the materialPage class. |
Member
Author
|
cl/334055440 fixes google testing for this PR. |
goderbauer
added a commit
to goderbauer/flutter
that referenced
this pull request
Sep 28, 2020
christopherfujino
pushed a commit
to chris-forks/flutter
that referenced
this pull request
Sep 28, 2020
christopherfujino
added a commit
that referenced
this pull request
Sep 29, 2020
* [Icons][iOS] Pointing to version of material icon font that includes more metadata in the xml. (#66684) * apply engine cherrypicks * Page-subclasses to take children instead of builder (#66694) * Update pub dependencies to support dart 2.10.0 * cherry-pick 76ad864 * Fix the inconsistency between the local state of the input and the engine state (#65754) Co-authored-by: Will Larche <[email protected]> Co-authored-by: Michael Goderbauer <[email protected]> Co-authored-by: xubaolin <[email protected]>
|
What should we use in place of |
Member
Author
|
You can define your own Page subclass that in createRoute returns a |
willlockwood
pushed a commit
to willlockwood/flutter
that referenced
this pull request
Dec 25, 2020
* [Icons][iOS] Pointing to version of material icon font that includes more metadata in the xml. (flutter#66684) * apply engine cherrypicks * Page-subclasses to take children instead of builder (flutter#66694) * Update pub dependencies to support dart 2.10.0 * cherry-pick 76ad864 * Fix the inconsistency between the local state of the input and the engine state (flutter#65754) Co-authored-by: Will Larche <[email protected]> Co-authored-by: Michael Goderbauer <[email protected]> Co-authored-by: xubaolin <[email protected]>
thanhle1547
added a commit
to thanhle1547/flutter_simple_app_router
that referenced
this pull request
Jul 18, 2025
…d of a builder function to not delay widget creation related: flutter/flutter#66694
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Prior to this change, the MaterialPage and CupertinoPage would take a builder, which was a footgun:
When the second page is transitioning out,
_subpageis set to null. Because the Navigator is rebuild, it would rebuild all its routes as well with that the builder of the second executes again, rebuilding itself with_subpage == null, which is not what people want.This PR changes the API of CupertinoPage and MaterialPage. Instead of taking a builder, it takes a prebuild child widget to avoid this problem.
This PR also removes the CustomBuilderPage and TransitionBuilderPage. We can come up with a version of them that doesn't rely on builders in the future.
Related Issues
Fixes #66695.
Tests
I added the following tests:
Checklist
Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.