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

yoda 封面
套件詳情v1.0.1

yoda

Flutter 小部件,可將任何類型的子小部件切分成矩陣狀的磚塊,並以多種方式動畫顯示。目前支援爆炸、漩渦和碎屑效果。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
70
喜歡數
57
Pub 分數
130

安裝套件

flutter pub add yoda

套件介紹

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

Yoda 是一個 Flutter 小部件,可讓開發者將任何子小部件劃分為磚塊網格,並使用各種效果(如爆炸、漩渦和雪花)進行動畫處理。它專為在應用程式中創建動態且視覺上吸引人的過渡效果而設計。該套件支援 Android、iOS、Web、macOS、Windows 和 Linux 等多個平台,使其適用於跨平台開發。透過 pub add 簡單整合,Yoda 可透過可自訂的動畫增強使用者介面的互動性。

適用情境

  • 建立動畫啟動畫面
  • 設計頁面之間的互動式過渡
  • 為按鈕點擊增添視覺魅力
  • 動畫顯示影像或內容
  • 增強入門體驗

主要特色

  • 基於瓦片的動畫切片
  • 多種動畫類型(爆炸、漩渦、雪花)
  • 跨平台相容性
  • 與 pub 的輕鬆整合
  • 可自定義的動畫參數
  • 跨裝置的順暢效能

適合對象

  • 尋求創意動畫的UI設計師
  • 開發互動式應用程式介面的開發者
  • 需要動態內容過渡的項目
  • 原型設計引人入勝的使用者體驗
  • 具有強大視覺敘事能力的應用程式

使用建議

  • 大量瓦片數量可能影響效能
  • 需要仔細調校才能實現流暢的動畫
  • 僅限靜態子組件,除非與狀態管理結合使用
  • 不適合簡單、極簡的設計
  • 動畫複雜度可能會增加建構時間

原始 README

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

Yoda Flutter plugin

Flutter widget that let's you slice any kind of child widget in a matrix of tiles and animate them with different kind of ways. Currently with Explode, Vortex and Flakes. Works on all platforms.

Screenshot

Yoda Widget Properties

Yoda widget
  • [yodaEffect] Animation effect to use (see below).
  • [controller] Animation controller.
  • [duration] Animation duration.
  • [startWhenTapped] Enable tap gesture to start animation.
  • [animParameters] Parameters used to animate tiles (see below).
  • [child] Whatever widget to slice.
YodaEffect enum
  • [Explosion]
  • [Vortex]
  • [Flakes]
AnimParameters properties
  • [yodaBarrier] Define which edges are barraged (see below).
  • [hTiles] Number of horizontal tiles to divide the child widget.
  • [vTiles] Number of vertical tiles to divide the child widget.
  • [fractionalCenter] Default center where force is given when not tapping on it.
  • [gravity] Vertical force.
  • [effectPower] Effect strength.
  • [blurPower] Blur strength.
  • [randomness] Random strength.
YodaBarrier properties
  • [left] Block tiles moving over the left edge.
  • [right] Block tiles moving over the right edge.
  • [top] Block tiles moving over the top edge.
  • [bottom] Block tiles moving over the bottom edge.

How to use

If you need to control the animation status:

late YodaController _yodaControllerExplode;
  
@override
  void initState() {
    super.initState();
    _yodaControllerExplode = YodaController()
    ..addStatusListener((status) {
      if (status == AnimationStatus.completed) {
        _yodaControllerExplode.reset();
      }
    });
  }

YodaController accepts start() and reset() methods. Note: calling those methods will not work when a setState() is called at the same time.

Yoda(
  yodaEffect: YodaEffect.Explosion,
  controller: _yodaControllerExplode,
  duration: Duration(milliseconds: 2500),
  animParameters: AnimParameters(
    yodaBarrier: YodaBarrier(bottom: true, left: true, right: true),
    fractionalCenter: Offset(0.5, 1.0),
    hTiles: 20,
    vTiles: 20,
    effectPower: 0.2,
    blurPower: 5,
    gravity: 0.1,
    randomness: 30,
  ),
  startWhenTapped: true,
  child: SizedBox(
    width: 250,
    height: 180,
    child: Image.asset('assets/dash.png', fit: BoxFit.fill)
  )
)

TODO
  • Find a better way to capture the widget
  • When changing Yoda widget parameters, 2 hot reloads are needed to make it to work!

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。