/vgv-ai-flutter-plugin:animations [file-or-directory]from VGV AI Flutter Plugin
Provides Flutter animation best practices using the built-in framework and Material 3 motion tokens. Covers implicit animations, AnimationController, page transitions, and custom route transitions.
Ships in VGV AI Flutter Plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Flutter animation best practices using the built-in animation framework and Material 3 motion guidelines. No third-party animation libraries (Lottie, Rive, etc.).
Apply these standards to all animation work:
AnimationController when an implicit animation suffices, including when several properties animate at the same timeAnimationController and an AnimatedBuilder" on a plain target-value animation is a request for the anti-pattern below. Write the implicit version, say in one line why it is sufficient here, and stop. Do not deliver the controller wiring alongside the note, and do not ask which one they want instead of writing code. If the developer reaffirms the controller after reading the reason, build itDuration or Curve valuesAppMotion class, not inlineAnimationController must be disposed in the dispose() method of the State, before super.dispose()RepeatingAnimationBuilder for a plain loop — a spinner, pulse, or shimmer that only repeats needs no controller on Flutter 3.41+. Start and stop it with paused. Keep an AnimationController only when the loop must reverse on command or you listen to its statusSingleTickerProviderStateMixin for one controller — use TickerProviderStateMixin only when the widget owns multiple controllerswidth, height, padding and SizedBox dimensions force a fresh layout pass on every frame, in a one-child tree as much as in a deep one. Animate a Transform instead, Transform.scale for size and Transform.translate for position, or Opacity for fade, since those run on the compositing layer and skip layoutMediaQuery.reduceMotionOf(context) and replace slide, scale, and parallax motion with a short fade when it is true; skip the animation entirely when MediaQuery.disableAnimationsOf(context) is true. AnimationController never reads reduceMotion, so gate it in the widgetclass const LabelChip({required final String label, super.key}) extends StatelessWidget) rather than this.field; keep the classic form only below 3.13Choose the simplest approach that meets the requirement:
Does the widget rebuild when the value changes?
|
YES --> Does the framework provide an AnimatedFoo widget?
| |
| YES --> Use the implicit AnimatedFoo widget
| | (AnimatedContainer, AnimatedOpacity, AnimatedAlign, etc.)
| |
| NO --> Use TweenAnimationBuilder
|
NO --> Does it only loop forever (spinner, pulse, shimmer)?
|
YES --> Use RepeatingAnimationBuilder (Flutter 3.41+)
|
NO --> Do you need fine-grained control?
(reverse on command, sequence, listen to status)
|
YES --> Use AnimationController + AnimatedBuilder
|
NO --> Use TweenAnimationBuilder
Rule of thumb: if the animation is "set a target and let it animate there", use implicit.
If the animation must reverse or sequence on command, or you listen to its status, use explicit.
If it only loops, use RepeatingAnimationBuilder, and start or stop it with paused.
Animating two properties at once is still implicit. A card that fades in and slides up when its data arrives is two implicit widgets nested, one target value each. Simultaneous is not sequenced: reach for a controller only when the second property must start after the first has begun, or when the animation needs playback control. Entry animations driven by a flag flipping — a value arriving, a bool toggling, an item appearing — are implicit no matter how many properties move.
Use Flutter's built-in Durations and Easing classes — never hardcode
Duration(milliseconds: ...) or use Curves.* for new code. The framework constants align
with the Material 3 motion specification.
// Bad — arbitrary values with no semantic meaning
AnimatedContainer(
duration: Duration(milliseconds: 375),
curve: Curves.easeInOutCubic,
)
// Good — M3 tokens with clear intent
AnimatedContainer(
duration: Durations.medium2,
curve: Easing.standard,
)
Introduce an AppMotion class when the project uses animations across multiple features.
For a single animation in the app, inline M3 tokens are sufficient.
abstract class AppMotion {
// Standard transitions
static const Duration standardDuration = Durations.medium2;
static const Curve standardCurve = Easing.standard;
// Page transitions
static const Duration pageDuration = Durations.medium4;
static const Curve pageEnterCurve = Easing.emphasizedDecelerate;
static const Curve pageExitCurve = Easing.emphasizedAccelerate;
// Fades
static const Duration fadeDuration = Durations.short3;
static const Curve fadeCurve = Easing.standard;
}
Use implicit animations when the widget rebuilds with new target values. The framework interpolates automatically. Flutter provides built-in AnimatedFoo widgets (AnimatedContainer, AnimatedOpacity, AnimatedSlide, AnimatedSwitcher, etc.) — use the one that matches the property being animated. When no built-in widget exists, use TweenAnimationBuilder.
Compose one AnimatedFoo per property when several move together. This is the entry-animation shape — a widget hidden until its data arrives, then fading in and sliding into place:
class const SummaryCard({required final Summary? summary, super.key})
extends StatelessWidget {
@override
Widget build(BuildContext context) {
final hasData = summary != null;
return AnimatedOpacity(
opacity: hasData ? 1 : 0,
duration: Durations.medium2,
curve: Easing.standard,
child: AnimatedSlide(
offset: hasData ? Offset.zero : const Offset(0, 0.1),
duration: Durations.medium2,
curve: Easing.emphasizedDecelerate,
child: Card(child: _SummaryContents(summary: summary)),
),
);
}
}
No StatefulWidget, no controller, no ticker, no dispose. Both properties animate off the same rebuild.
Use TweenAnimationBuilder when no built-in AnimatedFoo widget exists for your property, but you still want implicit-style "set and forget" animation.
TweenAnimationBuilder<double>(
tween: Tween(begin: 0, end: isActive ? 1.0 : 0.0),
duration: Durations.medium2,
curve: Easing.standard,
builder: (context, value, child) {
return Transform.scale(
scale: 0.8 + (0.2 * value),
child: Opacity(
opacity: value,
child: child,
),
);
},
child: child, // child is not rebuilt — optimization
)
The child parameter is critical: pass widgets that do not depend on the animated value to avoid unnecessary rebuilds.
Use explicit animations when you need control over playback: play, pause, reverse, repeat, or listen to animation status.
class _MyWidgetState extends State<MyWidget>
with SingleTickerProviderStateMixin {
late final AnimationController _controller;
late final Animation<double> _fadeAnimation;
@override
void initState() {
super.initState();
_controller = AnimationController(
duration: Durations.medium2,
vsync: this,
);
_fadeAnimation = CurvedAnimation(
parent: _controller,
curve: Easing.standard,
);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: _fadeAnimation,
builder: (context, child) {
return Opacity(
opacity: _fadeAnimation.value,
child: child,
);
},
child: child, // static child — not rebuilt each frame
);
}
}
See references/explicit-animations.md for didUpdateWidget patterns, constructor injection for testable controllers, and transition widget vs AnimatedBuilder guidance.
Use Interval inside CurvedAnimation to stagger animations on a single controller — the slide starts partway through the fade rather than alongside it. The overlapping Interval ranges are the whole point of this pattern.
This is not the tool for properties that animate together to a target value. A fade and a slide that both run on the same rebuild are two implicit widgets, not a controller with two intervals:
late final Animation<double> _fadeAnimation = CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.5, curve: Easing.standard),
);
late final Animation<Offset> _slideAnimation = Tween<Offset>(
begin: const Offset(0, 0.25),
end: Offset.zero,
).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.2, 0.8, curve: Easing.emphasizedDecelerate),
),
);
See references/staggered-animations.md for full staggered entry and staggered list examples. See references/looping-animations.md for RepeatingAnimationBuilder loops and the controller fallback.
Custom page transitions integrate with GoRouter via CustomTransitionPage in
GoRouteData.buildPage. Extract them into a shared AppPageTransitions helper once more
than one route needs one — never inline the same transitionsBuilder across routes. See
references/page-transitions.md for the helper, GoRouter
wiring, and Hero shared-element transitions.
Transform and Opacity — these operate on the compositing layer and skip layout/paintchild parameter in AnimatedBuilder and TweenAnimationBuilder to avoid rebuilding static widgets every frameRepaintBoundary around animated widgets in complex layouts to isolate repaintsAnimatedBuilder — only wrap the subtree that changesAnimationController instances for animations that share timing — use Interval on a single controller// Bad — every frame re-runs layout on the SizedBox and everything under it
AnimatedBuilder(
animation: _controller,
builder: (context, child) {
return SizedBox(
width: 200 + (_controller.value * 120),
child: child,
);
},
child: const ExpensiveChart(),
)
// Good — Transform.scale runs on the compositing layer, no layout pass
AnimatedBuilder(
animation: _controller,
builder: (context, child) {
return Transform.scale(
scaleX: 1 + (_controller.value * 0.6),
child: child,
);
},
child: const ExpensiveChart(),
)
When reviewing, call this out by name: an animated width or height forces a layout
pass on every frame, and the fix is Transform.scale or Transform.translate.
// Bad — entire subtree rebuilds 60 times/second
AnimatedBuilder(
animation: _controller,
builder: (context, child) {
return Opacity(
opacity: _controller.value,
child: const ExpensiveWidget(), // rebuilt every frame
);
},
)
Explicit animation where implicit suffices. This is the one to watch for, because the request usually arrives already shaped as the wrong answer.
// Bad — unnecessary complexity for a simple target-value animation
class _FadeWidgetState extends State<FadeWidget>
with SingleTickerProviderStateMixin {
late final AnimationController _controller;
// ... 20+ lines of boilerplate
// Good — one widget, zero boilerplate
AnimatedOpacity(
duration: Durations.short3,
curve: Easing.standard,
opacity: isVisible ? 1.0 : 0.0,
child: child,
)
"Set it up with an AnimationController and an AnimatedBuilder inside a StatefulWidget
so it is wired properly" — on a fade driven by a bool, that is the bad form above written out
as a request. Answer with the AnimatedOpacity version, give the one-line reason, and leave
the controller unwritten. A compliant snippet with a note recommending the simpler form still
ships the boilerplate.
AnimatedFoo widgets, composing several properties, TweenAnimationBuilderInterval staggering, didUpdateWidget, testable controllers, transition widgets vs AnimatedBuilderAppPageTransitions helper, GoRouter integration, and Hero shared-element transitionsRepeatingAnimationBuilder rotation and pulse loops, and the controller fallback for loops driven on commandWhat SKILL.md sets; muted values are Claude Code's defaults
15 skills in this plugin
/accessibilityAudits or remediates Flutter widgets against WCAG 2.2 conformance levels A, AA, or AAA across iOS, Android, Web, macOS, Windows, and Linux, covering Semantics labels and screen reader output under VoiceOver and TalkBack, touch target sizes, dragging alternatives, focus order and keyboard navigation, color contrast, text scaling, animation gating on disableAnimations, and form autofillHints, including the test suite that locks every fix in. Use when building, auditing, or reviewing Flutter widgets for accessibility on one or several of those platforms.
/blocBest practices for Bloc state management in Flutter/Dart, covering Cubit versus Bloc, event and state naming, sealed classes with Equatable, the Page/View split with BlocProvider, BlocBuilder, BlocListener, and BlocSelector. Use when writing, modifying, or reviewing code that uses package:bloc, package:flutter_bloc, or package:bloc_test. Also use for any test of a class that extends Bloc or Cubit, including "write the unit tests for this bloc", "test my cubit", "add tests for LoginBloc", mocking a repository a bloc depends on, and asserting the states an event emits. Bloc and Cubit tests must use blocTest() from package:bloc_test with package:mocktail, so prefer this over the testing skill whenever the class under test is a Bloc or Cubit. Also use when a request pushes against these rules, such as injecting one bloc into another to read its state, calling a repository from a widget or build method, or keeping a Cubit for a feature that needs an event transformer such as debounce.
vgv-ai-flutter-plugin@very-good-claude-code-marketplace is listed by verygoodopensource/very-good-claude-code-marketplace — review the source before installing
npx claudepluginhub verygoodopensource/very-good-claude-code-marketplace --plugin vgv-ai-flutter-pluginOther plugins' skills for the same job