This package provides easy to use draggable route. Inspired by Instagram route transitions.
With Source | Without Source | Scroll View with Source | Scroll View without Source |
---|---|---|---|
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
Add draggable_route
to dependencies
dart pub add draggable_route
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(),
),
)
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(),
),
)
Feel free to contribute :-)