正如你在这张照片中看到的 正如您在图片中看到的那样,分隔线连接到轨道形状的角上,我希望它们稍微分开和留出空间。 我的代码是:
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SfSliderTheme(
data: SfSliderThemeData(
tickOffset: const Offset(0, 0),
activeTrackHeight: 15,
inactiveTrackHeight: 15,
thumbRadius: 8,
activeTrackColor: Colors.pink,
inactiveTrackColor: Colors.red.withOpacity(0.3),
activeDividerColor: Colors.white,
inactiveDividerColor: Colors.white,
thumbColor: const Color(0xff39b5ed),
tooltipBackgroundColor: const Color(0xff39b5ed),
tooltipTextStyle: const TextStyle(color: Colors.black),
// overlayColor: Colors.pink.withOpacity(0.0),
activeDividerRadius: 3.5,
inactiveDividerRadius: 3.5,
),
child: SfSlider(
tooltipShape: const SfRectangularTooltipShape(),
min: 1.0,
max: 5.0,
value: _value,
interval: 1,
showDividers: true,
// showTicks: true,
showLabels: true,
shouldAlwaysShowTooltip: true,
onChanged: (value) {
setState(() {
_value = value;
});
},
),
),
],
),
);
}
}
我到处找,一无所获