我想知道如何删除默认填充Flutter Slider
电流输出是这样的,默认填充滑块的形状清晰可见
这是我的代码::
Positioned(
child: Align(
alignment: Alignment.bottomLeft,
child: SliderTheme(
data: SliderTheme.of(context).copyWith(
trackHeight: 2.0,
thumbColor: Colors.transparent,
thumbShape: RoundSliderThumbShape(enabledThumbRadius: 0.0),
),
child: Container(
width: 380.0,
height: 20.0,
padding: EdgeInsets.all(0.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.blueAccent)
),
child: Slider(
value: 50,
min: 1,
max: 100,
divisions: 100,
activeColor: colors.primaryRed,
inactiveColor: Colors.white,
onChanged: (double newValue) {
print(newValue);
},
)
)
),
),
)
SliderThemeData(overlayShape: SliderComponentShape.noOverlay)
or
overlayShape: SliderComponentShape.noThumb
默认填充是由拇指绘画和覆盖绘画引起的,通过指定这些属性,您将删除它们,但您将获得零填充
https://api.flutter.dev/flutter/material/SliderThemeData-class.html https://api.flutter.dev/flutter/material/SliderThemeData-class.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)