Communitygithub.com

ComeOnOliver/skillshub

Flutter 애니메이션 구현을 위한 종합 가이드입니다. 암시적 애니메이션, 명시적 애니메이션, 히어로 애니메이션, 스태거 애니메이션, 물리 기반 애니메이션 등 다양한 효과를 Flutter 앱에 적용할 때 사용하세요.

skillshub란 무엇인가요?

이 기술은 Flutter 앱에서 애니메이션을 구현하기 위한 완전한 워크플로우를 제공합니다. AnimatedContainer, AnimatedOpacity, TweenAnimationBuilder와 같은 위젯을 사용하는 암시적 애니메이션부터 AnimationController, Tween, AnimatedWidget/AnimatedBuilder를 활용한 명시적 애니메이션까지 모두 다룹니다. 또한 두 화면 간 요소 공유를 위한 히어로 애니메이션, Interval을 사용한 순차적/중첩 타이밍의 스태거 애니메이션, 자연스러운 물리적 동작을 제공하는 SpringSimulation과 같은 물리 기반 애니메이션도 포함합니다. 각 애니메이션 유형을 선택하는 의사 결정 트리, 성능 모범 사례, AnimatedBuilder 패턴을 통한 효율적인 위젯 리빌드, 리소스 누수를 방지하기 위한 AnimationController 처리 방법을 제공하여 개발자가 상황에 맞는 최적의 애니메이션을 구현할 수 있도록 돕습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/madteacher/flutter-animations

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Flutter 애니메이션

개요

Flutter에서 적절한 접근 방식을 사용하여 부드럽고 성능 좋은 애니메이션을 만듭니다. 이 기술은 암시적/명시적 접근 방식 선택부터 히어로 전환 및 스태거 애니메이션과 같은 복잡한 효과 구현까지의 완전한 애니메이션 워크플로우를 다룹니다.

애니메이션 유형 결정 트리

요구 사항에 따라 적절한 애니메이션 유형을 선택하세요:

암시적 애니메이션 - 다음 경우에 사용:

  • 단일 속성(색상, 크기, 위치)을 애니메이션할 때
  • 상태 변경에 의해 애니메이션이 트리거될 때
  • 세밀한 제어가 필요하지 않을 때

명시적 애니메이션 - 다음 경우에 사용:

  • 애니메이션 생명 주기를 완전히 제어해야 할 때
  • 여러 속성을 동시에 애니메이션할 때
  • 애니메이션 상태 변경에 반응해야 할 때
  • 사용자 정의 애니메이션이나 전환을 만들 때

히어로 애니메이션 - 다음 경우에 사용:

  • 두 화면 간에 요소를 공유할 때
  • 공유 요소 전환을 만들 때
  • 사용자가 요소가 라우트 사이를 "날아다니는" 것을 기대할 때

스태거 애니메이션 - 다음 경우에 사용:

  • 여러 애니메이션이 순차적으로 실행되거나 중첩되어야 할 때
  • 리플 효과나 순차적 표시를 만들 때
  • 목록 항목을 순서대로 애니메이션할 때

물리 기반 애니메이션 - 다음 경우에 사용:

  • 애니메이션이 자연스럽고 물리적으로 느껴져야 할 때
  • 스프링 같은 동작, 스크롤 제스처
  • 드래그 가능한 상호 작용

암시적 애니메이션

암시적 애니메이션은 속성이 변경될 때 자동으로 애니메이션을 처리합니다. 컨트롤러가 필요 없습니다.

일반적인 암시적 위젯

AnimatedContainer - 여러 속성(크기, 색상, 장식, 패딩) 애니메이션:

AnimatedContainer(
  duration: const Duration(milliseconds: 300),
  curve: Curves.easeInOut,
  width: _expanded ? 200 : 100,
  height: _expanded ? 200 : 100,
  color: _expanded ? Colors.blue : Colors.red,
  child: const FlutterLogo(),
)

AnimatedOpacity - 간단한 페이드 애니메이션:

AnimatedOpacity(
  opacity: _visible ? 1.0 : 0.0,
  duration: const Duration(milliseconds: 300),
  child: const Text('Hello'),
)

TweenAnimationBuilder - 보일러플레이트 없이 사용자 정의 트윈 애니메이션:

