draggable_route
0.7.3, released 11 months ago by melv.space
Draggable Hero route for Flutter inspired by Instagram transitions.
WASM-ready
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.
- auto_route
For advanced declarative routing with code generation.
87Compare - go_router
For official declarative routing and deep linking support.
98Compare
Works with
Packages commonly used together with draggable_route: ones it builds on, ones built on it, and its own family.