FLUTTER ECOSYSTEM

holding_gesture

一个自定义的 GestureDetector,可在按住特定 Widget 时触发操作。

最新版本
1.2.0
近 30 天下载
9600
喜欢数
49
Pub 分数
150

Package Overview

基于插件公开资料生成的选型评价,仅供参考。

插件概览

holding_gesture 包提供了一个自定义的 GestureDetector,当用户在特定小部件上按住指定时长时触发操作。它扩展了 Flutter 内置的 GestureDetector,具备专用的按住检测功能,可实现响应式且直观的交互,例如长按菜单、拖拽启动或上下文敏感控制。该包轻量且兼容所有主要平台,包括移动设备、网页和桌面端。它简化了基于按住手势的实现,无需编写样板代码。

适合场景
  • Long-press context menus
  • Gesture-based navigation triggers
  • Interactive widget activation
  • Drag start detection
  • Customizable hold duration
  • Accessibility-enhanced controls
主要特点
  • Precise hold duration control
  • Cross-platform compatibility
  • Simple API integration
  • Configurable hold delay
  • Built-in callback handling
  • Minimal performance overhead
适合对象
  • Developers building interactive UIs
  • Apps requiring long-press functionality
  • Cross-platform Flutter projects
  • Accessibility-focused interfaces
  • Gesture-heavy applications
使用建议
  • Requires careful timing configuration
  • May conflict with other gesture detectors
  • Not suitable for rapid tap sequences
  • Needs testing on all target platforms
  • Limited to single-widget hold detection
  • Depends on Flutter's gesture system stability
支持平台AndroidiOSWebmacOSWindowsLinux

安装插件

flutter pub add holding_gesture

所属分类

源码仓库

关联项目