FSlider constructor
FSlider({
- required FSliderController controller,
- FSliderStyle? style,
- Layout layout = Layout.ltr,
- Widget? label,
- Widget? description,
- Widget errorBuilder() = _errorBuilder,
- List<
FSliderMark> marks = const [], - double? trackMainAxisExtent,
- double? trackHitRegionCrossExtent,
- Widget tooltipBuilder() = _tooltipBuilder,
- String semanticValueFormatterCallback() = _semanticValueFormatter,
- String semanticFormatterCallback()?,
- FormFieldSetter<
FSliderSelection> ? onSaved, - FormFieldValidator<
FSliderSelection> ? validator, - String? forceErrorText,
- bool enabled = true,
- AutovalidateMode? autovalidateMode,
- Key? key,
Creates a FSlider.
Implementation
FSlider({
required this.controller,
this.style,
this.layout = Layout.ltr,
this.label,
this.description,
this.errorBuilder = _errorBuilder,
this.marks = const [],
this.trackMainAxisExtent,
this.trackHitRegionCrossExtent,
this.tooltipBuilder = _tooltipBuilder,
this.semanticValueFormatterCallback = _semanticValueFormatter,
String Function(FSliderSelection)? semanticFormatterCallback,
this.onSaved,
this.validator,
this.forceErrorText,
this.enabled = true,
this.autovalidateMode,
super.key,
}) : semanticFormatterCallback = semanticFormatterCallback ?? _formatter(controller) {
if (trackMainAxisExtent == null &&
(label != null || description != null || forceErrorText != null) &&
layout.vertical) {
throw StateError(
'A vertical FSlider was given a label, description, or forceErrorText although it needs a trackMainAxisExtent. '
'To fix this, consider supplying a trackMainAxisExtent or changing the layout to horizontal.',
);
}
}