Repository navigation
Implement Specific Fixes for Multi-Touch Scrolling Across Platforms - #138763
JacobSyndeo wants to merge 3 commits into
Conversation
…ation for `first`/`last`!
…t behavior on iOS
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
|
I wanted to post this now for review and discussions' sake, but I'm currently having some difficulty writing unit tests for it. I'm working in This is my first contribution to Flutter, so if someone more familiar with the codebase could give me some pointers (heh) on how I should implement the unit tests here, then I'll be happy to build them out. Also, as @xu-baolin's PR is still open, I'll leave it up to the maintainers to decide whether we should merge his in first, and adapt mine to his, or move forward with this one instead. I'm fine either way! I don't want to be rude or have bad etiquette here (especially as a new contributor); I just wanted to build out the solution for the iOS side, and then noticed that his PR fixed it on Android, and adapted his solution as |
|
@JacobSyndeo Hi, Thank you very much for your contribution to the Flutter community. |
|
@xu-baolin Thank you, sounds great. I'm looking forward to us as a community getting this longstanding issue resolved, so I'm happy to contribute! Let's get yours merged in for now, then we can revisit the iOS side, as you said. That PR you linked is interesting, and may be better logic for the I still think there's value in the route you and I went down in our PRs, though, regarding adding an enum that allows different scroll behavior to be used, as well as retaining the legacy behavior ( Mine also adds |
Piinks
left a comment
There was a problem hiding this comment.
Hi @JacobSyndeo thanks for contributing! Per the last comment, and the other PR (#136708) that is addressing the issue, I am going to close this for now.
If there are separate/additional features to follow up on after that PR, we can take a look after that change lands.
Thanks very much for contributing!
Currently, when scrolling in Flutter with multiple fingers, the target platform's conventions are not respected. See #11884 and its discussion for an overview of the situation, as well as #38926 for further details.
This PR implements a solution as discussed here and here.
In short, it adds a new enum
MultiTouchDragBehaviorwhich allows customization of the way multiple finger inputs are treated during scrolling.It includes
.average, which implements iOS-style behavior,.lastfor Android-style behavior,.sumfor legacy behavior, as well as a.firstin case anyone really wants theirs to behave that way for some reason. It also includes a special.platformDefault, which lets Flutter decide which behavior is appropriate for the current platform.Most of the modifications are in
monodrag.dart.Finally, this solution includes @xu-baolin's work on #136708 to support Android-style last-touch scroll behavior, albeit with slight modifications to play nice with more scrolling behaviors, such as the iOS-style
.average, which is where most of my own effort here went.Fixes #11884.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.