搜索插件、代码仓与 APP 分类

clickable_list_wheel_view 封面
插件详情v0.2.0

clickable_list_wheel_view

ListWheelScrollView 的简单包装,允许子项响应手势(onTap)事件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
1170
喜欢数
88
Pub 分数
150

安装插件

flutter pub add clickable_list_wheel_view

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个简单的 ListWheelScrollView 包装器,可对单个子项启用点击交互。它通过允许用户响应 onTap 事件来增强默认的滚动轮功能,非常适合在 Flutter 应用中创建交互式列表轮。该包在保持 ListWheelScrollView 的流畅滚动行为的同时,为每个项目添加了手势识别功能。兼容所有主要平台,轻量且易于集成,配置需求极少。

适合场景

  • 交互式可滚动菜单
  • 轮盘中的可点击项目选择
  • 带有触摸反馈的可自定义下拉菜单
  • 游戏化UI组件
  • 动态内容导航

主要特点

  • ListWheelScrollView 项目上的轻触检测
  • 最小化设置和集成
  • 跨平台兼容性
  • 保留原生滚动行为
  • 轻量且高效
  • 支持自定义 onTap 回调

适合对象

  • 开发人员构建交互式列表轮盘
  • 需要基于触摸选择项目的应用
  • 带有旋转或旋转列表的 UI
  • 需要响应式轮组件的项目
  • Flutter 初学者探索手势处理

使用建议

  • 可能需要额外的样式以提供视觉反馈
  • 不适用于高频点击场景
  • 限制为单次点击交互
  • 性能取决于物品的复杂程度
  • 不支持长按或拖动手势

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

pub package

clickable_list_wheel_view

Simple wrapper for ListWheelScrollView that allows children to respond on gesture (onTap) events

Animated

Installation

In the dependencies: section of your pubspec.yaml, add the following line:

dependencies:
    clickable_list_wheel_view: latest_version

Usage

Basic

You can get started really simple, just add


ClickableListWheelScrollView(
  scrollController: _scrollController,
  itemHeight: _itemHeight,
  itemCount: _itemCount,
  onItemTapCallback: (index) {
    print("onItemTapCallback index: $index");
  },
  child: ListWheelScrollView.useDelegate(
    controller: _scrollController,
    itemExtent: _itemHeight,
    physics: FixedExtentScrollPhysics(),
    overAndUnderCenterOpacity: 0.5,
    perspective: 0.002,
    onSelectedItemChanged: (index) {
      print("onSelectedItemChanged index: $index");
    },
    childDelegate: ListWheelChildBuilderDelegate(
      builder: (context, index) => _child(index),
      childCount: _itemCount,
    ),
  ),
)

Full Api

  ///  Required. The [child] which the wrapper will target to
  final ListWheelScrollView child;

  /// Required. Must be the same for list and wrapper
  final ScrollController scrollController;

  /// Optional. ListWheelScrollView height
  final double listHeight;

  /// Required. Height of one child in ListWheelScrollView
  final double itemHeight;

  /// Required. Number of items in ListWheelScrollView
  final int itemCount;

  /// If true the list will scroll on click
  final bool scrollOnTap;

  /// Set a handler for listening to a `tap` event
  final OnItemTapCallback onItemTapCallback;

  /// sets the duration of the scroll  animation
  final Duration animationDuration;
  
  /// use with ListWheelChildLoopingListDelegate
  final bool loop;

所属分类

源码仓库

使用此插件的项目

暂无相关数据。