animated_to
0.9.1, released 8 weeks ago by tsuyoshichujo.com
Animates its child widget to a new position automatically when its position changes requiring no calculation.
What it does
AnimatedTo tracks its child widget using a GlobalKey and automatically animates the child to its new position whenever a rebuild or layout update shifts it. It supports both curve-based animations and spring physics simulations, alongside features like delayed start and coordinate boundaries for gesture handling.
AI-written summary of version 0.9.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to animate a widget smoothly to a new position when reordered or repositioned via state changes.
- You need spring physics or curve-based positional animations without manually calculating delta offsets.
- You want to create staggered wave-like layout animations easily using the delay parameter.
Skip it when
- You need animations across Sliver-related widgets like ListView where the animation happens across slivers.
- You need general non-positional implicit animations or Lottie/Rive animations.
Strengths
- Requires zero position calculation from the developer.
- Supports both curve durations and natural physical spring simulations.
- Provides AnimatedToBoundary to correctly handle hit testing and coordinate systems during movement.
Weaknesses
- Does not work across Sliver-related widgets when the animation happens across slivers.
- Requires a GlobalKey to keep the RenderObject alive across depth or position changes.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
AnimatedTo.curve(
globalKey: _globalKey,
child: Container(
width: 60,
height: 60,
color: Colors.blue,
),
)Alternatives
Packages that do the same job and could replace animated_to.
- flutter_animate
Choose flutter_animate if you prefer a comprehensive chained animation extension library for fading, scaling, and moving widgets.
70Compare
Works with
Packages commonly used together with animated_to: ones it builds on, ones built on it, and its own family.