Skip to content
cccskills
FreePublished on GitHub

animating-flutter-widgets

Declarative animation patterns using flutter_animate v4.5.x with composable effects (fade, scale, slide, shimmer, shake, blur), GLSL fragment shaders, and scroll-synchronized animations. Use this skill for adding UI animations and transitions, building staggered or sequenced effects, creating custom animation effects, fixing animation jank or performance issues, implementing shimmer loading states, or adding scroll-driven animations. Supports delays, curves, adaptive effects, and easy extension method chaining (.animate()).

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md4.7 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Flutter Animate Implementation (v4.5.x)

Goal

Implement performant, composable, and declarative animations in Flutter using the flutter_animate package. The goal is to reduce boilerplate by using .animate() extension methods on widgets rather than manually orchestrating AnimationController and StatefulWidget mechanics.

Instructions

1. The Core Extension Syntax

Prefer the .animate() extension method on any widget over explicit Animate builder blocks.

Correct Usage:

// 🌟 Best Practice: Extension chaining
Text("Hello World!")
  .animate()
  .fade(duration: 500.ms)
  .scale(curve: Curves.easeOutBack);

Avoid (unless strictly necessary):

// ❌ Avoid explicit nesting unless building a highly complex reusable list
Animate(
  effects: [FadeEffect(), ScaleEffect()],
  child: Text("Hello World!"),
)

2. Time Extensions (num)

Always use the provided num extensions for Duration assignments. This improves readability.

  • 500.ms (Milliseconds)
  • 2.seconds (Seconds)
  • 1.5.minutes (Minutes)

3. Orchestration & Sequencing (.then())

When effects need to run sequentially rather than in parallel, use the .then() pseudo-effect. It establishes a new baseline time equal to the previous effect's completion time.

Column(
  children: [
    Text("Step 1").animate().fadeIn(duration: 400.ms).slideX(),
    Text("Step 2").animate()
      .fadeIn(duration: 400.ms)
      .then(delay: 200.ms) // Step 2 slides 200ms AFTER its own fade completes
      .slideY(),
  ],
)

4. Reactive State Animations (target)

The most powerful feature of flutter_animate. Completely eliminate AnimatedContainer or AnimatedOpacity by using the target property. When target: 1, the animation rests at its end values. When target: 0, the animation reverses cleanly to its begin values.

// Inside a build method that listens to State or Riverpod
bool isHovered = ref.watch(hoverStateProvider);

MyButton()
  .animate(target: isHovered ? 1 : 0) // 🌟 Drives the animation entirely by State
  .fade(end: 0.8)
  .scaleXY(end: 1.1, curve: Curves.easeOutExpo);

5. Infinite Loops & Callbacks

To repeat an animation indefinitely, utilize the onPlay callback to manipulate the internal controller.

Icon(Icons.warning)
  .animate(onPlay: (controller) => controller.repeat(reverse: true))
  .fadeOut(curve: Curves.easeInOut);

6. Value Listeners & Custom Effects

If you need to extract the raw 0.0 to 1.0 double value (e.g. to drive a custom painter or a complex color lerp), use .listen() or .custom().

Listen (Side-Effects):

Text("Hello").animate().fadeIn(duration: 1.seconds)
  .listen(callback: (value) => print('Current alpha: $value'));

CustomEffect (Building from interpolation):

Text("Color Shift").animate().custom(
  duration: 300.ms,
  builder: (context, value, child) => Container(
    // Extrapolates colors cleanly entirely within the animation pipeline
    color: Color.lerp(Colors.red, Colors.blue, value),
    child: child, 
  )
);

7. Logical Toggles & UI Swapping

  • ToggleEffect: Yields a bool based on whether the animation has finished its duration. Useful for flipping raw properties (like AbsorbPointer locks).
  • SwapEffect: Replaces the entire rendered Widget at the very end of the animation timeline.
// The button fades out, and is instantly replaced by a Loader widget when the fade completes.
SubmitButton().animate()
  .fadeOut(duration: 300.ms)
  .swap(builder: (context, child) => const CircularProgressIndicator());

