Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

[scrollable_positioned_list] Scroll by mouse wheel speedup for desktop apps#421

Open
nikitatg wants to merge 4 commits into
google:masterfrom
nikitatg:scroll-by-wheel-speedup
Open

[scrollable_positioned_list] Scroll by mouse wheel speedup for desktop apps#421
nikitatg wants to merge 4 commits into
google:masterfrom
nikitatg:scroll-by-wheel-speedup

Conversation

@nikitatg

Copy link
Copy Markdown

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 both primary.scrollController and secondary.scrollController

When 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 Listener at line 371.

  • Handler onPointerHover intended 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).
  • Empirically found that onPointerMove called 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.

  • I signed the CLA.
  • All tests from running flutter test pass.
  • flutter analyze does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

@google-cla

google-cla Bot commented Aug 29, 2022

Copy link
Copy Markdown

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.

@AmirhosseinShk

AmirhosseinShk commented Oct 23, 2022

Copy link
Copy Markdown

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.
best regards

@nikitatg

Copy link
Copy Markdown
Author

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

@nikitatg

Copy link
Copy Markdown
Author

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

@nikitatg nikitatg force-pushed the scroll-by-wheel-speedup branch from bdbd27e to fca251a Compare July 4, 2023 14:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants