HSlider

Class
A highly customizable slider widget that can be used for sliders and scrollbars.

Fields

axis: Axis
controller: SliderController
enabled: bool
focusKey: Key
initialValue: float
onChanged: Action<float>
reverse: bool
scrollController: ScrollController
thumbSize: float

Constructors

HSlider(scrollController: ScrollController, focusKey: Key, axis: Axis, reverse: bool, thumbSize: float, style: HSliderStyle, boxModifiers: WidgetStateProperty<ModifierSet>, key: Key, constants: object[], modifiers: IReadOnlyCollection<Modifier>)
Creates a highly customizable scrolling slider widget based on the given scrollController.

Parameters

scrollController:ScrollController - The scroll controller whose scroll position will be linked to the slider's value. The slider will automatically update its value when the scroll position changes.
focusKey:Key - The key that will be used by the main interactive element of the button. Can be used for focus management using GlobalKey.
axis:Axis - Sets the axis direction of the slider. Defaults to Axis.Vertical.
reverse:bool - Reverses the direction of the slider if true.
thumbSize:float - Sets the fixed size of the slider thumb. If smaller than 0, the thumb size will be calculated relative to the size of the slider based on the controller's SliderController.ThumbRange.
style:HSliderStyle - A predefined button style to change the visual appearance of the slider. If not specified, the current PrimitiveTheme.Scrollbar theme will be used.
boxModifiers:WidgetStateProperty<ModifierSet> - Defines additional modifiers that will get applied to the slider's main interactive element.
key:Key - Passed on to Widget.key.
constants:object[] - Passed on to Widget.constants.
modifiers:IReadOnlyCollection<Modifier> - Passed on to Widget.modifiers.
HSlider(controller: SliderController, focusKey: Key, axis: Axis, enabled: bool, reverse: bool, initialValue: float, thumbSize: float, onChanged: Action<float>, boxModifiers: WidgetStateProperty<ModifierSet>, style: HSliderStyle, key: Key, constants: object[], modifiers: IReadOnlyCollection<Modifier>)
Creates a highly customizable slider widget that can be used for sliders and scrollbars.

Parameters

controller:SliderController - The controller used to manage the slider's value and WidgetState. If not specified, a controller will be created and managed by the slider's state.
focusKey:Key - The key that will be used by the main interactive element of the button. Can be used for focus management using GlobalKey.
axis:Axis - Sets the axis direction of the slider. Defaults to Axis.Horizontal.
enabled:bool - Sets WidgetState.Disabled if no controller is specified.
reverse:bool - Reverses the direction of the slider if true.
initialValue:float - Sets the initial value if no controller is specified.
thumbSize:float - Sets the fixed size of the slider thumb. If smaller than 0, the thumb size will be calculated relative to the size of the slider based on the controller's SliderController.ThumbRange.
onChanged:Action<float> - Sets the SliderController.onChanged action if no controller is specified.
boxModifiers:WidgetStateProperty<ModifierSet> - Defines additional modifiers that will get applied to the slider's main interactive element.
style:HSliderStyle - A predefined button style to change the visual appearance of the slider. If not specified, the current PrimitiveTheme.Slider theme will be used.
key:Key - Passed on to Widget.key.
constants:object[] - Passed on to Widget.constants.
modifiers:IReadOnlyCollection<Modifier> - Passed on to Widget.modifiers.

Methods

CreateState(): State<HSlider>

Inherited Members

Extension Methods

ToDiagnosticsNodeSafeIfClipConstDisplayExpandFillFlexibleMarginOpacityPaddingPositionedShrinkSizeStretchTightStretchTightVisibilityWithModifierToBuildableToFactoryDescribeIdentityShortHashToStringNullable

On this page