gpt4 book ai didi

flutter - 如何均匀地更改 Flutter 中 slider 的轨道高度?

转载 作者:行者123 更新时间:2023-12-04 14:33:58 26 4
gpt4 key购买 nike

我的代码:

          Padding(
padding: const EdgeInsets.symmetric(horizontal: 12),
child: SliderTheme(
data: SliderTheme.of(context).copyWith(
inactiveTrackColor: Color(0xff8d8e98),
activeTrackColor: Colors.white,
thumbColor: Color(0xffeb1555),
overlayColor: Color(0x29eb1555),
thumbShape: RoundSliderThumbShape(enabledThumbRadius: 15),
overlayShape: RoundSliderOverlayShape(overlayRadius: 30),
trackHeight: 2,
),
child: Slider(
value: 183,
min: 10,
max: 270,
onChanged: (double value) {},
),
),
),
我懂了:
bad
我期待这个:
OK
我怎么才能得到它?

最佳答案

这有点晚了,但是,因为我刚刚自己解决了这个问题,我认为它对其他人有用:
您应该在 SliderTheme 数据中包含以下内容:

trackShape: RectangularSliderTrackShape(),
就是这样,您将获得具有相同高度的事件和非事件轨道!

关于flutter - 如何均匀地更改 Flutter 中 slider 的轨道高度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63527693/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com