FSlider class
An input where the user selects a value from within a given range.
A slider is a form field and therefore can be used within a Form widget.
See:
- https://forui.dev/docs/form/slider for working examples.
- FContinuousSliderController.new for selecting a single continuous value.
- FContinuousSliderController.range for selecting continuous range.
- FDiscreteSliderController.new for selecting a discrete value.
- FDiscreteSliderController.range for selecting a discrete range.
- FSliderStyles for customizing a slider's appearance.
- Inheritance
Constructors
-
FSlider({required FSliderController controller, FSliderStyle? style, FLayout? layout, Widget? label, Widget? description, Widget errorBuilder(BuildContext, String) = _errorBuilder, List<
FSliderMark> marks = const [], double? trackMainAxisExtent, double? trackHitRegionCrossExtent, Widget tooltipBuilder(FTooltipStyle, double) = _tooltipBuilder, String semanticValueFormatterCallback(double) = _semanticValueFormatter, String semanticFormatterCallback(FSliderSelection)?, FormFieldSetter<FSliderSelection> ? onSaved, FormFieldValidator<FSliderSelection> ? validator, String? forceErrorText, bool enabled = true, AutovalidateMode? autovalidateMode, Key? key}) - Creates a FSlider.
Properties
- autovalidateMode → AutovalidateMode?
-
Used to enable/disable this form field auto validation and update its error text.
final
- controller → FSliderController
-
The controller.
final
- description → Widget?
-
The description.
final
- enabled → bool
-
True if the slider is enabled.
final
- errorBuilder → Widget Function(BuildContext, String)
-
The builder for errors displayed below the description. Defaults to displaying the error message.
final
- forceErrorText → String?
-
An optional property that forces the FormFieldState into an error state
by directly setting the FormFieldState.errorText property without
running the validator function.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → Widget?
-
The label.
final
- layout → FLayout?
-
The layout. Defaults to the current TextDirection.
final
-
marks
→ List<
FSliderMark> -
The marks.
final
-
onSaved
→ FormFieldSetter<
FSliderSelection> ? -
An optional method to call with the final value when the form is saved via FormState.save.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticFormatterCallback → String Function(FSliderSelection)
-
A callback that formats the semantic label for the slider. Defaults to announcing the percentages the active track
occupies.
final
- semanticValueFormatterCallback → String Function(double)
-
A callback that formats the semantic label for the slider's thumb. Defaults to announcing the percentage.
final
- style → FSliderStyle?
-
The style.
final
- tooltipBuilder → Widget Function(FTooltipStyle, double)
-
A builder that creates the tooltip. Defaults to printing the current percentage.
final
- trackHitRegionCrossExtent → double?
-
The extent of the track's hit region in the cross-axis direction.
final
- trackMainAxisExtent → double?
-
The extent of the track along the main axis. Defaults to occupying the maximum amount of space possible along the
main axis.
final
-
validator
→ FormFieldValidator<
FSliderSelection> ? -
An optional method that validates an input. Returns an error string to
display if the input is invalid, or null otherwise.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
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