Skip to main content
The Stac Slider allows you to build a Flutter Slider widget using JSON. To know more about the Slider widget in Flutter, refer to the official documentation.

Properties

PropertyTypeDescription
idStringThe id will be used to save the selected value of slider.
sliderTypeStacSliderTypeThe type of slider.
valuedoubleThe currently selected value for this slider.
secondaryTrackValuedoubleThe secondary track used to draw progress between the thumb and this value, over the inactive track.
onChangedStacActionCalled during a drag when the user is selecting a new value for the slider.
onChangeStartStacActionCalled when the user starts selecting a new value for the slider.
onChangeEndStacActionCalled when the user is done selecting a new value for the slider.
mindoubleThe minimum value the user can select.
maxdoubleThe maximum value the user can select.
divisionsintThe number of discrete divisions.
labelStringA label to show above the slider when the slider is active
activeColorStacColorThe color to use for the portion of the slider track that is active.
inactiveColorStacColorThe color for the inactive portion of the slider track.
secondaryActiveColorStacColorThe color to use for the portion of the slider track between the thumb and secondaryTrackValue
thumbColorStacColorThe color of the thumb.
overlayColorStacColorThe highlight color that’s typically used to indicate that the slider thumb is focused, hovered, or dragged.
mouseCursorStacMouseCursorThe cursor for a mouse pointer when it enters or is hovering over the widget.
autofocusboolTrue if this widget will be selected as the initial focus when no other node in its scope is currently focused.
allowedInteractionStacSliderInteractionAllowed way for the user to interact with the slider.

Example

StacScaffold(
  appBar: StacAppBar(
    title: StacText(data: 'Stac Slider'),
  ),
  body: StacForm(
    child: StacCenter(
      child: StacSlider(
        id: 'example_slider',
        sliderType: StacSliderType.material,
        value: 20,
        max: 100,
        divisions: 5,
      ),
    ),
  ),
)