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

套件詳情v2.0.0

flutter_swipe_detector

一個用於檢測您的滑動方向並提供回調來處理它們的套件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
3740
喜歡數
61
Pub 分數
140

安裝套件

flutter pub add flutter_swipe_detector

套件介紹

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

flutter_swipe_detector 是一個 Flutter 套件,可偵測多個方向的滑動手勢——上、下、左和右,並為每個方向提供可自訂的回呼。它簡化了應用程式中滑動互動的實作,非常適合用於圖片輪播、導航面板或互動式教學等功能。此套件支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux,確保在各裝置上行為一致。透過最少的設定,開發者即可將響應式滑動邏輯整合至其 UI 中。

適用情境

  • 圖片滑塊
  • 導航面板
  • 互動式引導
  • 基於手勢的控制
  • 滑動關閉介面

主要特色

  • 方向性滑動手勢檢測
  • 可自訂的回調
  • 跨平台支援
  • 簡單整合
  • 可設定的靈敏度

適合對象

  • 開發手勢驅動的使用者介面的開發者
  • 需要滑動導航的應用
  • 互動式教學螢幕
  • 具有觸控互動的行動與網路應用程式

使用建議

  • 可能需要針對不同裝置的敏感度進行調整
  • 僅限基本滑動方向
  • 不適合複雜的多點觸控手勢

原始 README

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

Flutter Swipe Detector

Author: Jop Middelkamp

A package to detect your swipe directions and provides you with callbacks to handle them.

Usage

SwipeDetector(
  onSwipe: (direction, offset) {
    _addSwipe(direction);
  },
  onSwipeUp: (offset) {
    _addSwipe(SwipeDirection.up);
  },
  onSwipeDown: (offset) {
    _addSwipe(SwipeDirection.down);
  },
  onSwipeLeft: (offset) {
    _addSwipe(SwipeDirection.left);
  },
  onSwipeRight: (offset) {
    _addSwipe(SwipeDirection.right);
  },
  child: const Container(
    padding: EdgeInsets.all(16),
    child: Text(
      'Swipe me!',
      style: TextStyle(
        fontWeight: FontWeight.bold,
      ),
    ),
  ),
),

所屬分類

原始碼儲存庫

使用此套件的專案