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.