SfSlider.vertical constructor
const
SfSlider.vertical({
- Key? key,
- dynamic min = 0.0,
- dynamic max = 1.0,
- required dynamic value,
- required ValueChanged? onChanged,
- ValueChanged? onChangeStart,
- ValueChanged? onChangeEnd,
- double? interval,
- double? stepSize,
- SliderStepDuration? stepDuration,
- int minorTicksPerInterval = 0,
- bool showTicks = false,
- bool showLabels = false,
- bool showDividers = false,
- bool enableTooltip = false,
- bool shouldAlwaysShowTooltip = false,
- bool isInversed = false,
- Color? activeColor,
- Color? inactiveColor,
- LabelPlacement labelPlacement = LabelPlacement.onTicks,
- EdgeLabelPlacement edgeLabelPlacement = EdgeLabelPlacement.auto,
- NumberFormat? numberFormat,
- DateFormat? dateFormat,
- DateIntervalType? dateIntervalType,
- LabelFormatterCallback? labelFormatterCallback,
- TooltipTextFormatterCallback? tooltipTextFormatterCallback,
- SfSliderSemanticFormatterCallback? semanticFormatterCallback,
- SfTrackShape trackShape = const SfTrackShape(),
- SfDividerShape dividerShape = const SfDividerShape(),
- SfOverlayShape overlayShape = const SfOverlayShape(),
- SfThumbShape thumbShape = const SfThumbShape(),
- SfTickShape tickShape = const SfTickShape(),
- SfTickShape minorTickShape = const SfMinorTickShape(),
- SfTooltipShape tooltipShape = const SfRectangularTooltipShape(),
- Widget? thumbIcon,
- SliderTooltipPosition tooltipPosition = SliderTooltipPosition.left,
Creates a vertical SfSlider.
TooltipPosition
Enables tooltip in left or right position for vertical slider.
Defaults to SliderTooltipPosition.left.
Example
This snippet shows how to create a vertical SfSlider with right side tooltip.
double _value = 4.0;
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: SfSlider.vertical(
min: 0.0,
max: 10.0,
value: _value,
enableTooltip: true,
tooltipPosition: SliderTooltipPosition.right,
onChanged: (dynamic newValue) {
setState(() {
_value = newValue;
});
},
)
)
)
);
}
See also:
- Check the default constructor for horizontal slider.
Implementation
const SfSlider.vertical(
{Key? key,
this.min = 0.0,
this.max = 1.0,
required this.value,
required this.onChanged,
this.onChangeStart,
this.onChangeEnd,
this.interval,
this.stepSize,
this.stepDuration,
this.minorTicksPerInterval = 0,
this.showTicks = false,
this.showLabels = false,
this.showDividers = false,
this.enableTooltip = false,
this.shouldAlwaysShowTooltip = false,
this.isInversed = false,
this.activeColor,
this.inactiveColor,
this.labelPlacement = LabelPlacement.onTicks,
this.edgeLabelPlacement = EdgeLabelPlacement.auto,
this.numberFormat,
this.dateFormat,
this.dateIntervalType,
this.labelFormatterCallback,
this.tooltipTextFormatterCallback,
this.semanticFormatterCallback,
this.trackShape = const SfTrackShape(),
this.dividerShape = const SfDividerShape(),
this.overlayShape = const SfOverlayShape(),
this.thumbShape = const SfThumbShape(),
this.tickShape = const SfTickShape(),
this.minorTickShape = const SfMinorTickShape(),
this.tooltipShape = const SfRectangularTooltipShape(),
this.thumbIcon,
SliderTooltipPosition tooltipPosition = SliderTooltipPosition.left})
: _sliderType = SliderType.vertical,
_tooltipPosition = tooltipPosition,
assert(tooltipShape is! SfPaddleTooltipShape),
assert(min != max),
assert(interval == null || interval > 0),
super(key: key);