패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.3.0

flutter_animate_on_scroll

스크롤 이벤트를 기반으로 위젯을 애니메이션화하는 플러터 패키지입니다. UI를 향상시키기 위해 매력적이고 인터랙티브한 스크롤 기반 애니메이션을 쉽게 만들 수 있습니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
106
좋아요
48
Pub 점수
160

패키지 설치

flutter pub add flutter_animate_on_scroll

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

위젯에 부드러운 스크롤 기반 애니메이션을 가능하게 하는 플러터 패키지입니다. 개발자가 스크롤 이벤트에 반응하여 동적이고 상호작용 가능한 사용자 인터페이스를 만들 수 있도록 합니다. 리스트, 카드 및 스크롤 레이아웃에서 시각적 참여도를 향상시키는 데 이상적입니다. 기존의 플러터 프로젝트와 원활하게 통합되며 여러 플랫폼을 지원하므로 크로스플랫폼 앱에 유연하게 활용할 수 있습니다.

사용 사례

  • 스크롤 트리거된 입구 애니메이션
  • 인터랙티브 목록 항목 효과
  • 파라럭스 스크롤 비주얼
  • 다이나믹 헤더 전환
  • 긴 스크롤 페이지에서 사용자 참여도 향상

주요 기능

  • 실시간 스크롤 이벤트 감지
  • 간단한 애니메이션 구성
  • 크로스 플랫폼 호환성
  • 다양한 애니메이션 유형을 지원합니다
  • 경량이며 통합이 쉬움

적합한 대상

  • 인터랙티브 요소를 찾는 UI 디자이너
  • 스크롤이 많은 인터페이스를 개발하는 개발자
  • 긴 콘텐츠 목록 또는 피드를 가진 앱
  • 미세한 움직임 피드백이 필요한 프로젝트
  • 크로스 플랫폼 모바일 및 웹 애플리케이션

고려 사항

  • 큰 목록에서 성능에 영향을 미칠 수 있습니다
  • 부드러움을 위해 신중한 튜닝이 필요합니다
  • 스크롤 기반 트리거에 한정
  • 복잡한 제스처 상호작용에 적합하지 않음
  • 최적화된 위젯 트리와 함께 사용하는 것이 가장 좋습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Flutter_animate_on_scroll

Enables you to create flutter animations on scroll, faster, efficient and with less code.

Features

  • Stunning default animation
  • Customizable animation

Getting started

Put the dependency inside your pubspec.yml and run packages get.

Usage

Provide required child [Widget], you can play with animation delay, curves, duration...

import './src/components/custom_info.dart';
import 'package:flutter/material.dart';
import 'package:flutter_animate_on_scroll/flutter_animate_on_scroll.dart';

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SingleChildScrollView(
        child: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 20).copyWith(top: 80),
          child: Column(
            children: [
              FadeIn(
                config: BaseAnimationConfig(
                  child: const CustomInfo(name: 'Fade In')
                ),
              ),
              const SizedBox(height: 20),
              FadeInDown(
                config: BaseAnimationConfig(
                  delay: 200.ms,
                  child: const CustomInfo(name: 'Fade In Down'),
                ),
              ),
              const SizedBox(height: 20),
              FadeInUp(
                config: BaseAnimationConfig(
                  delay: 400.ms,
                  child: const CustomInfo(name: 'Fade In Up'),
                ),
              ),
              const SizedBox(height: 20),
              FadeInLeft(
                config: BaseAnimationConfig(
                  delay: 600.ms,
                  child: const CustomInfo(name: 'Fade In Left'),
                ),
              ),
              const SizedBox(height: 20),
              FadeInRight(
                config: BaseAnimationConfig(
                  delay: 200.ms,
                  child: const CustomInfo(name: 'Fade In Right'),
                ),
              ),
              const SizedBox(height: 20),
              const Divider(),
              FadeOut(
                config: BaseAnimationConfig(
                  delay: 400.ms,
                  child: const CustomInfo(name: 'Fade Out'),
                ),
              ),
              const SizedBox(height: 20),
              FadeOutUp(
                config: BaseAnimationConfig(
                  delay: 600.ms,
                  child: const CustomInfo(name: 'Fade Out Up'),
                ),
              ),
              const SizedBox(height: 20),
              FadeOutDown(
                config: BaseAnimationConfig(
                  delay: 800.ms,
                  child: const CustomInfo(name: 'Fade Out Down'),
                ),
              ),
              const SizedBox(height: 20),
              FadeOutLeft(
                config: BaseAnimationConfig(
                  delay: 400.ms,
                  child: const CustomInfo(name: 'Fade Out Left'),
                ),
              ),
              const SizedBox(height: 20),
              FadeOutRight(
                config: BaseAnimationConfig(
                  delay: 600.ms,
                  child: const CustomInfo(name: 'Fade Out Right'),
                ),
              ),
              const SizedBox(height: 220),
            ],
          ),
        ),
      ),
    );
  }
}

Custom animation
import 'package:flutter/material.dart';
import 'package:flutter_animate_on_scroll/flutter_animate_on_scroll.dart';

import '../components/custom_info.dart';

class CustomAnimationExample extends StatefulWidget {
  const CustomAnimationExample({super.key});

  @override
  State<CustomAnimationExample> createState() => _CustomAnimationExampleState();
}

class _CustomAnimationExampleState extends State<CustomAnimationExample>
    with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin{
  late AnimationController _animationController;
  late Animation<double> _animation;

  @override
  void initState() {
    _animationController = AnimationController(vsync: this, duration: 600.ms);
    _animation = Tween<double>(begin: 0.3, end: 1.0).animate(
      CurvedAnimation(parent: _animationController, curve: Curves.bounceInOut),
    );
    super.initState();
  }

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SingleChildScrollView(
        child: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 20).copyWith(top: 80),
          child: Column(
            children: [
              CustomAnimated(
                animationController: _animationController,
                animation: _animation,
                child: ScaleTransition(
                  scale: _animation,
                  child: const CustomInfo(name: 'Custom Animation'),
                ),
              ),
              const SizedBox(height: 20),
              const Divider(),
              const SizedBox(height: 220),
            ],
          ),
        ),
      ),
    );
  }
}

Video Demo

https://github.com/FadiChaalab/flutter_animate_on_scroll/assets/58008170/25ed91f2-e2b0-4321-a077-b22248e69f55

Default Animations

Fade Animation

Fade Animation

  • FadeIn
  • FadeInDown
  • FadeInLeft
  • FadeInRight
  • FadeInUp
  • FadeOut
  • FadeOutDown
  • FadeOutLeft
  • FadeOutRight
  • FadeOutUp
Slide Animation

Slide Animation

  • SlideInDown
  • SlideInLeft
  • SlideInRight
  • SlideInUp
  • SlideOutDown
  • SlideOutLeft
  • SlideOutRight
  • SlideOutUp
Rotate Animation

Rotate Animation

  • RotateIn
  • RotateInDownLeft
  • RotateInDownRight
  • RotateInUpLeft
  • RotateInUpRight
  • RotateOut
  • RotateOutDownLeft
  • RotateOutDownRight
  • RotateOutUpLeft
  • RotateOutUpRight
Zoom Animation
  • ZoomIn
  • ZoomOut
Text Animation
  • Text typer animation with fade option
  • Text wavy effect

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.