draggable_route 0.7.0
draggable_route: ^0.7.0 copied to clipboard
Draggable Hero route. Inspired by Instagram route transitions. Open route from source widget and closes to source widget. Can be closed by drag
Draggable Route #
This package provides easy to use draggable route. Inspired by Instagram route transitions.
Showcase #
With Source | Without Source | Scroll View with Source | Scroll View without Source |
---|---|---|---|
![]() |
![]() |
![]() |
![]() |
Features #
Draggable route can:
- open from source widget with expanding
- close to source widget with pretty animation
- drag to close
- vanish if source widget not available
Getting started #
Add draggable_route
to dependencies
dart pub add draggable_route
Usage #
Without widget source #
Open route without widget source. Page will be pushed as Adaptive page. On pop page will vanish with animation. Drag to pop is also working in this scenario
Navigator.of(context).push(
DraggableRoute(
builder: (context) => const Page(),
),
)
With widget source #
Open route with widget source. Page will be expanded from widget source and retracted to widget source on pop.
Warning
context
provided to source
should not have GlobalKeys in children.
Source widget from context
will be recreated for shuttle animation.
Navigator.of(context).push(
DraggableRoute(
source: context,
builder: (context) => const Page(),
),
)
Additional information #
Feel free to contribute :-)