Skip to content

Draggable Route implementation for Flutter. Inspired by Instagram route transitions

License

Notifications You must be signed in to change notification settings

rIIh/draggable_route_flutter

Repository files navigation

Draggable Route

pub package

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
gif gif gif gif

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 :-)

About

Draggable Route implementation for Flutter. Inspired by Instagram route transitions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published