[material_ui] Fix predictive back transition during CupertinoSheet drag - #12705
Open
huahua8893 wants to merge 1 commit into
Open
[material_ui] Fix predictive back transition during CupertinoSheet drag#12705huahua8893 wants to merge 1 commit into
huahua8893 wants to merge 1 commit into
Conversation
…ged CupertinoSheet PredictiveBackPageTransitionsBuilder and PredictiveBackFullscreenPageTransitionsBuilder chose whether to show the predictive back transition based on route.popGestureInProgress, which is navigator.userGestureInProgress -- true for any user gesture anywhere in the navigator, including dragging a CupertinoSheet that covers the route. That made the covered route incorrectly switch to the predictive back transition while an unrelated sheet was being dragged. Gate on the predictive back phase instead, which is only non-idle while an actual predictive back gesture is in progress.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates PredictiveBackPageTransitionsBuilder and PredictiveBackFullscreenPageTransitionsBuilder to use the predictive back transition only when the transition phase is not idle, replacing the previous check on route.popGestureInProgress. This change prevents a covered route from initiating a predictive back transition while a CupertinoSheet is being dragged. A new widget test has been added to verify this behavior, along with a pending changelog entry. There are no review comments, and I have no feedback to provide.
Closed
10 tasks
Contributor
Author
|
@dkwingsmt @justinmc This is the migrated PR from flutter/flutter#187494. Could you please review the change here? Thank you! |
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.
Ports flutter/flutter#187494 to
material_uifollowing flutter/flutter#188444.Fixes flutter/flutter#187492.
This PR fixes an issue where a route covered by a
CupertinoSheetcould incorrectly enter the predictive back transition during an unrelated navigator gesture, causing its corners to snap to the display corner radius while the sheet was being dragged.PredictiveBackPageTransitionsBuilderandPredictiveBackFullscreenPageTransitionsBuilderpreviously usedroute.popGestureInProgressto determine whether to show the predictive back transition. However, this value is derived fromnavigator.userGestureInProgress, which becomes true for any navigator user gesture, including dragging aCupertinoSheetabove the route.The resulting corner jump is visible on physical Android devices that report display corner radii. When no display corner radius is reported, the fallback value of
BorderRadius.zeromasks the visual symptom. The issue does not occur on iOS because it usesCupertinoPageTransitionsBuilder.This change uses the predictive back phase instead, so a covered route only enters the predictive back transition during an actual system back gesture. It also adds regression coverage for both predictive back transition builders.
Tests
flutter test test/predictive_back_page_transitions_builder_test.dart --no-pubdart run script/tool/bin/flutter_plugin_tools.dart analyze --packages material_uidart run script/tool/bin/flutter_plugin_tools.dart validate --packages material_ui --base-sha=9854cd5607da4001f2dd3cbdcd6903202d28958c --check-for-missing-changesdart run script/tool/bin/flutter_plugin_tools.dart publish-check --packages material_uiPre-Review Checklist
[shared_preferences]///).Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2