FSlider constructor

FSlider({
  1. required FSliderController controller,
  2. FSliderStyle? style,
  3. FLayout? layout,
  4. Widget? label,
  5. Widget? description,
  6. Widget errorBuilder(
    1. BuildContext,
    2. String
    ) = _errorBuilder,
  7. List<FSliderMark> marks = const [],
  8. double? trackMainAxisExtent,
  9. double? trackHitRegionCrossExtent,
  10. Widget tooltipBuilder(
    1. FTooltipStyle,
    2. double
    ) = _tooltipBuilder,
  11. String semanticValueFormatterCallback(
    1. double
    ) = _semanticValueFormatter,
  12. String semanticFormatterCallback(
    1. FSliderSelection
    )?,
  13. FormFieldSetter<FSliderSelection>? onSaved,
  14. FormFieldValidator<FSliderSelection>? validator,
  15. String? forceErrorText,
  16. bool enabled = true,
  17. AutovalidateMode? autovalidateMode,
  18. Key? key,
})

Creates a FSlider.

Implementation

FSlider({
  required this.controller,
  this.style,
  this.layout,
  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 ?? 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.',
    );
  }
}