TweenAnimationBuilder<double>(
  tween: Tween<double>(begin: 0, end: 1),
  duration: const Duration(seconds: 1),
  builder: (context, value, child) {
    return Opacity(
      opacity: value,
      child: Transform.scale(
        scale: value,
        child: child,
      ),
    );
  },
  child: const FlutterLogo(),
)

기타 암시적 위젯:

  • AnimatedPadding - 패딩 애니메이션
  • AnimatedPositioned - 위치 애니메이션 (Stack 안에서)
  • AnimatedAlign - 정렬 애니메이션
  • AnimatedContainer - 여러 속성
  • AnimatedSwitcher - 위젯 간 크로스페이드
  • AnimatedDefaultTextStyle - 텍스트 스타일 애니메이션

모범 사례

  • 간단한 경우 암시적 애니메이션을 선호하세요
  • 자연스러운 동작을 위해 적절한 곡선을 사용하세요 (Curves 클래스 참조)
  • 예측 가능한 동작을 위해 curve와 duration을 설정하세요
  • 필요할 때 onEnd 콜백을 사용하세요
  • 성능을 위해 중첩된 암시적 애니메이션을 피하세요

명시적 애니메이션

명시적 애니메이션은 AnimationController로 완전한 제어를 제공합니다.

핵심 구성 요소

AnimationController - 애니메이션을 구동합니다:

late AnimationController _controller;

@override
void initState() {
  super.initState();
  _controller = AnimationController(
    duration: const Duration(seconds: 2),
    vsync: this,
  );
}

@override
void dispose() {
  _controller.dispose();
  super.dispose();
}

Tween - 시작 값과 끝 값 사이를 보간합니다:

animation = Tween<double>(begin: 0, end: 300).animate(_controller);

CurvedAnimation - 애니메이션에 곡선을 적용합니다:

animation = CurvedAnimation(
  parent: _controller,
  curve: Curves.easeInOut,
);

AnimatedWidget 패턴

재사용 가능한 애니메이션 위젯에 가장 적합합니다:

class AnimatedLogo extends AnimatedWidget {
  const AnimatedLogo({super.key, required Animation<double> animation})
    : super(listenable: animation);

  @override
  Widget build(BuildContext context) {
    final animation = listenable as Animation<double>;
    return Center(
      child: Container(
        height: animation.value,
        width: animation.value,
        child: const FlutterLogo(),
      ),
    );
  }
}

AnimatedBuilder 패턴

애니메이션이 포함된 복잡한 위젯에 가장 적합합니다:

class GrowTransition extends StatelessWidget {
  const GrowTransition({
    required this.child,
    required this.animation,
    super.key,
  });

  final Widget child;
  final Animation<double> animation;

  @override
  Widget build(BuildContext context) {
    return Center(
      child: AnimatedBuilder(
        animation: animation,
        builder: (context, child) {
          return SizedBox(
            height: animation.value,
            width: animation.value,
            child: child,
          );
        },
        child: child,
      ),
    );
  }
}

애니메이션 상태 모니터링

animation.addStatusListener((status) {
  switch (status) {
    case AnimationStatus.completed:
      _controller.reverse();
      break;
    case AnimationStatus.dismissed:
      _controller.forward();
      break;
    default:
      break;
  }
});

여러 동시 애니메이션

class AnimatedLogo extends AnimatedWidget {
  const AnimatedLogo({super.key, required Animation<double> animation})
    : super(listenable: animation);

  static final _opacityTween = Tween<double>(begin: 0.1, end: 1);
  static final _sizeTween = Tween<double>(begin: 0, end: 300);

  @override
  Widget build(BuildContext context) {
    final animation = listenable as Animation<double>;
    return Center(
      child: Opacity(
        opacity: _opacityTween.evaluate(animation),
        child: Container(
          height: _sizeTween.evaluate(animation),
          width: _sizeTween.evaluate(animation),
          child: const FlutterLogo(),
        ),
      ),
    );
  }
}

내장 명시적 전환

Flutter는 바로 사용 가능한 전환을 제공합니다:

  • FadeTransition - 페이드 애니메이션
  • ScaleTransition - 스케일 애니메이션
  • SlideTransition - 슬라이드 애니메이션
  • SizeTransition - 크기 애니메이션
  • RotationTransition - 회전 애니메이션
  • PositionedTransition - 위치 애니메이션 (Stack 안에서)

예시:

FadeTransition(
  opacity: _animation,
  child: const FlutterLogo(),
)

