FSlider constructor
FSlider({
- required FSliderController? controller,
- FSliderStyle? style,
- FLayout? layout,
- Widget? label,
- Widget? description,
- Widget errorBuilder() = FFormFieldProperties.defaultErrorBuilder,
- List<
FSliderMark> marks = const [], - FSliderSelection? initialSelection,
- double? trackMainAxisExtent,
- double? trackHitRegionCrossExtent,
- Widget tooltipBuilder() = _tooltipBuilder,
- String semanticValueFormatterCallback() = _semanticValueFormatter,
- String semanticFormatterCallback()?,
- ValueChanged<
FSliderSelection> ? onChange, - FormFieldSetter<
FSliderSelection> ? onSaved, - FormFieldValidator<
FSliderSelection> ? validator, - String? forceErrorText,
- bool enabled = true,
- AutovalidateMode autovalidateMode = AutovalidateMode.disabled,
- Key? key,
Creates a FSlider.
Implementation
FSlider({
required this.controller,
this.style,
this.layout,
this.label,
this.description,
this.errorBuilder = FFormFieldProperties.defaultErrorBuilder,
this.marks = const [],
this.initialSelection,
this.trackMainAxisExtent,
this.trackHitRegionCrossExtent,
this.tooltipBuilder = _tooltipBuilder,
this.semanticValueFormatterCallback = _semanticValueFormatter,
this.semanticFormatterCallback,
this.onChange,
this.onSaved,
this.validator,
this.forceErrorText,
this.enabled = true,
this.autovalidateMode = AutovalidateMode.disabled,
super.key,
}) : assert(
controller == null || initialSelection == null,
'Cannot provide both controller and initialSelection at the same time.',
) {
if (trackMainAxisExtent == null &&
(label != null || description != null || forceErrorText != null) &&
(layout?.vertical ?? false)) {
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.',
);
}
}