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

flutter_fader 封面
套件詳情v2.0.1

flutter_fader

一個 Flutter 小部件,可讓您淡入和淡出子小部件。當子小部件淡出時,它將從樹中移除(無法與其互動)

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
52
喜歡數
9
Pub 分數
160

安裝套件

flutter pub add flutter_fader

套件介紹

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

Flutter Fader 是一個輕量級的動畫小部件,可平滑地淡入淡出子小部件。當淡出時,子小部件將從組件樹中移除,確保無法與之互動。非常適合用於創建乾淨、響應式的使用者介面過渡效果,例如載入指示器、對話框或動態內容更新。該套件支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,使其在跨平台應用中具有高度彈性。它可無縫整合至 Flutter 的動畫系統中,且設定簡單。

適用情境

  • 載入狀態轉換
  • 模式或對話方塊動畫
  • 動態內容可見性
  • 使用者介面回饋
  • 平滑的螢幕元素變更

主要特色

  • 平滑的淡入/淡出動畫
  • 淡出時從樹中移除子項
  • 跨平台相容性
  • 最小設定
  • 與 Flutter 的無縫整合
  • 支援所有主要平台

適合對象

  • 需要簡單漸隱漸現效果的開發者
  • 具有動態 UI 元素的應用程式
  • 跨平台專案
  • UI/UX 增強
  • 需要可見性控制的互動元件

使用建議

  • 子組件在淡出後未被保留
  • 不適合用於持續性UI元素
  • 在狀態上下文中需要小心處理
  • 僅限淡入淡出過渡
  • 無內建的反向動畫控制

原始 README

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

flutter_fader

pub package codecov style: flutter lints License: MIT

A widget for Flutter that allows you to fade in and out a child widget.
When a widget is faded out it is no longer in the view tree. Meaning that it can't be used or interacted with. Handy for hiding buttons.

Example of fader with buttons Example of fader with scroll

Getting started

In your Flutter project, add the package to your dependencies

dependencies:
  ...
  flutter_fader: ^2.0.0

Usage example

Examples of how to use the widget, and that can also be ran on your device, can be found in the example directory

Import the fader package

import 'package:flutter_fader/flutter_fader.dart';

Create a fader controller, this allows you to control when the Fader fades in or out

FaderController faderController = new FaderController();

Create a fader widget, and pass it the fader controller

Fader(
  controller: faderController,
  duration: const Duration(milliseconds: 50),
  child: Text("Hello, world!"),
)

Now you can fade the child widget in and out at will

faderController.fadeOut();
faderController.fadeIn();

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。