Skip to content

Add displayCornerRadii support to predictive back transitions.#181326

Merged
auto-submit[bot] merged 10 commits into
flutter:masterfrom
ksokolovskyi:update-predictive-back-transition-to-use-display-corner-radii
Mar 6, 2026
Merged

Add displayCornerRadii support to predictive back transitions.#181326
auto-submit[bot] merged 10 commits into
flutter:masterfrom
ksokolovskyi:update-predictive-back-transition-to-use-display-corner-radii

Conversation

@ksokolovskyi

Copy link
Copy Markdown
Contributor

Closes #178463

  • Adds support of MediaQuery.displayCornerRadii to PredictiveBackPageTransitionsBuilder
  • Adds support of MediaQuery.displayCornerRadii to PredictiveBackFullscreenPageTransitionsBuilder

Pre-launch Checklist

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jan 22, 2026
@ksokolovskyi ksokolovskyi requested a review from justinmc January 22, 2026 15:37

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

The pull request successfully integrates MediaQuery.displayCornerRadii into PredictiveBackPageTransitionsBuilder and PredictiveBackFullscreenPageTransitionsBuilder. The changes ensure that if display corner radii are available from the MediaQuery, they are used for ClipRRect widgets, otherwise a fallback value is applied. The comments have been updated to reflect this new behavior, and a comprehensive test case has been added to verify the functionality, especially for Android platforms. The code is clean and follows the established patterns for Flutter widgets.


// Only Android supports backGesture channel methods. Other platforms will
// do nothing.
if (defaultTargetPlatform != TargetPlatform.android) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we instead use the variant of the test to tweak this? I.e. have an Android only test and a test for the other platforms

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Or we could only run this test on Android. I think that above this line, the test is not testing anything relevant to the displayCornerRadii feature, it's testing stuff that is already tested elsewhere.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

True, my point was that we can leverage the variant, instead of putting a return in the middle of the test :p

@justinmc justinmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Surprisingly straightforward change now that #179219 is done. Thank you @ksokolovskyi for following up here! I'm really excited to fix this. LGTM 👍


// Only Android supports backGesture channel methods. Other platforms will
// do nothing.
if (defaultTargetPlatform != TargetPlatform.android) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Or we could only run this test on Android. I think that above this line, the test is not testing anything relevant to the displayCornerRadii feature, it's testing stuff that is already tested elsewhere.

@ksokolovskyi

Copy link
Copy Markdown
Contributor Author

@navaronbracke @justinmc thanks a lot for your reviews!

I've removed the variant: TargetPlatformVariant.all() and defaultTargetPlatform != TargetPlatform.android from the test, as I don't see any point in their usage.

In the test, we set the PredictiveBackPageTransition for all platforms and mock the platform channel, so there is no need to actually check for defaultTargetPlatform, as with that setup, PredictiveBackPageTransition will work for any targetPlatform.

@ksokolovskyi

Copy link
Copy Markdown
Contributor Author

Hi @justinmc @navaronbracke, could you please take another look at this PR when you have time? Thanks!

@ksokolovskyi

Copy link
Copy Markdown
Contributor Author

@justinmc could you please review this PR one more time?

@ksokolovskyi ksokolovskyi requested review from justinmc and removed request for justinmc March 5, 2026 08:41

@justinmc justinmc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@justinmc justinmc added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 6, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Mar 6, 2026
Merged via the queue into flutter:master with commit f57ed5c Mar 6, 2026
74 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 6, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 8, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 8, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 9, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Mar 9, 2026
flutter/flutter@d182143...2ec61af

