Sitelet https://github.com/flutter/flutter/pull/187568
Skip to content

Add dedicated rubber band spring for overscroll recovery in BouncingScrollPhysics - #187568

Merged
auto-submit[bot] merged 11 commits into
flutter:masterfrom
MTtankkeo:bouncing
Sep 15, 2026
Merged

auto-submit[bot] merged 11 commits into
flutter:masterfrom
MTtankkeo:bouncing

Conversation

@MTtankkeo

Copy link
Copy Markdown

Note

Relanding #182426.

Thank you for your review and guidance on the previous PR.

I'm relanding this with the fix for the test failures that caused the issue before. (I've updated the regression test to account for the faster convergence rate of the new physics.)

Fixes #181752
(for detailed analysis, measurements, and discussion, please refer to the original issue.)

This pull request implements a dedicated “rubber band” physics for overscroll snap-back in BouncingScrollPhysics on iOS to better match the native UIScrollView feel.

546867255-4ad56291-9603-40c1-ae5a-3e319017c3c9

Note

This change adjusts spring constants and simulation behavior
to improve iOS scroll fidelity.

Given that this change primarily involves physics parameter tuning,
it may reasonably qualify as test-exempt. However, I am not entirely
certain what level of automated testing would be considered appropriate.

Please let me know if additional tests are expected,
and I am happy to update the PR accordingly.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. labels Jun 4, 2026

@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

This pull request introduces a new rubberBandSpring to BouncingScrollPhysics to simulate iOS-style exponential decay for stationary overscroll releases, updating related tests to reflect faster animation convergence. Feedback on the changes highlights a potential logic regression in createBallisticSimulation where using <= instead of < to define isStationary alters behavior when the velocity is exactly equal to the tolerance threshold.

Comment thread packages/flutter/lib/src/widgets/scroll_physics.dart Outdated
@Piinks
Piinks requested a review from dkwingsmt June 9, 2026 22:21
@MTtankkeo

Copy link
Copy Markdown
Author

@dkwingsmt Hi! Just a friendly bump on this.

This PR relands the iOS overscroll physics change you previously approved, and I've fully fixed the regression test failures mentioned by Piinks.

Could you please take a quick look whenever you have a moment? Thanks!

dkwingsmt
dkwingsmt previously approved these changes Jul 20, 2026

@dkwingsmt dkwingsmt 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. (Sorry for late review!)

@dkwingsmt dkwingsmt added the CICD Run CI/CD label Jul 20, 2026
@dkwingsmt

Copy link
Copy Markdown
Contributor

This PR is identical to the previous PR. Hopefully there are no more analyze errors and we can land it. :)

@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Jul 21, 2026
@github-actions github-actions Bot added the p: cupertino_ui cupertino_ui package in flutter/packages label Jul 21, 2026
@dkwingsmt dkwingsmt added the CICD Run CI/CD label Jul 21, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Jul 22, 2026
@github-actions github-actions Bot added d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos labels Jul 22, 2026
@MTtankkeo

Copy link
Copy Markdown
Author

I updated the stale expectation to match the new overscroll recovery trajectory. No production code was changed, and this appears to have been the only failing test in the shard.

Sorry for the extra review round, and thanks again!

@dkwingsmt dkwingsmt added the CICD Run CI/CD label Jul 22, 2026
@MTtankkeo

Copy link
Copy Markdown
Author

Note

The failure is in packages/flutter_tools/test/commands.shard/hermetic/daemon_test.dart (daemon emulator.getEmulators should respond with list) and appears unrelated to this PR. Please take a look when you have a chance!

dkwingsmt
dkwingsmt previously approved these changes Jul 23, 2026
@dkwingsmt

dkwingsmt commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

The failed daemon test shouldn't be concerning. Probably a flake.

I'm kicking off Google tests.

With the change in the expectation though, this PR is affected by the code freeze. We'll have to evaluate how to land this PR.

@dkwingsmt
dkwingsmt requested a review from victorsanni July 29, 2026 18:12
victorsanni
victorsanni previously approved these changes Jul 31, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Jul 31, 2026
@victorsanni victorsanni added the CICD Run CI/CD label Jul 31, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 9, 2026
dkwingsmt
dkwingsmt previously approved these changes Sep 9, 2026

@dkwingsmt dkwingsmt 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

