RollerList 是一个 Flutter 小部件,模拟物理滚轮的行为,允许在有限的项目集合中实现无限滚动。它非常适合创建引人入胜、交互性强的界面,例如抽奖轮盘或数字旋转器。该小部件可平滑地动画化项目过渡,并支持自定义样式和事件回调。专为跨平台使用而设计,在 Android、iOS、Web、macOS、Windows 和 Linux 上均可无缝运行。非常适合游戏化体验和奖励系统。
适合场景
游戏化用户界面
奖品轮盘实现
数字或项目旋转器
互动奖励系统
数字老虎机
动画选择器
主要特点
有限项目中的无限滚动
平滑的动画过渡
跨平台兼容性
可自定义项目外观
选择事件回调
支持多个平台
适合对象
游戏开发者
奖励应用创作者
交互式UI设计工具
Flutter 初学者探索动画
需要引人入胜的选择机制的应用程序
使用建议
最适合小型到中型项目集
对于大型数据集,可能需要进行性能调优
局限于视觉吸引力,而非复杂的数据处理
不适合标准列表导航
需要仔细设计以确保可访问性
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
roller_list package
This widget is a list of values distributed in a circle. The main rules of the list are: a user could scroll it in one direction endlessly, list values are limited and repeated in the same order over and over again.
Possible usage scheme:
-time selection
-piano notes selection
-choice of any limited number of items, where it is not important what should go first and what should go last.
Example
You can check Flutter for web build here
Or see how it looks like on iphone:
How to use
In the dependencies: section of your pubspec.yaml, add the following line:
roller_list: <latest version>
Then import this class:
import'package:roller_list/roller_list.dart';
And add your list like this (with only programmatical scroll):