【发布时间】:2021-05-27 12:34:16
【问题描述】:
我正在尝试设置滑块覆盖颜色,但它似乎只有在我注释掉 overlayShape: RoundSliderThumbShape(enabledThumbRadius: 30), 时才有效我如何设置两者?
附言相关部分代码用cmets标记
SliderTheme(
data: SliderTheme.of(context).copyWith(
activeTrackColor: kDefaultColor,
inactiveTrackColor: kDefaultColor,
thumbColor: kButtonColor,
thumbShape: RoundSliderThumbShape(enabledThumbRadius: 15),
overlayShape: RoundSliderThumbShape(enabledThumbRadius: 30), //focus here
overlayColor: Colors.red //focus here
),
child: Slider(
value: sliderValue.toDouble(),
max: 220,
min: 110,
onChanged: (double value) {
setState(() {
sliderValue = value.round();
});
},
),
),
【问题讨论】:
-
我无法设置
overlayColor。你是怎么做到的?