Skip to content
pubscout

heroine

0.7.2+2, released 3 days ago by whynotmake.it

Spring-based physics hero transitions and gesture-driven animations in Flutter.

WASM-ready
$ flutter pub add heroine
Source repository

What it does

Heroine enables smooth spring-based hero transitions between routes with customizable bounce, drag-to-dismiss gestures, and velocity-aware animations. It integrates with Flutter's navigation system via a navigator observer and offers various shuttle builders for advanced transition effects.

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

Use it when

  • You want spring-based, physics-driven hero animations instead of default Flutter curves.
  • You need drag-to-dismiss interactions for detail views.
  • You require customizable flight shuttle builders like 3D flips or color fades during transitions.

Skip it when

  • You are looking for state management or dependency injection libraries.
  • You want non-interactive, standard page transitions without hero elements.

Strengths

  • Provides smooth spring-based physics and velocity-aware animations.
  • Supports drag-to-dismiss gestures out of the box.
  • Offers flexible transition effects with chainable shuttle builders.

Weaknesses

  • Does not support nested transitions (though nesting heroines not part of the same transition is allowed).
  • Requires proper registration of `HeroineController` in navigators.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2

Register `HeroineController()` in your app's navigator observers (e.g., `MaterialApp(navigatorObservers: [HeroineController()])`).

MaterialApp(
  home: MyHomePage(),
  navigatorObservers: [HeroineController()],
);

// Source route
Heroine(
  tag: 'unique-tag',
  child: MyWidget(),
);

// Destination route
Heroine(
  tag: 'unique-tag',
  child: MyExpandedWidget(),
);

Alternatives

Packages that do the same job and could replace heroine.

Works with

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