Repository navigation
Description
Current Behavior
The current implementation of BouncingScrollPhysics feels somewhat 'slippery' when compared to the native iOS scroll physics. I tested the scroll behavior with the scroll_overlay app and made the following observations:
- iOS only triggers a ScrollSimulation when it's velocity is > 83.0
- iOS friction simulation uses more friction
- iOS friction simulation is started at a slightly lower velocity
- iOS velocity acceleration (carriedMomentum) for accumulated scrolling significantly stronger than in Flutter. I was able to scroll to the end of the native list while the Flutter list barely made it to ListTile no. 400.
- Overscroll bounce simulation in iOS is exponential, not logistic as in the current implementation of BouncingScrollSimulation
Note: It seems that the iOS platform view exposes the scroll velocity in a larger unit
Quick Fix
- Decrease FrictionSimulation drag to 0.126
- Increase minFlingVelocity to 241.0
These changes will not mimic the iOS behavior perfectly but address the scroll fidelity to a degree that makes for an overall noticeably improved scrolling experience. Perhaps, also adding a configuration option for a fast and a normal deceleration rate as in the UIScrollView class from UIKit might be a way to go.
I'm not sure whether these changes should be added to the Framework provisionally or if you would like to wait for a more permanent solution to fix the issue. I mainly wanted to spark a conversation about the iOS scrolling physics in Flutter, as, while the differences are subtle, they are still noticeable in specific scenarios.
Activity
maheshj01 commentedon May 16, 2022
Hi @LucasAschenbach, Thanks for filing the issue. Would it be possible for you to show the "slippery" bouncing effect in comparison with a native IOS app (in the form of video) to understand it better? Please also share the output of
flutter doctor -v.LucasAschenbach commentedon May 16, 2022
The following screen recordings capture the screen_overlay app and the default physics configurations.
RPReplay_Final1652707649.MP4
RPReplay_Final1652708118.MP4
RPReplay_Final1652708168.MP4
This is the version with the modifications as specified above:
RPReplay_Final1652707124.MP4
I just noticed that the physics seem to be slightly different for up and down scrolling. When scrolling down, the modified values are closer to the native physics, however, when scrolling up, the current parameters seem to be a better fit. However, clearly, changing the parameters will only do so much as the underlying physics implementations seem to be different.
As for the suggested temporary fixes: in my apps I reverted the friction ratio back to its initial value of
0.135as a value of0.126made reverse scrolling feel too slow and it was mainly the unwanted flings which were tripping off the scrolling experience.Flutter Doctor:
maheshj01 commentedon May 17, 2022
Thanks for the info @LucasAschenbach, Labeling this issue as a proposal to improve BouncingScrollPhysics to match the native platforms.
[-]BouncingScrollPhysics too 'slippery'[/-][+][IOS] BouncingScrollPhysics too 'slippery'[/+]