flutter-animations
Skill36 starsChanged 6 months agoMITView on GitHub
Enterprise Flutter animation skill — Rive + Lottie dual-engine strategy for production mobile apps. Use when adding animations to Flutter, asking about Rive, Lottie, animated UI components, motion design, interactive states, loading indicators, onboarding flows, micro-interactions, character animations, splash screens, empty states, or any animated widget. Load BEFORE writing any Flutter animation code — enforces correct engine choice, architecture patterns, performance constraints, and accessibility.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- MADTeacher/mad-agents-skillstheir own version, first seen May 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- MADTeacher/mad-agents-skills★ 109same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository157 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- a2ui-angularSkill
- accessibility-auditSkill
- adk-deploy-guideSkill
- adk-dev-guideSkill
- adk-eval-guideSkill
- adk-observability-guideSkill
- agentic-ai-coding-standardSkill
- agentic-ai-devSkill
- ai-auditSkill
- ai-chatSkill
- ai-decision-recordSkill
- ai-incident-responseSkill
- ai-launch-checkSkill
- ai-playbookSkill
- angular-best-practicesSkill
- angularSkill
- angular-spaSkill
- angular-ui-patternsSkill
- api-design-principlesSkill
- app-store-optimizationSkill
- architect-reviewSkill
- architecture-decision-recordsSkill
- architecture-designSkill
- asc-cli-usageSkill
- asc-crash-triageSkill
- asc-id-resolverSkill
- asc-release-flowSkill
- asc-signing-setupSkill
- asc-submission-healthSkill
- asc-testflight-orchestrationSkill
- browser-testingSkill
- changelog-generatorSkill
- claude-actions-auditorSkill
- clean-codeSkill
- codebase-onboardingSkill
- code-explainerSkill
- code-reviewerSkill
- code-simplifierSkill
- comment-analyzerSkill
- database-schema-designerSkill
- ddd-architectSkill
- decision-frameworksSkill
- dedup-code-agentSkill
- deployment-ci-cdSkill
- design-systemSkill
- dockerSkill
- documentation-generationSkill
- domain-finderSkill
- error-detectiveSkill
- eval-guideSkill
- feature-forgeSkill
- firebase-basicsSkill
- firebase-hosting-basicsSkill
- fixing-accessibilitySkill
- fixing-motion-performanceSkill
- flutter-genuiSkill
- flutter-mobileSkill
- flutter-security-expertSkill
- frontend-designSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 55
Never put animation controller logic directly in a screen widget.
- Very specific: line 82
Call
await RiveNative.init()inmain(): before runApp
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Iron Law
RESOLVE ENGINE CHOICE FIRST (Rive vs Lottie) before writing a single line of animation code — use the decision table below. Then read the relevant reference file. Never hardcode asset paths.
Flutter Animations — Rive + Lottie Dual-Engine
Engine Decision (Always resolve first)
| Use Case | Engine | Why |
| Interactive buttons, toggles, tab bars | Rive | State machines, pointer input |
| Onboarding with user-driven progression | Rive | Inputs map to gestures |
| Progress indicators tied to real data | Rive | Data binding at runtime |
| Auth flows (loading → success → error) | Rive | Multi-state without code branching |
| Games, character animations | Rive | 60fps, blending, bone rigs |
| Splash / intro screens (play-once) | Lottie | AF export, decorative |
| Empty states, "no results" illustrations | Lottie | Designer-owned, static loop |
| Celebration / confetti effects | Lottie | After Effects shine |
| Icon animations (email sent, checkmark) | Lottie | Simple, small JSON |
| Skeleton loaders with fixed timing | Lottie | Predictable, no interaction |
If unsure: "Does this animation need to respond to app state or user input?" Yes → Rive. No → Lottie.
Package Versions
dependencies:
rive: ^0.14.4 # rive.app verified publisher
lottie: ^3.3.2 # xaha.dev verified publisherArchitecture
Never put animation controller logic directly in a screen widget. Use service + widget separation.
lib/
+-- core/
| +-- animations/
| +-- animation_assets.dart # Typed asset path constants
| +-- animation_preloader.dart # Startup preloader (Rive + Lottie)
| +-- animation_service.dart # Unified facade for DI
| +-- rive_controller_factory.dart # State machine controller factory
| +-- lottie_cache_manager.dart # Composition cache singleton
+-- widgets/
| +-- animations/
| +-- rive_widget.dart # Reusable Rive wrapper
| +-- lottie_widget.dart # Reusable Lottie wrappers (loop/once)
| +-- animation_placeholder.dart # Shimmer shown while loading
| +-- safe_animation.dart # Error-boundary animation widget
+-- assets/
+-- rive/ # .riv files (< 500 KB each)
+-- lottie/ # .json / .lottie files (< 300 KB each)Quick Rules (always apply)
- Preload on app start — never lazy-load
.rivor.jsonat first render - Call
await RiveNative.init()inmain()beforerunApp - Dispose every controller —
FileLoader,RiveWidgetController,AnimationControllermust all be disposed - Use
renderCache: RenderCache.rasterfor all Lottie loops - Choose renderer explicitly —
Factory.rivefor complex vector;Factory.flutterfor simple UI - Never hardcode asset paths — use typed
AnimationAssetsconstants class - Wrap in error boundary —
RiveWidgetBuilderloading/failed states for Rive; try/catch for Lottie - Semantic labels on all animations —
Semantics(label: '...', child: ...) - Reduce motion — check
MediaQuery.of(context).disableAnimationsand skip/pause - Test with
flutter_test— pump and verify state transitions; mock asset loading - Size budget —
.riv< 500 KB;.json< 300 KB; prefer.lottie(dotLottie zip) over raw JSON - Multiple Rive widgets on screen — wrap in
RivePanel(useSharedTexture: true)for GPU performance
Minimal Working Examples
Rive — Interactive Toggle (modern API, rive ^0.14.4)
NOTE:
RiveAnimation.asset+StateMachineController.fromArtboardis the LEGACY API. UseFileLoader+RiveWidgetController+RiveWidgetBuilderfor all new code.
import 'package:flutter/material.dart';
import 'package:rive/rive.dart';
class AnimatedToggle extends StatefulWidget {
final ValueChanged<bool> onChanged;
const AnimatedToggle({super.key, required this.onChanged});
@override
State<AnimatedToggle> createState() => _AnimatedToggleState();
}
class _AnimatedToggleState extends State<AnimatedToggle> {
late final FileLoader _fileLoader;
late final RiveWidgetController _controller;
SMIBool? _isOnInput;
bool _isOn = false;
@override
void initState() {
super.initState();
_fileLoader = FileLoader.fromAsset(
AnimationAssets.toggle,
riveFactory: Factory.rive,
);
_controller = RiveWidgetController(
_fileLoader,
artboardSelector: ArtboardSelector.byName('ToggleArtboard'),
stateMachineSelector: StateMachineSelector.byName('Toggle'),
);
_isOnInput =
_controller.stateMachine('Toggle').input<bool>('isOn') as SMIBool?;
}
@override
void dispose() {
_fileLoader.dispose();
_controller.dispose();
super.dispose();
}
void _toggle() {
final newValue = !_isOn;
setState(() => _isOn = newValue);
_isOnInput?.change(newValue);
widget.onChanged(newValue);
}
@override
Widget build(BuildContext context) {
final reduceMotion = MediaQuery.of(context).disableAnimations;
return Semantics(
label: 'Toggle button',
button: true,
child: GestureDetector(
onTap: reduceMotion ? null : _toggle,
child: reduceMotion
? _StaticToggleFallback(isOn: _isOn)
: SizedBox(
width: 64,
height: 32,
child: RiveWidgetBuilder(
fileLoader: _fileLoader,
builder: (context, state) => switch (state) {
RiveLoading() => const Center(
child: CircularProgressIndicator(strokeWidth: 2),
),
RiveFailed() => const Icon(
Icons.error_outline,
color: Colors.red,
size: 20,
),
RiveLoaded() => RiveWidget(
controller: _controller,
fit: BoxFit.contain,
),
},
),
),
),
);
}
}Lottie — Cached Empty State
import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';
class EmptyStateAnimation extends StatefulWidget {
final String message;
const EmptyStateAnimation({super.key, required this.message});
@override
State<EmptyStateAnimation> createState() => _EmptyStateAnimationState();
}
class _EmptyStateAnimationState extends State<EmptyStateAnimation>
with SingleTickerProviderStateMixin {
late final AnimationController _controller;
@override
void initState() {
super.initState();
_controller = AnimationController(vsync: this);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final reduceMotion = MediaQuery.of(context).disableAnimations;
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Semantics(
label: 'Empty state illustration',
child: Lottie.asset(
AnimationAssets.emptyState,
controller: reduceMotion ? (_controller..stop()) : _controller,
renderCache: RenderCache.raster,
frameRate: FrameRate.composition,
width: 240,
height: 240,
fit: BoxFit.contain,
onLoaded: (composition) {
if (!reduceMotion) {
_controller
..duration = composition.duration
..repeat();
}
},
),
),
const SizedBox(height: 16),
Text(widget.message, style: Theme.of(context).textTheme.bodyLarge),
],
);
}
}Typed Asset Constants
// lib/core/animations/animation_assets.dart
abstract final class AnimationAssets {
// Rive
static const String toggle = 'assets/rive/toggle.riv';
static const String authFlow = 'assets/rive/auth_flow.riv';
static const String progressRing = 'assets/rive/progress_ring.riv';
static const String onboarding = 'assets/rive/onboarding.riv';
static const String bottomNav = 'assets/rive/bottom_nav.riv';
// Lottie
static const String splashLogo = 'assets/lottie/splash_logo.lottie';
static const String emptyState = 'assets/lottie/empty_state.lottie';
static const String successCheck = 'assets/lottie/success_check.lottie';
static const String errorShake = 'assets/lottie/error_shake.lottie';
static const String skeleton = 'assets/lottie/skeleton.lottie';
static const String confetti = 'assets/lottie/confetti.lottie';
}pubspec.yaml Asset Registration
flutter:
assets:
- assets/rive/
- assets/lottie/When to Read Reference Files
- Building a Rive state machine, data binding, or multi-artboard flow → read
references/rive.md - Building a Lottie scene with dynamic color, runtime text, or performance tuning → read
references/lottie.md - Setting up service layer, DI, preloading, CI/CD size checks, or code review checklist → read
references/architecture.md
Related Skills
flutter-mobile— Flutter 3.41.x screen patterns, Riverpod, Freezed. Load alongside for full feature context.mobile-design— Load BEFORE this skill for touch psychology and MFRI scoringriverpod-patterns— Wire animation state to Riverpod providersui-standards-tokens— ThemeData tokens for static fallback widgetsaccessibility-audit— WCAG 2.1 AA audit including reduce-motion compliance
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

