Skip to content
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

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nikitatg
Copy link

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
Copy link

google-cla bot commented Aug 29, 2022

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
Copy link

AmirhosseinShk commented Oct 23, 2022

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
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
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants