heroine
0.7.2+2, released 3 days ago by whynotmake.it
Spring-based physics hero transitions and gesture-driven animations in Flutter.
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.
- elegant_spring_animation
Provides physics-based spring animation curves with customizable bounciness.
47Compare - hero_here
Hero animations on the same page without a Navigator or routes.
77Compare - scroll_drag_detector
A drag gesture detector that handles overscrolling ScrollViews inside of it.
71Compare - sa3_liquid
Liquid implementation from simple animations 3.x
45Compare
Works with
Packages commonly used together with heroine: ones it builds on, ones built on it, and its own family.
- equatableheroine depends on itProvides value‑based equality for Dart objects without manual == and hashCode.
- motorheroine depends on itUnified motion system combining physics-based springs and duration-based curves.
- liquid_glass_rendererSame familyiOS 27-style liquid glass renderer for Flutter with refraction, frost, and tint.
- stupid_simple_sheetSame familyA simple sheet widget for Flutter.
- springsterSame familySpring animations and physics simulations simplified for Flutter.