Install
$ agentstack add skill-mdazadhossain95-flutter-agent-skills-flutter-animating-apps ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Implementing Flutter Animations
Contents
- [Core Concepts](#core-concepts)
- [Animation Strategies](#animation-strategies)
- [Workflows](#workflows)
- [Implementing Implicit Animations](#implementing-implicit-animations)
- [Implementing Explicit Animations](#implementing-explicit-animations)
- [Implementing Hero Transitions](#implementing-hero-transitions)
- [Implementing Physics-Based Animations](#implementing-physics-based-animations)
- [Examples](#examples)
Core Concepts
Manage Flutter animations using the core typed Animation system. Do not manually calculate frames; rely on the framework's ticker and interpolation classes.
Animation: Treat this as an abstract representation of a value that changes over time. It holds state (completed, dismissed) and notifies listeners, but knows nothing about the UI.AnimationController: Instantiate this to drive the animation. It generates values (typically 0.0 to 1.0) tied to the screen refresh rate. Always provide avsync(usually viaSingleTickerProviderStateMixin) to prevent offscreen resource consumption. Alwaysdispose()controllers to prevent memory leaks.Tween: Define a stateless mapping from an input range (usually 0.0-1.0) to an output type (e.g.,Color,Offset,double). Chain tweens with curves using.animate().Curve: Apply non-linear timing (e.g.,Curves.easeIn,Curves.bounceOut) to an animation using aCurvedAnimationorCurveTween.
Animation Strategies
Apply conditional logic to select the correct animation approach:
- If animating simple property changes (size, color, opacity) without playback control: Use Implicit Animations (e.g.,
AnimatedContainer,AnimatedOpacity,TweenAnimationBuilder). - If requiring playback control (play, pause, reverse, loop) or coordinating multiple properties: Use Explicit Animations (e.g.,
AnimationControllerwithAnimatedBuilderorAnimatedWidget). - If animating elements between two distinct routes: Use Hero Animations (Shared Element Transitions).
- If modeling real-world motion (e.g., snapping back after a drag): Use Physics-Based Animations (e.g.,
SpringSimulation). - If animating a sequence of overlapping or delayed motions: Use Staggered Animations (multiple
Tweens driven by a singleAnimationControllerusingIntervalcurves).
Workflows
Implementing Implicit Animations
Use this workflow for "fire-and-forget" state-driven animations.
- [ ] Task Progress:
- [ ] Identify the target properties to animate (e.g., width, color).
- [ ] Replace the static widget (e.g.,
Container) with its animated counterpart (e.g.,AnimatedContainer). - [ ] Define the
durationproperty. - [ ] (Optional) Define the
curveproperty for non-linear motion. - [ ] Trigger the animation by updating the properties inside a
setState()call. - [ ] Run validator -> review UI for jank -> adjust duration/curve if necessary.
Implementing Explicit Animations
Use this workflow when you need granular control over the animation lifecycle.
- [ ] Task Progress:
- [ ] Add
SingleTickerProviderStateMixin(orTickerProviderStateMixinfor multiple controllers) to theStateclass. - [ ] Initialize an
AnimationControllerininitState(), providingvsync: thisand aduration. - [ ] Define a
Tweenand chain it to the controller using.animate(). - [ ] Wrap the target UI in an
AnimatedBuilder(preferred for complex trees) or subclassAnimatedWidget. - [ ] Pass the
Animationobject to theAnimatedBuilder'sanimationproperty. - [ ] Control playback using
controller.forward(),controller.reverse(), orcontroller.repeat(). - [ ] Call
controller.dispose()in thedispose()method. - [ ] Run validator -> check for memory leaks -> ensure
dispose()is called.
Implementing Hero Transitions
Use this workflow to fly a widget between two routes.
- [ ] Task Progress:
- [ ] Wrap the source widget in a
Herowidget. - [ ] Assign a unique, data-driven
tagto the sourceHero. - [ ] Wrap the destination widget in a
Herowidget. - [ ] Assign the exact same
tagto the destinationHero. - [ ] Ensure the widget trees inside both
Herowidgets are visually similar to prevent jarring jumps. - [ ] Trigger the transition by pushing the destination route via
Navigator.
Implementing Physics-Based Animations
Use this workflow for gesture-driven, natural motion.
- [ ] Task Progress:
- [ ] Set up an
AnimationController(do not set a fixed duration). - [ ] Capture gesture velocity using a
GestureDetector(e.g.,onPanEndprovidingDragEndDetails). - [ ] Convert the pixel velocity to the coordinate space of the animating property.
- [ ] Instantiate a
SpringSimulationwith mass, stiffness, damping, and the calculated velocity. - [ ] Drive the controller using
controller.animateWith(simulation).
Examples
Example: Explicit Animation (Staggered with AnimatedBuilder)
class StaggeredAnimationDemo extends StatefulWidget {
@override
State createState() => _StaggeredAnimationDemoState();
}
class _StaggeredAnimationDemoState extends State with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation _widthAnimation;
late Animation _colorAnimation;
@override
void initState() {
super.initState();
_controller = AnimationController(
duration: const Duration(seconds: 2),
vsync: this,
);
// Staggered width animation (0.0 to 0.5 interval)
_widthAnimation = Tween(begin: 50.0, end: 200.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.5, curve: Curves.easeIn),
),
);
// Staggered color animation (0.5 to 1.0 interval)
_colorAnimation = ColorTween(begin: Colors.blue, end: Colors.red).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.5, 1.0, curve: Curves.easeOut),
),
);
_controller.forward();
}
@override
void dispose() {
_controller.dispose(); // CRITICAL: Prevent memory leaks
super.dispose();
}
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: _controller,
builder: (context, child) {
return Container(
width: _widthAnimation.value,
height: 50.0,
color: _colorAnimation.value,
);
},
);
}
}
Example: Custom Page Route Transition
Route createCustomRoute(Widget destination) {
return PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) => destination,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
const begin = Offset(0.0, 1.0); // Start from bottom
const end = Offset.zero;
const curve = Curves.easeOut;
final tween = Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
final offsetAnimation = animation.drive(tween);
return SlideTransition(
position: offsetAnimation,
child: child,
);
},
);
}
// Usage: Navigator.of(context).push(createCustomRoute(const NextPage()));
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: mdazadhossain95
- Source: mdazadhossain95/flutter-agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.