성능 팁

  • 위젯이 제거될 때 컨트롤러를 폐기하세요
  • 최적의 리빌드를 위해 AnimatedBuilder를 사용하세요
  • 애니메이션 리스너에서 setState()를 피하세요 (AnimatedWidget/AnimatedBuilder 사용)
  • 디버깅 중에는 timeDilation을 사용하여 애니메이션을 느리게 하세요

히어로 애니메이션

히어로 애니메이션은 화면 간에 공유 요소 전환을 만듭니다.

기본 히어로 애니메이션

소스 화면:

Hero(
  tag: 'hero-image',
  child: Image.asset('images/logo.png'),
)

대상 화면:

Hero(
  tag: 'hero-image',  // 같은 태그!
  child: Image.asset('images/logo.png'),
)

완전한 예시

class PhotoHero extends StatelessWidget {
  const PhotoHero({
    super.key,
    required this.photo,
    this.onTap,
    required this.width,
  });

  final String photo;
  final VoidCallback? onTap;
  final double width;

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: width,
      child: Hero(
        tag: photo,
        child: Material(
          color: Colors.transparent,
          child: InkWell(
            onTap: onTap,
            child: Image.asset(photo, fit: BoxFit.contain),
          ),
        ),
      ),
    );
  }
}

화면 간 탐색:

Navigator.of(context).push(
  MaterialPageRoute<void>(
    builder: (context) {
      return Scaffold(
        appBar: AppBar(title: const Text('Detail')),
        body: Center(
          child: PhotoHero(
            photo: 'images/logo.png',
            width: 300.0,
            onTap: () => Navigator.of(context).pop(),
          ),
        ),
      );
    },
  ),
);

방사형 히어로 애니메이션

전환 중에 원형에서 사각형으로 변환:

class RadialExpansion extends StatelessWidget {
  const RadialExpansion({
    super.key,
    required this.maxRadius,
    this.child,
  }) : clipRectSize = 2.0 * (maxRadius / math.sqrt2);

  final double maxRadius;
  final double clipRectSize;
  final Widget? child;

  @override
  Widget build(BuildContext context) {
    return ClipOval(
      child: Center(
        child: SizedBox(
          width: clipRectSize,
          height: clipRectSize,
          child: ClipRect(child: child),
        ),
      ),
    );
  }
}

중심 기반 보간을 위해 MaterialRectCenterArcTween과 함께 사용:

static RectTween _createRectTween(Rect? begin, Rect? end) {
  return MaterialRectCenterArcTween(begin: begin, end: end);
}

히어로 모범 사례

  • 고유하고 일관된 태그를 사용하세요 (종종 데이터 객체 자체)
  • 라우트 간에 히어로 위젯 트리를 비슷하게 유지하세요
  • "팝" 효과를 위해 투명한 색상의 Material로 이미지를 감싸세요
  • 전환을 디버깅하려면 timeDilation을 사용하세요
  • 필요할 때 히어로 애니메이션을 비활성화하려면 HeroMode를 고려하세요

스태거 애니메이션

여러 애니메이션을 다른 타이밍으로 실행합니다.

기본 스태거 애니메이션

모든 애니메이션이 하나의 컨트롤러를 공유합니다:

class StaggerAnimation extends StatelessWidget {
  StaggerAnimation({super.key, required this.controller})
    : opacity = Tween<double>(begin: 0.0, end: 1.0).animate(
        CurvedAnimation(
          parent: controller,
          curve: const Interval(0.0, 0.100, curve: Curves.ease),
        ),
      ),
      width = Tween<double>(begin: 50.0, end: 150.0).animate(
        CurvedAnimation(
          parent: controller,
          curve: const Interval(0.125, 0.250, curve: Curves.ease),
        ),
      );

  final AnimationController controller;
  final Animation<double> opacity;
  final Animation<double> width;

