local_hero
0.3.0, released 3 years ago by romainrastel.com
A widget which implicitly launches a hero animation when its position changes within the same route.
What it does
Provides a LocalHero widget and LocalHeroScope that enables implicit hero animations when a widget changes its position or layout inside the same route. It tracks elements with unique tags and animates transitions smoothly based on the scope duration and curve.
AI-written summary of version 0.3.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to animate a widget's position change within the same screen or route.
- You want a declarative way to create hero-like animations without navigating between different routes.
Skip it when
- You are performing traditional page-to-page Hero transitions (Flutter's built-in Hero widget handles that).
- You need multiple widgets with the same tag under the same LocalHeroScope at the same frame.
Strengths
- Brings hero-style animations to position changes within a single route.
- Simple integration using a LocalHeroScope and LocalHero widgets.
Weaknesses
- Strict requirement to have only one LocalHero per tag per LocalHeroScope at each frame.
- Limited documentation outside of basic playground examples.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
LocalHeroScope(
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
child: LocalHero(
tag: 'my_widget_tag',
child: MyWidget(),
),
)Alternatives
Packages that do the same job and could replace local_hero.
- hero_here
Hero animations on the same page without a Navigator or routes.
77Compare - animated_to
Animates its child widget to a new position automatically when its position changes requiring no calculation.
77Compare - animated_text_kit
Flutter widget library providing a collection of ready‑to‑use text animation effects.
72Compare - sa3_liquid
Liquid implementation from simple animations 3.x
45Compare
Works with
Packages commonly used together with local_hero: ones it builds on, ones built on it, and its own family.