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

spring_button 封面
套件詳情v2.0.0

spring_button

一個簡單的 widget,用於包含對手勢做出反應的彈簧動畫的子 widget。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
661
喜歡數
42
Pub 分數
140

安裝套件

flutter pub add spring_button

套件介紹

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

SpringButton 是一個 Flutter widget,當子 widget 被按壓或互動時,會為其添加類似彈簧的動畫效果。它透過在點擊或拖曳等手勢上提供流暢、彈跳的反饋來提升使用者體驗。此動畫可自訂,並可在所有主要平台(包括 Android、iOS、Web、macOS、Windows 和 Linux)上運作。非常適合用來創造具有動態回應的吸引人按鈕與互動式 UI 元素。

適用情境

  • 建立帶有觸覺反饋的動畫按鈕
  • 增強移動應用中的觸控互動
  • 為網頁介面添加有趣的特效
  • 提升表單和控制項的使用者參與度
  • 為跨平台應用設計響應式UI組件

主要特色

  • 按壓時的彈簧動畫
  • 可自訂的動畫曲線
  • 跨平台相容性
  • 與現有組件的簡單整合
  • 支援點擊和拖曳手勢

適合對象

  • 尋求互動式 UI 元素的開發者
  • 想要趣味按鈕動畫的設計人員
  • 注重使用者體驗的應用
  • 跨平台 Flutter 項目
  • 原型化互動功能

使用建議

  • 如果過度使用,可能會影響效能
  • 需要仔細調整彈簧參數
  • 不適合極簡設計
  • 僅限基於手勢的互動
  • 動畫可能不適合注重可存取性的應用

原始 README

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

spring_button

Cosmos Software

Pub License

A simple widget for having child widgets that respond to gestures with a spring animation.

Media | Description | How-to-Use

Media

Watch on Youtube:

v1.0.0



Description

This is a simple widget for having child widgets that respond to gestures with a spring animation.

It is more of an extension to the GestureDetector widget than an original new widget.

How-to-Use

Simply create a SpringButton as shown in the example:

SpringButton(
    SpringButtonType.OnlyScale, //springButtonType
    uiChild(),                  //uiChild
    {Key key,
    useCache            : true,
    alignment           : Alignment.center,
    scaleCoefficient    : 0.75,
    onTapDown,
    onTapUp,
    onTap,
    onTapCancel,
    onSecondaryTapDown,
    onSecondaryTapUp,
    onSecondaryTapCancel,
    onDoubleTap,
    onLongPress,
    onLongPressStart,
    onLongPressMoveUpdate,
    onLongPressUp,
    onLongPressEnd,
    onVerticalDragDown,
    onVerticalDragStart,
    onVerticalDragUpdate,
    onVerticalDragEnd,
    onVerticalDragCancel,
    onHorizontalDragDown,
    onHorizontalDragStart,
    onHorizontalDragUpdate,
    onHorizontalDragEnd,
    onHorizontalDragCancel,
    onForcePressStart,
    onForcePressPeak,
    onForcePressUpdate,
    onForcePressEnd,
    onPanDown,
    onPanStart,
    onPanUpdate,
    onPanEnd,
    onPanCancel,
    onScaleStart,
    onScaleUpdate,
    onScaleEnd})
    
Widget uiChild() {}

Further Explanations:

For a complete set of descriptions for all parameters and methods, see the documentation.

  • SpringButton, as you can see, is very similar to a GestureDetector widget so it should be familiar.

Notes

I started using and learning Flutter only some weeks ago so this package might have some parts that don't make sense, that should be completely different, that could be much better, etc. Please let me know! Nicely!

Any help, suggestion or criticism is appreciated!

Cheers.





所屬分類

原始碼儲存庫

使用此套件的專案