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

套件詳情v0.0.5

visual_effect

Flutter 的 VisualEffect API,可輕鬆為您的組件添加繪畫效果。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
329
喜歡數
72
Pub 分數
140

安裝套件

flutter pub add visual_effect

套件介紹

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

VisualEffect 是一個 Flutter 套件,可簡化將繪圖效果套用至組件的過程,讓開發者能以最少的程式碼增強視覺吸引力。它提供直觀的 API,可直接向使用者介面元素加入模糊、陰影和色彩濾鏡等效果。專為跨平台的順暢整合設計,支援 Android、iOS、Web、macOS、Windows 和 Linux。適用於建立具有豐富視覺反饋的動態介面,特別適合需要細微或戲劇性圖形增強的現代應用設計。

適用情境

  • 為背景添加模糊效果
  • 建立發光或陰影文字
  • 透過動態塗鴉效果增強按鈕
  • 設計沉浸式啟動畫面
  • 實現動畫疊加層
  • 對圖像應用顏色濾鏡

主要特色

  • 用於繪製效果的簡單 API
  • 跨平台相容性
  • 支援模糊、陰影和色彩濾鏡
  • 與現有組件的輕鬆整合
  • 高效能渲染
  • 即時效果調整

適合對象

  • 尋求視覺精緻的UI設計師
  • 開發現代應用程式介面的開發者
  • 需要動畫或互動式視覺效果的應用
  • 針對多個平台的專案
  • 原型化視覺豐富的元件

使用建議

  • 可能影響低階裝置的效能
  • 需要了解繪圖作業
  • 僅限視覺效果,不包含版面變更
  • 不適合複雜的動畫
  • 效果品質可能因平台而異

原始 README

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

visual_effect

VisualEffect API for Flutter to easily add paint effects on your widgets.

Warning This package is experimental for the moment. The API can change at any time.

Scroll Effect

The main purpose of this API is to provide an easy and efficiently way to apply scroll animations.

Warning The addRepaintBoundaries MUST be set to false in the parent Sliver/ScrollView because we explicitely want in that case to repaint for every single scroll so we can add the effect.

For example this Card Stack effect can be obtained with the code below:

Card Stack

class _ScrolledItem extends StatelessWidget {
  const _ScrolledItem();

  @override
  Widget build(BuildContext context) {
    return ScrollEffect(
      onGenerateVisualEffect: (effect, phase) {
        return effect
            .grayscale(phase.leadingLerp(to: 0.5))
            .scale(
              x: phase.isLeading ? phase.leadingLerp(from: 1, to: 0.9) : 1,
              anchor: Alignment.topCenter,
            )
            .translate(y: effect.childSize.height * phase.leading);
      },
      child: const _CardItem(),
    );
  }
}

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。