搜尋分類、套件與程式碼儲存庫

套件詳情v2.0.0

animated

一個非常簡單(但功能強大)的 Flutter 隱式動畫庫。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
8550
喜歡數
31
Pub 分數
130

安裝套件

flutter pub add animated

套件介紹

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

動畫套件是為Flutter設計的一個輕量級但功能強大的隱式動畫庫,旨在簡化平滑、宣告式動畫的建立。它提供直覺的API,用於動畫化不透明度、位置和縮放等屬性,而無需顯式管理AnimationController。非常適合尋求在多個平台使用簡潔、易讀程式碼來實現常見動畫模式的開發者。

適用情境

  • 建立漸入/漸出效果
  • 動畫化小部件位置
  • 使用平滑過渡縮放元件
  • 在使用者介面中加入細微的視覺回饋
  • 使用最少的程式碼建構互動式元件

主要特色

  • 隱式動畫處理
  • 最小化樣板程式碼
  • 跨平台支援
  • 用於常見動畫的簡單 API
  • 宣告式語法

適合對象

  • 初學者 Flutter 開發者
  • 需要快速動畫的專案
  • 以最少的 effort 實現 UI 增強
  • 針對多個平台的應用程式
  • 開發者避免使用複雜的動畫控制器

使用建議

  • 僅限基本動畫類型
  • 不適合複雜的自訂動畫
  • 可能需要額外的套件以實現進階效果
  • 與原始 AnimationController 相比,控制力較弱
  • 最適合簡單且可預測的動畫

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Animated

Animated is a very simple (yet powerful) implicit animation library made for Flutter.

Its goal is to be able to create a smooth animation between two values when an AnimatedContainer is not enough.

@override
Widget build(BuildContext context) {
  return Animated(
    value: 1.2,
    curve: Curves.easeInOut,
    duration: Duration(milliseconds: 300),
    builder: (context, child, animation) => Transform.scale(
      scale: animation.value,
      child: child,
    ),
    child: Container(
      width: 40,
      height: 40,
      color: Colors.red,
    ),
  );
}

In this example, whenever the value changes, the builder function will be called at each frame, from the old value to the new one.

Any widget that is not modified by the animation should be moved to the child property for optimization.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。