scroll_drag_detector 1.0.0-dev.0 copy "scroll_drag_detector: ^1.0.0-dev.0" to clipboard
scroll_drag_detector: ^1.0.0-dev.0 copied to clipboard

A drag gesture detector that can deal with scroll views inside of it.

Scroll Drag Detector #

Pub Version Coverage lintervention_badge Bluesky

A special version of GestureDetector that picks up overscrolling ScrollViews inside of it.

Unlocks easy draggable scrollable sheets in Flutter.

Installation 💻 #

❗ In order to start using Scroll Drag Detector you must have the Dart SDK installed on your machine.

Or install via dart pub:

dart pub add scroll_drag_detector

Usage #

Choose how movement in each physical direction is routed:

ScrollDragDetector(
  up: ScrollDragMode.dragFirst,
  down: ScrollDragMode.boundaryStart,
  left: ScrollDragMode.none,
  right: ScrollDragMode.none,
  onVerticalDragUpdate: (details, wouldScroll) {
    // Move the surrounding draggable.
  },
  child: scrollable,
)

Use ScrollDragMode.scrollFirst to let the child reach its boundary before the surrounding draggable takes over. Use ScrollDragDetector.legacy to migrate the previous scrollableCanMoveBack and onlyDragWhenScrollWasAtTop configuration without changing conventional sheet behavior.


10
likes
140
points
4.25k
downloads

Documentation

API reference

Publisher

verified publisherwhynotmake.it

Weekly Downloads

A drag gesture detector that can deal with scroll views inside of it.

Homepage
Repository (GitHub)
View/report issues

Topics

#animation #motion #physics #spring #curve

License

MIT (license)

Dependencies

flutter, meta

More

Packages that depend on scroll_drag_detector