-
Notifications
You must be signed in to change notification settings - Fork 32
[scroll_overlay] Use different sized items #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The android project hasn't been updated in a long time and wasn't compiling. Was recreated using `flutter create`, sample code was added afterwards
Different sized items cause a completely different scrolling behavior (which is what's often found in the real world). Especially on iOS this causes the damping is now much more noticeable than on native. flutter/flutter#32448
…items As pointed out in flutter#32448, the velocity shouldn't be decreased when creating the simulation. The current solution only works for lists where all items have the same size. Lists with different sized items recreate the simulation over and over again (because the maxScrollExtent slightly changes), reducing the velocity with each call by 9%. The velocity should not depend on how often the simulation gets created! Instead I tweaked the damping value of the FrictionSimulation to match the native behavior more closely. For testing, I updated the [scroll_overlay](flutter/platform_tests#2) test project to use different sized cells. The new damping isn't pixel-perfect. I'm not even sure it is possible at all. But at least lists with equally and unequally sized cells now behave the same. Related flutter#11772
|
@LongCatIsLooong wanna merge this PR? |
|
@passsy Sorry for the delay! I'll take a look at the iOS part this weekend. |
LongCatIsLooong
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dart and ios LGTM. @xster could you take a look at this?
|
Thanks for bringing this project up to date. Could you add a screenshot for before and after? |
Note
|
|
uh oh, that's concerning. Do we have a bug for this issue? |
|
False alarm, my bad. Everything works after |
|
Just tried this PR today for a demo. It worked very well. Since there is already an approval from @LongCatIsLooong for the PR, I'm merging this. Thank you for your contribution, @passsy. |




Increate cell size with each index by 1
It turned out that different sized cells cause a different scrolling behavior on iOS (flutter/flutter#32448). This change allows testing this scenario.