【发布时间】:2019-11-04 08:05:06
【问题描述】:
我有一个 ListWheelScrollView 小部件。我需要当我滚动列表时,所选项目的字体颜色会发生变化,例如突出显示。如何实施?
更新:仍然不知道如何实现这个...
body: new Column(
children: <Widget>[
ListWheelScrollView.useDelegate(
perspective: 0.001,
diameterRatio: 10,
useMagnifier: true,
itemExtent: _itemHeight,
childDelegate: ListWheelChildLoopingListDelegate(
children: _values
.map(
(value) => SizedBox(
width: MediaQuery.of(context).size.width,
height: _itemHeight,
child: Container(
margin: EdgeInsets.fromLTRB(0, 0.0, 0.0, 3),
color: Colors.white,
child: Align(
alignment: Alignment.center,
child: Text(
'$value',
textAlign: TextAlign.center,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 17,
color:
Color...,
),
),
),
),
),
),
)
.toList(),
),
)),
],
),
),
);
}
}
【问题讨论】:
-
发布完整代码。
标签: flutter