-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Page-subclasses to take children instead of builder #66694
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
Merged
Merged
Conversation
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
chunhtai
approved these changes
Sep 25, 2020
Contributor
chunhtai
left a comment
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
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 <larche@google.com> Co-authored-by: Michael Goderbauer <goderbauer@google.com> Co-authored-by: xubaolin <xubaolin@oppo.com>
|
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 <larche@google.com> Co-authored-by: Michael Goderbauer <goderbauer@google.com> Co-authored-by: xubaolin <xubaolin@oppo.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
f: cupertino
flutter/packages/flutter/cupertino repository
f: material design
flutter/packages/flutter/material repository.
framework
flutter/packages/flutter repository. See also f: labels.
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.