-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Will pop scope on home route #152057
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
Will pop scope on home route #152057
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
reidbaker
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.
Can you please add to the documentation here https://docs.flutter.dev/release/breaking-changes/android-predictive-back
To let users know that widgets can impact if predictive back is enabled? This pr feels like an improvement but one that would be confusing to debug if you were getting unexpected behavior.
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
|
Website update PR: flutter/website#10928 |
|
And we should probably mention this here too: #152116 @reidbaker |
Make it clear that using WillPopScope does not support predictive back. In flutter/flutter#152057 (review) it was mentioned that this should be explicitly communicated in this breaking changes page. _Issues fixed by this PR (if any):_ n/a _PRs or commits this PR depends on (if any):_ flutter/flutter#152057 ## Presubmit checklist - [x] This PR is marked as draft with an explanation if not meant to land until a future stable release. - [x] This PR doesn’t contain automatically generated corrections (Grammarly or similar). - [x] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style) — for example, it doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person). - [x] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer. --------- Co-authored-by: Shams Zakhour (ignore Sfshaza) <[email protected]>
Clearly explains that WillPopScope will break predictive back support. Came up in #152057 (review).
Fixes a bug where WillPopScope no longer worked on the home route. With this PR, Android's predictive back feature will be explicitly disabled when a WillPopScope widget is in the widget tree. To get the same behavior and still support predictive back, use PopScope.
…152116) Clearly explains that WillPopScope will break predictive back support. Came up in flutter#152057 (review).
Fixes a bug where WillPopScope no longer worked on the home route. With this PR, Android's predictive back feature will be explicitly disabled when a WillPopScope widget is in the widget tree. To get the same behavior and still support predictive back, use PopScope.
…152116) Clearly explains that WillPopScope will break predictive back support. Came up in flutter#152057 (review).
In the transition to PopScope, WillPopScope.onWillPop was broken when used on a root route. This PR fixes it by disabling predictive back whenever a WillPopScope is in the widget tree. It's not possible for WillPopScope to work with predictive back, so I think it's fair to disable it. Better to turn off predictive back than to quietly break WillPopScope.
Anyone that wants predictive back support should migrate to PopScope.
Fixes #151432