flutter_smooth_wheel_scroll 0.1.7
flutter_smooth_wheel_scroll: ^0.1.7 copied to clipboard
Smooth, adjustable mouse wheel scrolling for Flutter desktop: scale the wheel distance app-wide and animate it per scroll view with a spring, curve or lerp.
0.1.7 #
- Fix:
ScrollbarControllerno longer throws "ScrollController attached to multiple scroll views" (in a release build, "Bad state: Too many elements") in the frame where the view's scroll view is replaced by a new one while the scrollbar lays out. Until the old view is removed at the end of that frame, the view's controller has two positions; while it has more than one, the scrollbar behaves as it does with none: its own end, its own wheel, and a press or track click that stops no view motion.
0.1.6 #
ScrollbarController: aScrollControllerfor a scrollbar that sits on its ownScrollablebeside a scroll view, as a table or a tree keeps one. A wheel over the scrollbar goes to the scroll view's controller, so it joins that view's wheel motion when the controller is aSmoothScrollController. The scrollbar's end follows the view's, a press or a track click stops the view's running motion, and the view's physics decide whether the wheel is taken; a wheel they refuse leaves the platform's default action allowed. Mirroring the two controllers' offsets stays with the caller. See the README.
0.1.5 #
SpringWheelMotion,CurveWheelMotionandLerpWheelMotioncompare by value: two motions of the same kind with equal fields are==and share ahashCode, even when built from runtime values rather than as constants. A widget or config that holds aWheelMotionno longer reads an equal motion as a change.CurveWheelMotion.curveis compared with the curve's own==, so theCurvesconstants compare equal while two separately builtCubics do not.
0.1.4 #
- Fix: a layout correction during a wheel motion is no longer undone on the
next frame. When a scroll view corrects its offset with
ScrollPosition.correctBy— for example to keep what is in view in place as content above it changes size — the motion's position and target move with it, and the remaining wheel distance carries on. When the content shrinks so that the target is past the end, the motion now eases into the new end instead of stopping there abruptly. - Fix: a wheel motion keeps to the scroll view's current extents after the view replaces its scroll position mid-motion, for example on a physics change. It read the extents of the old position, so with bouncing physics it could run past a new, shorter end and bounce back.
0.1.3 #
- Fix: on the web, trackpad scrolling is no longer animated by
SmoothScrollController. Flutter web sends it as aPointerScrollEventof kindPointerDeviceKind.trackpad, and every small delta retargeted the wheel motion. Only mouse wheel input animates now, as on desktop; other input scrolls as withScrollControllerand stops a running motion. In Firefox, which reports trackpads as a mouse, trackpad scrolling still animates. - The example has a web target (
flutter run -d chrome).
0.1.2 #
- Fix: in nested scroll views, wheel input that arrives while the inner
view's motion is already heading for its end now scrolls the outer view, as
with
ScrollController. It was dropped until the motion settled.
0.1.1 #
- Lower the minimum Flutter version to 3.32.0 and Dart to 3.8.0, from 3.41.0 and 3.11.5. No API or behavior change.
0.1.0 #
Initial release.
SmoothScrollController: animates mouse wheel scrolling per scroll view. Wheel input during a motion adds to the previous target, scrolling never passes the list ends, and items stay tappable while a motion settles.WheelMotion: how the controller moves.WheelMotion.spring(default: 400 ms, no bounce) keeps its velocity when the target moves.WheelMotion.curve(default: 400 ms,Curves.easeOutCubic) plays anyCurve.WheelMotion.lerp(default: 60 ms time constant) eases toward the target.
SmoothWheelBindingandSmoothWheelBindingMixin: scale mouse wheel distance app-wide, adjustable at runtime.scaleWheelEvent: the event transform behind the binding.