这是indexloc提供的服务,不要输入任何密码
Skip to content

Build routes even less #58202

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 1 commit into from
Jun 12, 2020
Merged

Conversation

Hixie
Copy link
Contributor

@Hixie Hixie commented May 28, 2020

No description provided.

@fluttergithubbot fluttergithubbot added the framework flutter/packages/flutter repository. See also f: labels. label May 28, 2020
@Hixie
Copy link
Contributor Author

Hixie commented Jun 1, 2020

cc @chunhtai

Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the optimization!

final List<String> log = <String>[];
Route<dynamic> nextRoute = PageRouteBuilder<int>(
pageBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
log.add('building page 1 - ${ModalRoute.of(context).canPop}');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we care about can pop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It used to change value (that's why the pages rebuilt, basically). This is mostly making sure that it isn't rebuilding even if it's changing value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I understand, the doc string of canPop does mention it should rebuild when the value changes

/// When this changes, the route will rebuild, and any widgets that used

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I should update those docs. Good catch!

@Hixie Hixie force-pushed the build-routes-less branch from 6058f80 to f12d306 Compare June 11, 2020 22:49
@Hixie
Copy link
Contributor Author

Hixie commented Jun 11, 2020

Docs updated, PTAL.

Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fluttergithubbot fluttergithubbot merged commit 38c33d9 into flutter:master Jun 12, 2020
renyou added a commit that referenced this pull request Jun 15, 2020
zljj0818 pushed a commit to zljj0818/flutter that referenced this pull request Jun 22, 2020
zljj0818 pushed a commit to zljj0818/flutter that referenced this pull request Jun 22, 2020
@Hixie Hixie mentioned this pull request Jul 30, 2020
Hixie added a commit to Hixie/flutter that referenced this pull request Aug 2, 2020
This reverts commit deec88b (PR
flutter#59415.

This was originally landed via PR flutter#58202.
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants