[scrollable_positioned_list] Scroll by mouse wheel speedup for desktop apps#421
[scrollable_positioned_list] Scroll by mouse wheel speedup for desktop apps#421nikitatg wants to merge 4 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Hi , dear google we need this feature ASAP , our customers really need speed up scroll on message list with mouse wheel. we hope this branch merge ASAP. |
|
After update Flutter to 3.3.* there appears a little issue with scrolling by notebook's touchpad. Difficult to explain but sometimes touchpad still recognized as mouse, and sometimes as trackpad. But it not makes this PR unusable. If it's important for your project(s) better try this feature on some notebook for a test |
|
I've fixed mentioned above but tested only on Flutter 3.3.5. Now should not be felt changing scroll devices Sadly, haven't enough time to test this on earlier Flutter versions |
…er now detects it as "Trackpad" device kind
…en/touchpad/mouse wheel. From Flutter 3.3.0 there is new Listener's event usage (see flutter/flutter#112880 (comment))
bdbd27e to
fca251a
Compare
Description
In desktop app (Windows and Linux) scrolling with mouse wheel was too slow. There is option to add some extra scroll speed that will be applied to any scroll tick. This is handled in the body of the scroll listener
_ScrollablePositionedListState._speedUpScrollListener()which in turn assigned to bothprimary.scrollControllerandsecondary.scrollControllerWhen scrolling is done on touchscreen mentioned method just do
return;and does not affect kinetic scrolling (tested on Windows notebook's touchscreen).Scrolling device is recognized by
Listenerat line 371.onPointerHoverintended to detect that it's NOT touchscreen because is called only when cursor hovers over view which is only possible with mouse (and maybe trackpad).onPointerMovecalled only when dragging view with a finger and therefore are a good way to detect touchscreen.The disadvantage for now is that there is no way to recognize if the touchpad or mouse caused scrolling (both are
PointerDeviceKind.mouse) and therefore scrolling with touchpad became too fast (but only when extraScrollSpeed was passed).Related Issues
#406
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.flutter testpass.flutter analyzedoes not report any problems on my PR.