  Widget _buildAnimation(BuildContext context, Widget? child) {
    return Container(
      alignment: Alignment.bottomCenter,
      child: Opacity(
        opacity: opacity.value,
        child: Container(
          width: width.value,
          height: 150,
          color: Colors.blue,
        ),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return AnimatedBuilder(
      animation: controller,
      builder: _buildAnimation,
    );
  }
}

Interval 기반 타이밍

각 애니메이션은 0.0에서 1.0 사이의 Interval을 가집니다:

animation = Tween<double>(begin: 0, end: 300).animate(
  CurvedAnimation(
    parent: controller,
    curve: const Interval(
      0.25,  // 컨트롤러 지속 시간의 25%에서 시작
      0.50,  // 컨트롤러 지속 시간의 50%에서 종료
      curve: Curves.ease,
    ),
  ),
);

일반적인 트윈

borderRadius = BorderRadiusTween(
  begin: BorderRadius.circular(4),
  end: BorderRadius.circular(75),
).animate(
  CurvedAnimation(
    parent: controller,
    curve: const Interval(0.375, 0.500, curve: Curves.ease),
  ),
);

스태거 메뉴 애니메이션

class _MenuState extends State<Menu> with SingleTickerProviderStateMixin {
  static const _initialDelayTime = Duration(milliseconds: 50);
  static const _itemSlideTime = Duration(milliseconds: 250);
  static const _staggerTime = Duration(milliseconds: 50);
  static const _buttonDelayTime = Duration(milliseconds: 150);
  static const _buttonTime = Duration(milliseconds: 500);

  final _animationDuration =
      _initialDelayTime +
      (_staggerTime * _menuTitles.length) +
      _buttonDelayTime +
      _buttonTime;

  late AnimationController _controller;

  @override
  void initState() {
    super.initState();
    _controller = AnimationController(
      duration: _animationDuration,
      vsync: this,
    );
    _controller.forward();
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }
}

스태거 모범 사례

  • 시간적으로 애니메이션을 오프셋하려면 Interval을 사용하세요
  • 컨트롤러 지속 시간이 모든 Interval을 포함하는지 확인하세요
  • Interval 내에서 자연스러운 동작을 위해 곡선을 사용하세요
  • 타이밍을 디버깅하려면 timeDilation을 고려하세요
  • 리플 효과를 위해 메뉴 항목을 지연 시간을 증가시켜 스태거하세요

물리 기반 애니메이션

물리 시뮬레이션을 사용하여 자연스러운 느낌의 애니메이션을 만듭니다.

플링 애니메이션

_controller.fling(
  velocity: 2.0,  // 초당 단위
);

사용자 정의 물리 시뮬레이션

_controller.animateWith(
  SpringSimulation(
    spring: const SpringDescription(
      mass: 1,
      stiffness: 100,
      damping: 10,
    ),
    start: 0.0,
    end: 1.0,
    velocity: 0.0,
  ),
);

일반적인 물리 시뮬레이션

  • SpringSimulation - 스프링 물리
  • BouncingScrollSimulation - 바운스가 있는 스크롤
  • ClampingScrollSimulation - 바운스가 없는 스크롤
  • GravitySimulation - 중력 기반

모범 사례

DO

  • 위젯 폐기 시 AnimationController를 폐기하세요
  • 리스너에서 setState() 대신 AnimatedBuilder/AnimatedWidget을 사용하세요
  • 자연스러운 동작을 위해 적절한 곡선을 선택하세요
  • 애니메이션 디버깅을 위해 timeDilation을 사용하세요
  • 성능을 고려하세요 (애니메이션 빌드에서 무거운 위젯 피하기)
  • 다양한 기기에서 애니메이션을 테스트하세요
  • 직관적인 느낌을 위해 역방향 애니메이션을 지원하세요

DON'T

  • AnimationController 폐기를 잊지 마세요 (메모리 누수)
  • AnimatedBuilder로 충분할 때 리스너에서 setState()를 사용하지 마세요
  • 애니메이션이 즉시 완료된다고 가정하지 마세요 (AnimationStatus 처리)
  • 과도하게 애니메이션하지 마세요 (애니메이션이 사용자를 방해할 수 있음)
  • "뚝뚝 끊기는" 느낌의 애니메이션을 만들지 마세요 (부드러운 곡선 사용)
  • 접근성을 무시하지 마세요 (disableAnimations 기본 설정 존중)

리소스

references/

implicit.md - 예제와 모범 사례가 포함된 암시적 애니메이션 위젯에 대한 완전한 참조.

explicit.md - 명시적 애니메이션, AnimationController 및 패턴에 대한 심층 분석.

hero.md - 표준 및 방사형 전환을 포함한 히어로 애니메이션 가이드.

staggered.md - 스태거 애니메이션 패턴 및 타이밍 전략.

physics.md - 물리 기반 애니메이션 및 시뮬레이션.

curves.md - Curves 클래스에 대한 참조 및 적절한 곡선 선택.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

관련 스킬