[scrollable_positioned_list] Scroll by mouse wheel speedup for desktop apps #421
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.scrollController
andsecondary.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.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).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.flutter test
pass.flutter analyze
does not report any problems on my PR.