ShadSlider class

A customizable slider widget styled to match the Shadcn UI design system.

Allows users to select a value from a continuous range by dragging a thumb along a track.

Inheritance
Available extensions

Constructors

ShadSlider({Key? key, double? initialValue, ValueChanged<double>? onChanged, bool enabled = true, double? min, double? max, FocusNode? focusNode, bool autofocus = false, MouseCursor? mouseCursor, MouseCursor? disabledMouseCursor, Color? thumbColor, Color? disabledThumbColor, Color? thumbBorderColor, Color? disabledThumbBorderColor, Color? activeTrackColor, Color? inactiveTrackColor, Color? disabledActiveTrackColor, Color? disabledInactiveTrackColor, double? trackHeight, double? thumbRadius, ValueChanged<double>? onChangeStart, ValueChanged<double>? onChangeEnd, int? divisions, String? label, String semanticFormatterCallback(double value)?, ShadSliderInteraction? allowedInteraction, ShadSliderController? controller})
Creates a ShadSlider.
const

Properties

activeTrackColor Color?
The color of the active portion of the slider track.
final
allowedInteraction ShadSliderInteraction?
Configures how the user can interact with the slider.
final
autofocus bool
Whether the slider should automatically focus when it is first built.
final
controller ShadSliderController?
A controller for the ShadSlider widget, managing its value.
final
disabledActiveTrackColor Color?
The color of the active track when the slider is disabled.
final
disabledInactiveTrackColor Color?
The color of the inactive track when the slider is disabled.
final
disabledMouseCursor MouseCursor?
The cursor for the slider when it is disabled.
final
disabledThumbBorderColor Color?
The border color of the slider thumb when disabled.
final
disabledThumbColor Color?
The color of the slider thumb when disabled.
final
divisions int?
The number of discrete divisions the slider has.
final
enabled bool
Whether the slider is enabled.
final
focusNode FocusNode?
The focus node to control the focus state of the slider.
final
hashCode int
The hash code for this object.
no setterinherited
inactiveTrackColor Color?
The color of the inactive portion of the slider track.
final
initialValue double?
The initial value of the slider.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label String?
A label to display above the slider when the thumb is pressed.
final
max double?
The maximum value the slider can take.
final
min double?
The minimum value the slider can take.
final
mouseCursor MouseCursor?
The cursor for the slider when it is enabled.
final
onChanged ValueChanged<double>?
Callback that is called when the slider value changes.
final
onChangeEnd ValueChanged<double>?
Callback that is called when the user finishes changing the slider value.
final
onChangeStart ValueChanged<double>?
Callback that is called when the user starts to change the slider value.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticFormatterCallback String Function(double value)?
A semantic formatter to be called by assistive technologies.
final
thumbBorderColor Color?
The border color of the slider thumb when enabled.
final
thumbColor Color?
The color of the slider thumb when enabled.
final
thumbRadius double?
The radius of the slider thumb.
final
trackHeight double?
The height of the slider track.
final

Methods

animate({Key? key, List<Effect>? effects, AnimateCallback? onInit, AnimateCallback? onPlay, AnimateCallback? onComplete, bool? autoPlay, Duration? delay, AnimationController? controller, Adapter? adapter, double? target, double? value}) Animate

Available on Widget, provided by the AnimateWidgetExtensions extension

Wraps the target Widget in an Animate instance, and returns the instance for chaining calls. Ex. myWidget.animate() is equivalent to Animate(child: myWidget).
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<ShadSlider>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
positionedWith(ShadPosition position) Widget

Available on Widget, provided by the PositionedExt extension

toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited