我想在颤动的ListWheelScrollView.useDelegate中添加一个自动滚动系统几秒钟。我的ListWheelChildLoopingListDelegate正在生成一个无限小部件循环。
是否可以通过单击按钮将此循环滚动几秒钟?
我的代码在这里:
return Container(
height: 125,
width: ScreenSize.width * 0.3,
child: ListWheelScrollView.useDelegate(
diameterRatio: 1,
squeeze: 1.8,
itemExtent: 75,
physics: FixedExtentScrollPhysics(),
onSelectedItemChanged: (index) => print(index),
childDelegate: ListWheelChildLoopingListDelegate(
children: List<Widget>.generate(
slotNames.length,
(index) => Padding(
padding: const EdgeInsets.all(3.0),
child: Container(
decoration: BoxDecoration(
border: Border.all(
color: Colors.blue,
),
borderRadius: BorderRadius.circular(10.0),
),
child: Image.asset(
"assets/$index.png",
width: double.infinity,
height: double.infinity,
),
),
),
),
),
),
);