2026-03-08 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from P9D6h4D2ks99Ct7TO... to giLoee6arX5CRHuRh... (flutter/flutter#183366)
2026-03-07 engine-flutter-autoroll@skia.org Roll Skia from 6643c1bd93bb to af994ae4d990 (1 revision) (flutter/flutter#183359)
2026-03-07 34465683+rkishan516@users.noreply.github.com refactor: remove material import from animated_cross_fade, physical_model_test, pinned_header_sliver_test, spell_check_test (flutter/flutter#183234)
2026-03-07 engine-flutter-autoroll@skia.org Roll Skia from a69ef43650ee to 6643c1bd93bb (13 revisions) (flutter/flutter#183346)
2026-03-07 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#183344)
2026-03-07 engine-flutter-autoroll@skia.org Roll Dart SDK from 0c24edc41e09 to 1604910613c7 (2 revisions) (flutter/flutter#183342)
2026-03-07 engine-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from nR2ESa1Gd8yPcWo06... to R2EllDf4DgBXVNuiN... (flutter/flutter#183341)
2026-03-07 97480502+b-luk@users.noreply.github.com Support BGRA textures in BlitCopyTextureToBufferCommandGLES::Encode and fix improper mapping of BGRA to RGBA in blit_command_gles and texture_gles (flutter/flutter#182397)
2026-03-06 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 8ay15_eQOEgPHCypm... to P9D6h4D2ks99Ct7TO... (flutter/flutter#183329)
2026-03-06 41930132+hellohuanlin@users.noreply.github.com [doc]add discord channel to ios triage meeting (flutter/flutter#183285)
2026-03-06 engine-flutter-autoroll@skia.org Roll Dart SDK from 7c7c1e3d024d to 0c24edc41e09 (2 revisions) (flutter/flutter#183328)
2026-03-06 43054281+camsim99@users.noreply.github.com Revert "Make HCPP upgrading work for vd/tlhc (#181024)" (flutter/flutter#183310)
2026-03-06 stuartmorgan@google.com Add AI contribution guidelines (flutter/flutter#183326)
2026-03-06 jason-simmons@users.noreply.github.com [Impeller] Do not wait for a frame's acquire fence if the frame was never presented (flutter/flutter#183288)
2026-03-06 jacksongardner@google.com Add back in accidentally removed line from `create_updated_flutter_deps.py` (flutter/flutter#183314)
2026-03-06 matt.boetger@gmail.com Fix typo in README (flutter/flutter#183245)
2026-03-06 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#183319)
2026-03-06 sokolovskyi.konstantin@gmail.com Add displayCornerRadii support to predictive back transitions. (flutter/flutter#181326)
2026-03-06 34465683+rkishan516@users.noreply.github.com refactor: remove material from widget_inspector_test, sliver_cross_axis_group_test, editable_text_show_on_screen_test, scrollable_fling_test, selection_container_test (flutter/flutter#182702)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
xxxOVALxxx pushed a commit to xxxOVALxxx/flutter that referenced this pull request Mar 10, 2026
…er#181326)

Closes flutter#178463

- Adds support of `MediaQuery.displayCornerRadii` to
`PredictiveBackPageTransitionsBuilder`
- Adds support of `MediaQuery.displayCornerRadii` to
`PredictiveBackFullscreenPageTransitionsBuilder`

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
okorohelijah pushed a commit to okorohelijah/packages that referenced this pull request Mar 26, 2026
…r#11202)

flutter/flutter@d182143...2ec61af

2026-03-08 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from P9D6h4D2ks99Ct7TO... to giLoee6arX5CRHuRh... (flutter/flutter#183366)
2026-03-07 engine-flutter-autoroll@skia.org Roll Skia from 6643c1bd93bb to af994ae4d990 (1 revision) (flutter/flutter#183359)
2026-03-07 34465683+rkishan516@users.noreply.github.com refactor: remove material import from animated_cross_fade, physical_model_test, pinned_header_sliver_test, spell_check_test (flutter/flutter#183234)
2026-03-07 engine-flutter-autoroll@skia.org Roll Skia from a69ef43650ee to 6643c1bd93bb (13 revisions) (flutter/flutter#183346)
2026-03-07 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#183344)
2026-03-07 engine-flutter-autoroll@skia.org Roll Dart SDK from 0c24edc41e09 to 1604910613c7 (2 revisions) (flutter/flutter#183342)
2026-03-07 engine-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from nR2ESa1Gd8yPcWo06... to R2EllDf4DgBXVNuiN... (flutter/flutter#183341)
2026-03-07 97480502+b-luk@users.noreply.github.com Support BGRA textures in BlitCopyTextureToBufferCommandGLES::Encode and fix improper mapping of BGRA to RGBA in blit_command_gles and texture_gles (flutter/flutter#182397)
2026-03-06 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 8ay15_eQOEgPHCypm... to P9D6h4D2ks99Ct7TO... (flutter/flutter#183329)
2026-03-06 41930132+hellohuanlin@users.noreply.github.com [doc]add discord channel to ios triage meeting (flutter/flutter#183285)
2026-03-06 engine-flutter-autoroll@skia.org Roll Dart SDK from 7c7c1e3d024d to 0c24edc41e09 (2 revisions) (flutter/flutter#183328)
2026-03-06 43054281+camsim99@users.noreply.github.com Revert "Make HCPP upgrading work for vd/tlhc (#181024)" (flutter/flutter#183310)
2026-03-06 stuartmorgan@google.com Add AI contribution guidelines (flutter/flutter#183326)
2026-03-06 jason-simmons@users.noreply.github.com [Impeller] Do not wait for a frame's acquire fence if the frame was never presented (flutter/flutter#183288)
2026-03-06 jacksongardner@google.com Add back in accidentally removed line from `create_updated_flutter_deps.py` (flutter/flutter#183314)
2026-03-06 matt.boetger@gmail.com Fix typo in README (flutter/flutter#183245)
2026-03-06 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#183319)
2026-03-06 sokolovskyi.konstantin@gmail.com Add displayCornerRadii support to predictive back transitions. (flutter/flutter#181326)
2026-03-06 34465683+rkishan516@users.noreply.github.com refactor: remove material from widget_inspector_test, sliver_cross_axis_group_test, editable_text_show_on_screen_test, scrollable_fling_test, selection_container_test (flutter/flutter#182702)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
mboetger pushed a commit to mboetger/flutter that referenced this pull request Mar 26, 2026
…er#181326)

Closes flutter#178463

- Adds support of `MediaQuery.displayCornerRadii` to
`PredictiveBackPageTransitionsBuilder`
- Adds support of `MediaQuery.displayCornerRadii` to
`PredictiveBackFullscreenPageTransitionsBuilder`

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
ahmedsameha1 pushed a commit to ahmedsameha1/flutter that referenced this pull request Apr 14, 2026
…er#181326)

Closes flutter#178463

- Adds support of `MediaQuery.displayCornerRadii` to
`PredictiveBackPageTransitionsBuilder`
- Adds support of `MediaQuery.displayCornerRadii` to
`PredictiveBackFullscreenPageTransitionsBuilder`

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…r#11202)

flutter/flutter@d182143...2ec61af

2026-03-08 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from P9D6h4D2ks99Ct7TO... to giLoee6arX5CRHuRh... (flutter/flutter#183366)
2026-03-07 engine-flutter-autoroll@skia.org Roll Skia from 6643c1bd93bb to af994ae4d990 (1 revision) (flutter/flutter#183359)
2026-03-07 34465683+rkishan516@users.noreply.github.com refactor: remove material import from animated_cross_fade, physical_model_test, pinned_header_sliver_test, spell_check_test (flutter/flutter#183234)
2026-03-07 engine-flutter-autoroll@skia.org Roll Skia from a69ef43650ee to 6643c1bd93bb (13 revisions) (flutter/flutter#183346)
2026-03-07 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#183344)
2026-03-07 engine-flutter-autoroll@skia.org Roll Dart SDK from 0c24edc41e09 to 1604910613c7 (2 revisions) (flutter/flutter#183342)
2026-03-07 engine-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from nR2ESa1Gd8yPcWo06... to R2EllDf4DgBXVNuiN... (flutter/flutter#183341)
2026-03-07 97480502+b-luk@users.noreply.github.com Support BGRA textures in BlitCopyTextureToBufferCommandGLES::Encode and fix improper mapping of BGRA to RGBA in blit_command_gles and texture_gles (flutter/flutter#182397)
2026-03-06 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 8ay15_eQOEgPHCypm... to P9D6h4D2ks99Ct7TO... (flutter/flutter#183329)
2026-03-06 41930132+hellohuanlin@users.noreply.github.com [doc]add discord channel to ios triage meeting (flutter/flutter#183285)
2026-03-06 engine-flutter-autoroll@skia.org Roll Dart SDK from 7c7c1e3d024d to 0c24edc41e09 (2 revisions) (flutter/flutter#183328)
2026-03-06 43054281+camsim99@users.noreply.github.com Revert "Make HCPP upgrading work for vd/tlhc (#181024)" (flutter/flutter#183310)
2026-03-06 stuartmorgan@google.com Add AI contribution guidelines (flutter/flutter#183326)
2026-03-06 jason-simmons@users.noreply.github.com [Impeller] Do not wait for a frame's acquire fence if the frame was never presented (flutter/flutter#183288)
2026-03-06 jacksongardner@google.com Add back in accidentally removed line from `create_updated_flutter_deps.py` (flutter/flutter#183314)
2026-03-06 matt.boetger@gmail.com Fix typo in README (flutter/flutter#183245)
2026-03-06 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#183319)
2026-03-06 sokolovskyi.konstantin@gmail.com Add displayCornerRadii support to predictive back transitions. (flutter/flutter#181326)
2026-03-06 34465683+rkishan516@users.noreply.github.com refactor: remove material from widget_inspector_test, sliver_cross_axis_group_test, editable_text_show_on_screen_test, scrollable_fling_test, selection_container_test (flutter/flutter#182702)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android's predictive back feature doesn't use the device's corner radius

3 participants