垂直滑动选择组件ListWheelScrollView
ListWheelChildLoopingListDelegate、ListWheelChildListDelegate
ListWheelScrollView.useDelegate(
itemExtent: 44,
diameterRatio: 3,
controller: _areaController,
physics: const FixedExtentScrollPhysics(),
perspective: 0.01,
onSelectedItemChanged: (value) {
selectIndex.value = value;
},
childDelegate: ListWheelChildListDelegate(
children: List<Widget>.generate(
cityList.length,
(index) => Container(
width: 375,
height: 44,
alignment: Alignment.center,
child: Obx(() => Text(cityList[index],
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: selectIndex.value == index
? FXColor.newMainTextColor
: FXColor.newSecTextDartColor)))),
),
))
IgnorePointer
- 用于隐藏子组件的点击事件,例如层叠结构中层级高的组件遮挡层级低组件点击事件,则可使用