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

flutter_bounce 封面
套件詳情v1.1.0

flutter_bounce

一個高效的 Flutter 套件,用於點擊時對包裝的 widget 實現彈跳動畫。它適用於 iOS 和 Android 兩大移動平台。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1150
喜歡數
162
Pub 分數
140

安裝套件

flutter pub add flutter_bounce

套件介紹

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

flutter_bounce 是一個輕量且高效能的 Flutter 套件,可為任何包裝的 widget 加上平滑的點擊彈跳動畫。專為 iOS 與 Android 設計,透過細微且即時的回饋來提升使用者互動體驗。此套件可無縫整合至現有的 UI 中,且無性能負擔,非常適合按鈕、卡片及其他互動元件。支援多個平台,包含 Web、macOS、Windows 與 Linux,確保在各類裝置上行為一致。

適用情境

  • 為按鈕添加觸覺反饋
  • 增強卡片點擊互動
  • 提高應用程式的回應速度
  • 創建引人入勝的使用者介面微互動
  • 支援跨平台一致性

主要特色

  • 點擊彈跳動畫
  • 輕量且高效
  • 跨平台支援
  • 輕鬆整合
  • 可自訂的動畫強度

適合對象

  • 行動應用程式開發人員
  • UI/UX 設計師
  • 互動式原型建構器
  • 跨平台應用開發者
  • 需要細微觸覺反饋的應用

使用建議

  • 僅限點擊基礎的動畫
  • 無進階動畫自訂
  • 可能與其他手勢檢測器衝突
  • 最適合簡單的互動元件
  • 不適用於複雜的動畫序列

原始 README

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

flutter_bounce

pub_package git_license build

  • An efficient flutter package for an on-tap bounce animation on any flutter widgets
  • This package is an enhanced version of bouncing_widget.
  • Limitation of the bouncing_widget package:
    • It is not efficient for the widgets in Scroll Pages. We cannot scroll while having our fingers on the widget
    • The same issue would be found here

Advantages of flutter_bounce

  • Flutter bounce package will give you full freedom, to be used in on both the static and dynamic like scrolling pages.
  • Not sticky on scrolling, efficient bounce effect every where
  • With Duration, controll the bounce animation
  • It doesn't let the widget stay pressed when you scroll through, if we use the normal bounce effect with simply using the Flutter AnimationController and Tranform.scale() Widget.

Disclaimer

  • Widget flutter_widget is not the copy paste of bouncing_widget, it works differently. Without limitations, and the functionality works differently, based upon the duration, and not on the scaleFactor.
  • It doesn't have the scaleFactor at all, which is required in the widget
  • The code written in such a way that supports the flutter_bounce functionality. However, I have taken motivation from the limitations of the bouncing_widget

Usage

To use this plugin, add flutter_bounce as a dependency in your pubspec.yaml file.

Demo

This is how the Bounce Widget works when wrapped around the widget. The below shows Bounce being used in both the scenario:

  1. Static Page with Duration set facility
  2. Scroll Page with default Duration as 100 ms:
    • Horizontal Scroll
    • Vertical Scroll

Example

  • Import the library
import 'package:flutter_bounce/flutter_bounce.dart';
  • In order to use this package, we just need to wrap the content with the widget Bounce.
  • child, duration and onPressed is mandatory in the widget.
  • However, onPressed and duration can have null in the widget. By default duration is set to 100 milliseconds.
  • Please Note: Always pass the duration in milliseconds for best result
Bounce(
  duration: Duration(milliseconds: 110),
  onPressed: (){ YOUR_FUNCTION },
  child: YOUR_WIDGET
)

Acknowledgement

  • I would like to thank Levent Kantaroğlu for contributing in the recent null safety addition to the code, which will now help the community to use this package efficiently.
  • I would like to thank ThomasEcalle for the indirect motivation via his widget, to come up with an efficient work around, which will now be useful for our flutter community people

所屬分類

原始碼儲存庫

使用此套件的專案