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

tap_builder 封面
套件詳情v0.5.0

tap_builder

一個用於建構互動區域的簡單組件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
9060
喜歡數
113
Pub 分數
140

安裝套件

flutter pub add tap_builder

套件介紹

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

TapBuilder 是一個輕量級的 Flutter widget,旨在簡化互動式觸碰區域的建立。它提供一種乾淨、宣告式的方式來處理點擊手勢,並內建視覺反饋與狀態管理支援。適用於按鈕、可點擊卡片或任何需要回應式互動的 UI 元件,透過順暢的動畫與跨主要平台的手勢辨識,提升使用者體驗。該套件容易整合與維護,適合簡單與複雜的互動元件。

適用情境

  • 建立互動式按鈕
  • 構建可點擊的卡片
  • 實現手勢回應的使用者介面元素
  • 新增點擊時的視覺反饋
  • 設計觸控友善的介面

主要特色

  • 簡單的手勢處理
  • 內建視覺反饋
  • 跨平台相容性
  • 宣告式 API
  • 輕量且快速
  • 支援動畫轉場

適合對象

  • 初學者 Flutter 開發者
  • 互動式使用者介面設計
  • 行動與Web應用程式
  • 需要觸控回應的應用程式
  • 尋求最小觸控解決方案的開發者

使用建議

  • 僅限輕觸手勢
  • 無內建長按或拖曳支援
  • 需要手動自訂以處理複雜互動
  • 不適合高頻率手勢偵測
  • 最適合基本的觸控互動

原始 README

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

tap_builder

screenshot

A simple widget for building interactive areas. It is an alternative to the material's Inkwell that allows customizing the visual effects.

Quickstart

 @override
Widget build(BuildContext context) {
    return TapBuilder(
        onTap: () {},
        builder: (context, state, isFocused) => AnimatedContainer(
            padding: EdgeInsets.symmetric(
                vertical: 10,
                horizontal: 20,
            ),
            duration: const Duration(milliseconds: 500),
            decoration: BoxDecoration(
                border: Border.all(
                    color: Colors.white.withOpacity(isFocused ? 0.2 : 0.0),
                    width: 2,
                ),
                color: () {
                    switch (state) {
                        case TapState.disabled:
                            return Colors.grey;
                        case TapState.hover:
                            return Colors.blue;
                        case TapState.inactive:
                            return Colors.amberAccent;
                        case TapState.pressed:
                            return Colors.red;
                    }
                }(),
            ),
            child: Text('Button'),
        ),
    );
}

Example

See the full example

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。