SliderThemeData constructor
- double? trackHeight,
- Color? activeTrackColor,
- Color? inactiveTrackColor,
- Color? secondaryActiveTrackColor,
- Color? disabledActiveTrackColor,
- Color? disabledInactiveTrackColor,
- Color? disabledSecondaryActiveTrackColor,
- Color? activeTickMarkColor,
- Color? inactiveTickMarkColor,
- Color? disabledActiveTickMarkColor,
- Color? disabledInactiveTickMarkColor,
- Color? thumbColor,
- Color? overlappingShapeStrokeColor,
- Color? disabledThumbColor,
- Color? overlayColor,
- Color? valueIndicatorColor,
- Color? valueIndicatorStrokeColor,
- SliderComponentShape? overlayShape,
- SliderTickMarkShape? tickMarkShape,
- SliderComponentShape? thumbShape,
- SliderTrackShape? trackShape,
- SliderComponentShape? valueIndicatorShape,
- RangeSliderTickMarkShape? rangeTickMarkShape,
- RangeSliderThumbShape? rangeThumbShape,
- RangeSliderTrackShape? rangeTrackShape,
- RangeSliderValueIndicatorShape? rangeValueIndicatorShape,
- ShowValueIndicator? showValueIndicator,
- TextStyle? valueIndicatorTextStyle,
- double? minThumbSeparation,
- RangeThumbSelector? thumbSelector,
- MaterialStateProperty<
MouseCursor?> ? mouseCursor, - SliderInteraction? allowedInteraction,
Create a SliderThemeData given a set of exact values.
This will rarely be used directly. It is used by lerp to create intermediate themes based on two themes.
The simplest way to create a SliderThemeData is to use copyWith on the one you get from SliderTheme.of, or create an entirely new one with SliderThemeData.fromPrimaryColors.
link
class Blissful extends StatefulWidget {
const Blissful({super.key});
@override
State createState() => BlissfulState();
}
class BlissfulState extends State<Blissful> {
double _bliss = 0;
@override
Widget build(BuildContext context) {
return SliderTheme(
data: SliderTheme.of(context).copyWith(activeTrackColor: const Color(0xff404080)),
child: Slider(
onChanged: (double value) { setState(() { _bliss = value; }); },
value: _bliss,
),
);
}
}
Implementation
const SliderThemeData({
this.trackHeight,
this.activeTrackColor,
this.inactiveTrackColor,
this.secondaryActiveTrackColor,
this.disabledActiveTrackColor,
this.disabledInactiveTrackColor,
this.disabledSecondaryActiveTrackColor,
this.activeTickMarkColor,
this.inactiveTickMarkColor,
this.disabledActiveTickMarkColor,
this.disabledInactiveTickMarkColor,
this.thumbColor,
this.overlappingShapeStrokeColor,
this.disabledThumbColor,
this.overlayColor,
this.valueIndicatorColor,
this.valueIndicatorStrokeColor,
this.overlayShape,
this.tickMarkShape,
this.thumbShape,
this.trackShape,
this.valueIndicatorShape,
this.rangeTickMarkShape,
this.rangeThumbShape,
this.rangeTrackShape,
this.rangeValueIndicatorShape,
this.showValueIndicator,
this.valueIndicatorTextStyle,
this.minThumbSeparation,
this.thumbSelector,
this.mouseCursor,
this.allowedInteraction,
});