Repository navigation
Ballistic scrolling broken if there are items with different heights #24715
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: qualityA truly polished experienceA truly polished experiencef: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 1.21Found to occur in 1.21Found to occur in 1.21frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
Code to reproduce: main.dart.zip
The problem, as far as I can tell, is caused by RenderSliverList max scroll offset estimation changes during scrolling resulting in ScrollPosition.applyContentDimensions triggering unnecessary new ballistic activities.
Btw. Flutter Gallery License View seems to suffer from same issue.
[✓] Flutter (Channel master, v0.11.10-pre.3, on Mac OS X 10.14 18A389, locale en-US)
• Flutter version 0.11.10-pre.3 at /Users/Matej/Projects/flutter/flutter
• Framework revision 06e4ccc9a9 (8 hours ago), 2018-11-25 04:55:23 -0500
• Engine revision 99e73d8c64
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
• ios-deploy 1.9.4
• CocoaPods version 1.5.3
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
[!] IntelliJ IDEA Community Edition (version 2018.2.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.io/intellij-setup/#installing-the-plugins
[✓] VS Code (version 1.29.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.20.0
[✓] Connected device (2 available)
• Matej’s iPhone X • f7e7ead1f9b5f3e2574cfbd9bc264fbcd5772a6c • ios • iOS 12.1
• iPhone 5s • 824BB8C4-B563-40E4-9632-B8393A91C531 • ios • iOS 12.1 (simulator)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: qualityA truly polished experienceA truly polished experiencef: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 1.21Found to occur in 1.21Found to occur in 1.21frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version

Activity
knopp commentedon Nov 26, 2018
The stack trace from #11599 seems relevant.
goBallisticcalls are triggered every time viewport size estimation chages (which is frequent with uneven rows) and eachgoBallisticcall brings scrolling to premature stop.VladyslavBondarenko commentedon Apr 2, 2020
Persists with
de v1.16.4-pre.33VladyslavBondarenko commentedon Jul 27, 2020
Persists with current master
1.21.0-6.0.pre.38flutter doctor -v
code sample
knopp commentedon Aug 29, 2020
I'm not sure how useful it is, but I've been using this approach to fix it for a while. Might not be perfect but it works much better than the default behavior.
Hixie commentedon Aug 29, 2020
Do we need to restart the ballistic scroll at all when the dimensions change?
nt4f04uNd commentedon Dec 18, 2021
I think this particular bug was fixed by #59623, I cannot longer reproduce it. The fix in this PR seems to be more a workaround of a bug in #11599, but it works out.
github-actions commentedon Jan 1, 2022
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.