Skip to content
pubscout

draggable_route

0.7.3, released 11 months ago by melv.space

Draggable Hero route for Flutter inspired by Instagram transitions.

WASM-ready
$ flutter pub add draggable_route
Source repository

What it does

Provides a custom page route that opens by expanding from a source widget or as an adaptive page, and can be closed via dragging or animating back to the source widget.

AI-written summary of version 0.7.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want Instagram-style expand and drag-to-close route transitions.
  • You need custom Hero-like route animations that support drag gestures.

Skip it when

  • Your source widget context contains GlobalKeys in children.
  • You are using a declarative router framework where custom imperative routes are hard to fit.

Strengths

  • Supports opening with or without a source widget.
  • Handles scroll views and drag-to-dismiss interactions natively.
  • Configurable dismiss distance and velocity.

Weaknesses

  • Context provided to the source must not have GlobalKeys in children.
  • Source widgets are recreated for the shuttle animation.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2

Add the package to pubspec.yaml and import it.

Navigator.of(context).push(
  DraggableRoute(
    source: context,
    builder: (context) => const Page(),
  ),
);

Alternatives

Packages that do the same job and could replace draggable_route.

Works with

Packages commonly used together with draggable_route: ones it builds on, ones built on it, and its own family.