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

animate_icons 封面
套件詳情v2.0.0

animate_icons

這是一個插件,藉由它,您可以像預設提供的 AnimatedIcon 小工具一樣,在任意兩個圖示之間進行動畫切換。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
2510
喜歡數
210
Pub 分數
140

安裝套件

flutter pub add animate_icons

套件介紹

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

animate_icons 是一個 Flutter 套件,可實現任意兩個圖示之間的平滑動畫,類似於內建的 AnimatedIcon 小工具。它提供了一種彈性的方法,在自訂圖示對之間以流暢的動作進行過渡,從而增強使用者介面的互動性。此套件支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,非常適合跨平台應用程式。透過最少的設定,開發者可以輕鬆將動畫圖示過渡整合到他們的應用程式中。

適用情境

  • 按鈕中的動畫圖示過渡
  • 互動式 UI 元素
  • 帶圖標變化的加載指示器
  • 自訂切換動畫
  • 增強應用回饋
  • 引導畫面

主要特色

  • 在任意兩個圖標之間實現平滑動畫
  • 跨平台支援
  • 簡單的 API 結合
  • 可自訂的動畫持續時間
  • 支援 Material 與 Cupertino 圖示
  • 可擴展以支援自訂圖示集

適合對象

  • 尋求動態互動的UI/UX設計師
  • 開發互動式表單的開發者
  • 需要視覺反饋的應用程式
  • 跨平台行動與網頁應用程式
  • 原型化動畫介面

使用建議

  • 需要具備基本的 Flutter 動畫知識
  • 如果過度使用,可能會影響效能
  • 僅限圖示到圖示的過渡
  • 不適合複雜的動畫
  • 建議節制使用以獲得最佳使用者體驗

原始 README

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

Animate Any two icons with this plugin

Demo:
How to use:

All plugin in your pubspec.yaml

animate_icons:

Make the import:

import 'package:animate_icons/animate_icons.dart';

Use the following widget:

AnimateIcons(
    startIcon: Icons.add_circle,
    endIcon: Icons.add_circle_outline,
    size: 100.0,
    controller: controller,
    // add this tooltip for the start icon
    startTooltip: 'Icons.add_circle',
    // add this tooltip for the end icon
    endTooltip: 'Icons.add_circle_outline',
    size: 60.0,
    onStartIconPress: () {
        print("Clicked on Add Icon");
        return true;
    },
    onEndIconPress: () {
        print("Clicked on Close Icon");
        return true;
    },
    duration: Duration(milliseconds: 500),
    startIconColor: Colors.deepPurple,
    endIconColor: Colors.deepOrange,
    clockwise: false,
),

Use AnimateIconController

Define AnimateIconController to animate b/w start and end icons without onIco press, check which icon is there on top - start or end.

Define AnimateIconController

AnimateIconController controller;

Initialize controller

controller = AnimateIconController();

Pass controller to widget
AnimateIcons(
    startIcon: Icons.add,
    endIcon: Icons.close,
    controller: controller, 
    size: 60.0,
    onStartIconPress: () {
        print("Clicked on Add Icon");
        return true;
    },
    onEndIconPress: () {
        print("Clicked on Close Icon");
        return true;
    },
    duration: Duration(milliseconds: 500),
    startIconColor: Colors.deepPurple,
    endIconColor: Colors.deepOrange,
    clockwise: false,
),
Use controller functions
if (controller.isStart()) {
    controller.animateToEnd();
} else if (controller.isEnd()) {
    controller.animateToStart();
}

所屬分類

原始碼儲存庫

使用此套件的專案