copyWith method
- @useResult
- FWidgetStateMap<
Color> ? activeColor, - FWidgetStateMap<
Color> ? inactiveColor, - BorderRadius? borderRadius,
- double? crossAxisExtent,
- double? thumbSize,
- FSliderThumbStyle thumbStyle()?,
- FSliderMarkStyle markStyle()?,
- FTooltipStyle tooltipStyle()?,
- AlignmentGeometry? tooltipTipAnchor,
- AlignmentGeometry? tooltipThumbAnchor,
- EdgeInsetsGeometry? labelPadding,
- EdgeInsetsGeometry? descriptionPadding,
- EdgeInsetsGeometry? errorPadding,
- EdgeInsetsGeometry? childPadding,
- FWidgetStateMap<
TextStyle> ? labelTextStyle, - FWidgetStateMap<
TextStyle> ? descriptionTextStyle, - TextStyle? errorTextStyle,
Returns a copy of this FSliderStyle with the given properties replaced.
Where possible, it is strongly recommended to use the CLI to generate a style and directly modify the style.
activeColor
The slider's active track colors.
Supported states:
inactiveColor
The slider's inactive track colors.
Supported states:
borderRadius
The slider's border radius.
crossAxisExtent
The slider's cross-axis extent. Defaults to 8.
Contract:
Throws AssertionError if it is not positive.
thumbSize
The thumb's size. Defaults to 25
on touch platforms and 20
on non-touch platforms.
Contract
Throws AssertionError if thumbSize
is not positive.
Implementation details
This unfortunately has to be placed outside of FSliderThumbStyle because FSliderThumbStyle is inside FSliderStyle. Putting the thumb size inside FSliderThumbStyle will cause a cyclic rebuild to occur whenever the window is resized due to a bad interaction between an internal LayoutBuilder and SliderFormField.
thumbStyle
The slider thumb's style.
markStyle
The slider marks' style.
tooltipStyle
The tooltip's style.
tooltipTipAnchor
The anchor of the tooltip to which the tooltipThumbAnchor
is aligned.
Defaults to Alignment.bottomCenter on primarily touch devices and Alignment.centerLeft on non-primarily touch devices.
tooltipThumbAnchor
The anchor of the thumb to which the tooltipTipAnchor
is aligned.
Defaults to Alignment.topCenter on primarily touch devices and Alignment.centerRight on non-primarily touch devices.
labelPadding
The label's padding.
descriptionPadding
The description's padding.
errorPadding
The error's padding.
childPadding
The child's padding.
labelTextStyle
The label's text style.
Supported states:
descriptionTextStyle
The description's text style.
Supported states:
errorTextStyle
The error's text style.
Implementation
@useResult
FSliderStyle copyWith({
FWidgetStateMap<Color>? activeColor,
FWidgetStateMap<Color>? inactiveColor,
BorderRadius? borderRadius,
double? crossAxisExtent,
double? thumbSize,
FSliderThumbStyle Function(FSliderThumbStyle)? thumbStyle,
FSliderMarkStyle Function(FSliderMarkStyle)? markStyle,
FTooltipStyle Function(FTooltipStyle)? tooltipStyle,
AlignmentGeometry? tooltipTipAnchor,
AlignmentGeometry? tooltipThumbAnchor,
EdgeInsetsGeometry? labelPadding,
EdgeInsetsGeometry? descriptionPadding,
EdgeInsetsGeometry? errorPadding,
EdgeInsetsGeometry? childPadding,
FWidgetStateMap<TextStyle>? labelTextStyle,
FWidgetStateMap<TextStyle>? descriptionTextStyle,
TextStyle? errorTextStyle,
}) => FSliderStyle(
activeColor: activeColor ?? this.activeColor,
inactiveColor: inactiveColor ?? this.inactiveColor,
borderRadius: borderRadius ?? this.borderRadius,
crossAxisExtent: crossAxisExtent ?? this.crossAxisExtent,
thumbSize: thumbSize ?? this.thumbSize,
thumbStyle: thumbStyle != null ? thumbStyle(this.thumbStyle) : this.thumbStyle,
markStyle: markStyle != null ? markStyle(this.markStyle) : this.markStyle,
tooltipStyle: tooltipStyle != null ? tooltipStyle(this.tooltipStyle) : this.tooltipStyle,
tooltipTipAnchor: tooltipTipAnchor ?? this.tooltipTipAnchor,
tooltipThumbAnchor: tooltipThumbAnchor ?? this.tooltipThumbAnchor,
labelPadding: labelPadding ?? this.labelPadding,
descriptionPadding: descriptionPadding ?? this.descriptionPadding,
errorPadding: errorPadding ?? this.errorPadding,
childPadding: childPadding ?? this.childPadding,
labelTextStyle: labelTextStyle ?? this.labelTextStyle,
descriptionTextStyle: descriptionTextStyle ?? this.descriptionTextStyle,
errorTextStyle: errorTextStyle ?? this.errorTextStyle,
);