@dkwingsmt dkwingsmt added the CICD Run CI/CD label Sep 9, 2026
@dkwingsmt dkwingsmt added the override code freeze Override an active code freeze. label Sep 11, 2026
Comment thread packages/flutter/lib/src/widgets/scroll_physics.dart
Comment thread packages/flutter/lib/src/widgets/scroll_physics.dart
Comment thread packages/flutter/test/widgets/scroll_physics_test.dart Outdated
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Sep 14, 2026

@victorsanni victorsanni 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, thanks for the work here.

@dkwingsmt dkwingsmt added the CICD Run CI/CD label Sep 14, 2026
@dkwingsmt dkwingsmt added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 14, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Sep 14, 2026
Merged via the queue into flutter:master with commit 27fec0e Sep 15, 2026
29 of 30 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 15, 2026
chrisbobbe pushed a commit to rajveermalviya/zulip-flutter that referenced this pull request Sep 16, 2026
The velocity comes from the spring solution's `dx(0)`,
so it's zero only up to rounding error.
The exact check happened to pass until upstream changed
the spring used here:
  flutter/flutter#187568

This fixes the failing CI on main:
  https://github.com/zulip/zulip-flutter/actions/runs/35017917623/job/104545944872#step:5:20
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Sep 16, 2026
flutter/flutter@8b3e8f5...27fec0e

2026-09-14 ttankkeo112@gmail.com Add dedicated rubber band spring for overscroll recovery in BouncingScrollPhysics (flutter/flutter#187568)
2026-09-14 engine-flutter-autoroll@skia.org Roll Skia from 83c984a6daf5 to 59904977fcbb (8 revisions) (flutter/flutter#192767)
2026-09-14 34871572+gmackall@users.noreply.github.com Request unbuffered dispatch for platform view motion events after `_PlatformViewGestureRecognizer` rejects gesture (flutter/flutter#192259)
2026-09-14 engine-flutter-autoroll@skia.org Roll Fuchsia GN SDK from ZsxUUK2SfA-TrNvb8... to PDJz3b3CL31uoLOkD... (flutter/flutter#192440)
2026-09-14 codefu@google.com ci(bringup): cleanup some bringup (flutter/flutter#192752)
2026-09-14 kevmoo@users.noreply.github.com Warn users on potential removal of dart:html in dry run (flutter/flutter#192710)
2026-09-14 codefu@google.com docs: migrate design document guidance to flutter/rfc (flutter/flutter#192648)
2026-09-14 154381524+flutteractionsbot@users.noreply.github.com Sync CHANGELOG.md from stable (flutter/flutter#192499)
2026-09-14 engine-flutter-autoroll@skia.org Roll Skia from 7a6fd7ff72d5 to 83c984a6daf5 (1 revision) (flutter/flutter#192745)
2026-09-14 1961493+harryterkelsen@users.noreply.github.com RELAND: [devicelab] Clean up Chrome profile directories and trap abort signals in web benchmarks (flutter/flutter#192655)
2026-09-14 kevmoo@users.noreply.github.com fix(web): hide --web-content-hash until content hashing is complete (flutter/flutter#192663)
2026-09-14 engine-flutter-autoroll@skia.org Roll Skia from 527751088719 to 7a6fd7ff72d5 (2 revisions) (flutter/flutter#192725)
2026-09-14 engine-flutter-autoroll@skia.org Roll Skia from eaf9f82813eb to 527751088719 (1 revision) (flutter/flutter#192722)
2026-09-14 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from AQu85JoTHCMET3Q8G... to 7R1l5MhSZZUr1Q6D1... (flutter/flutter#192719)
2026-09-14 robert.ancell@canonical.com [Linux] Clear the frame when there is nothing to render (flutter/flutter#192461)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC stuartmorgan@google.com,tarrinneal@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
github-actions Bot pushed a commit to zulip/zulip-flutter that referenced this pull request Sep 21, 2026
The velocity comes from the spring solution's `dx(0)`,
so it's zero only up to rounding error.
The exact check happened to pass until upstream changed
the spring used here:
  flutter/flutter#187568

This fixes the failing CI on main:
  https://github.com/zulip/zulip-flutter/actions/runs/35017917623/job/104545944872#step:5:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: cupertino f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. override code freeze Override an active code freeze. p: cupertino_ui cupertino_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal - Missing dedicated "Rubber Band" physics in BouncingScrollPhysics causes low iOS fidelity

4 participants