copyWith method

SliderTheme copyWith({
  1. ValueGetter<double?>? trackHeight,
  2. ValueGetter<Color?>? trackColor,
  3. ValueGetter<Color?>? valueColor,
  4. ValueGetter<Color?>? disabledTrackColor,
  5. ValueGetter<Color?>? disabledValueColor,
  6. ValueGetter<Color?>? thumbColor,
  7. ValueGetter<Color?>? thumbBorderColor,
  8. ValueGetter<Color?>? thumbFocusedBorderColor,
  9. ValueGetter<double?>? thumbSize,
})

Returns a copy of this theme with the given fields replaced.

Implementation

SliderTheme copyWith({
  ValueGetter<double?>? trackHeight,
  ValueGetter<Color?>? trackColor,
  ValueGetter<Color?>? valueColor,
  ValueGetter<Color?>? disabledTrackColor,
  ValueGetter<Color?>? disabledValueColor,
  ValueGetter<Color?>? thumbColor,
  ValueGetter<Color?>? thumbBorderColor,
  ValueGetter<Color?>? thumbFocusedBorderColor,
  ValueGetter<double?>? thumbSize,
}) {
  return SliderTheme(
    trackHeight: trackHeight == null ? this.trackHeight : trackHeight(),
    trackColor: trackColor == null ? this.trackColor : trackColor(),
    valueColor: valueColor == null ? this.valueColor : valueColor(),
    disabledTrackColor: disabledTrackColor == null
        ? this.disabledTrackColor
        : disabledTrackColor(),
    disabledValueColor: disabledValueColor == null
        ? this.disabledValueColor
        : disabledValueColor(),
    thumbColor: thumbColor == null ? this.thumbColor : thumbColor(),
    thumbBorderColor:
        thumbBorderColor == null ? this.thumbBorderColor : thumbBorderColor(),
    thumbFocusedBorderColor: thumbFocusedBorderColor == null
        ? this.thumbFocusedBorderColor
        : thumbFocusedBorderColor(),
    thumbSize: thumbSize == null ? this.thumbSize : thumbSize(),
  );
}