搜尋套件、儲存庫與 APP 分類

套件詳情v0.3.0

flutter_animate_on_scroll

基於滾動事件動畫化元件的 Flutter 套件。輕鬆創造令人著迷的互動式滾動動畫,以提升您的使用者介面。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
106
喜歡數
48
Pub 分數
160

安裝套件

flutter pub add flutter_animate_on_scroll

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 套件,可為組件實現順暢的捲動驅動動畫。它允許開發人員透過回應捲動事件來建立動態且互動式的使用者介面。非常適合增強清單、卡片和捲動版面的視覺吸引力。此套件可無縫整合至現有的 Flutter 專案中,並支援多個平台,讓其適用於跨平台應用。

適用情境

  • 滾動觸發的進入動畫
  • 互動式列表項效果
  • 視差滾動視覺效果
  • 動態標題過渡
  • 增強長捲動頁面的使用者參與度

主要特色

  • 即時滾動事件檢測
  • 簡單的動畫設定
  • 跨平台相容性
  • 支援多種動畫類型
  • 輕量且易於整合

適合對象

  • 尋求互動元件的UI設計師
  • 開發滾動密集型介面的開發者
  • 包含長內容列表或資訊流的應用
  • 需要細微動態反饋的專案
  • 跨平台行動與Web應用

使用建議

  • 可能影響大型清單的效能
  • 需要仔細調校以確保順暢
  • 僅限基於滾動的觸發
  • 不適合複雜的手勢互動
  • 最佳搭配優化過的 widget 樹使用

原始 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

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。