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):