desktop_scrollbar 1.0.0 copy "desktop_scrollbar: ^1.0.0" to clipboard
desktop_scrollbar: ^1.0.0 copied to clipboard

A flutter package that adds track clicking behavior to Scrollbars.

A Desktop/Web scrollbar for flutter that implements correct track click > jump behavior.

Desktop Scrollbar #

Please see the comparisions below. On the left, you have the default flutter scrollbar. To the right, a Desktop scrollbar using this package.

Notice how when the track is clicked on the default flutter scrollbar, that it only jumps toward the cursor by a small amount? That is not how scrollbars are supposed to work on desktop.

You can see the correct behavior in the desktop scrollbar example gif, where the scrollbar thumb jumps to the clicked position on the track.


Features #

  • Correct implementation of scrollbar track click > jump behavior.
  • Uses the same code as the flutter RawScrollbar widget, meaning the API is the same for the desktop_scrollbar package.

Install #

To install, add desktop_scrollbar to your dependencies in your pubspec.yaml file

# pubspec.yaml
dependencies:
  desktop_scrollbar:

Or import it using flutter pub add desktop_scrollbar

import 'package:desktop_scrollbar/desktop_scrollbar.dart';

Usage #

To use a desktop scrollbar, wrap a scrollable widget with DesktopScrollbar and pass a ScrollControllerinstance to both DesktopScrollbar and the scrollable widget:

DesktopScrollbar(
     controller: scrollController,
     child: ListView.builder(
        controller: scrollController,

You can find a full example in the example file.

Customization #

Please refer to the RawScrollbar documentation, as DesktopScrollbar uses the same underlying code.

Support this project #

Buy Me a Coffee at ko-fi.com

7
likes
0
pub points
72%
popularity

Publisher

unverified uploader

A flutter package that adds track clicking behavior to Scrollbars.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on desktop_scrollbar