Constraints

  • Extension Priority: Always default to the .animate() extension chaining syntax for generating animations unless directly generating an AnimateList.
  • State Simplicity: Do not define AnimationController inside a StatefulWidget if the goal can be solely achieved using flutter_animate's target: or onPlay: properties.
  • Reuse Effects: If building a Design System, extract List<Effect> arrays into global constants to guarantee application-wide transition consistency.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Dart 3 modern features (through 3.10) and Effective Dart best practices including records, patterns, sealed classes, dot shorthands, null-aware collection elements, and wildcard variables. Use when adopting Dart 3.7+ syntax, using dot shorthands for enums or static members, using null-aware elements in lists or maps, using wildcard _ parameters, improving code quality, or reviewing Dart code conventions.

The English summary is being prepared. Showing the original description.

Poorgramer-Zack/dart-expert-skills7Updated Aug 11, 2026

Expert-level guidance for Flutter production applications: architecture decisions (Clean/Layered/Hexagonal/Feature-First), advanced state management (BLoC/Riverpod/GetX), performance optimization (eliminating jank, memory profiling, reducing rebuild overhead), code review with design pattern enforcement, scalability assessments, native platform integration (MethodChannel/EventChannel/FFI), complex UI challenges (custom render objects, slivers), testing strategies (unit/widget/integration/golden), CI/CD pipeline architecture, build optimization, and accessibility compliance. Triggers: 'architecture decision', 'design pattern', 'performance issue', 'code review', 'production problem', 'scaling concerns', 'best practices', 'technical debt', 'refactoring strategy'. Essential for complex enterprise apps, critical production debugging, architectural refactors, or when choosing between competing technical approaches.

The English summary is being prepared. Showing the original description.

Poorgramer-Zack/dart-expert-skills7Updated Aug 11, 2026

Builds SEO-friendly web applications with Dart using the Jaspr framework. Use when creating Dart-based websites, blogs, or landing pages requiring semantic HTML output; implementing server-side rendering (SSR) or static site generation (SSG); adding Tailwind CSS via jaspr_tailwind; routing with jaspr_router; testing components with jaspr_test; or building full-stack Dart web apps where Flutter Web's canvas rendering is unsuitable.

The English summary is being prepared. Showing the original description.

Poorgramer-Zack/dart-expert-skills7Updated Aug 11, 2026

shadcn_flutter UI component library for building accessible, themed Flutter interfaces. Use when integrating shadcn components, configuring design system theming, or building consistent widget layouts.

The English summary is being prepared. Showing the original description.

Poorgramer-Zack/dart-expert-skills7Updated Aug 11, 2026

Configures Codemagic CI/CD pipelines for Flutter using `codemagic.yaml`. Use when setting up automated Flutter builds on Codemagic, configuring iOS code signing without Fastlane Match, deploying to App Store Connect or Google Play from Codemagic, caching pub dependencies in Codemagic, setting up encrypted environment variable groups, running tests with Codemagic's test dashboard, or choosing between Codemagic and GitHub Actions + Fastlane for a Flutter CI/CD pipeline.

The English summary is being prepared. Showing the original description.

Poorgramer-Zack/dart-expert-skills7Updated Aug 11, 2026

Configures deep linking in Flutter using Android App Links (assetlinks.json) and iOS Universal Links (apple-app-site-association) integrated with GoRouter v17.x navigation. Use this skill when setting up HTTPS domain association, handling magic links or email verification links, routing marketing campaign URLs (Google Ads, Facebook Ads) into the app, implementing password reset or invite flows via deep links, fixing deep link verification failures, troubleshooting GoRouter deep link integration, or any time the words 'deep link', 'universal link', 'app link', 'assetlinks', 'AASA', 'magic link', or 'deeplinking' appear in the request. Avoids deprecated custom URL schemes (myapp://).

The English summary is being prepared. Showing the original description.

Poorgramer-Zack/dart-expert-skills7Updated Aug 11, 2026

See all skills by Poorgramer-Zack

Report a problem with this skill