copyWith method Null safety

SliderThemeData copyWith(
  1. {double? trackHeight,
  2. Color? activeTrackColor,
  3. Color? inactiveTrackColor,
  4. Color? disabledActiveTrackColor,
  5. Color? disabledInactiveTrackColor,
  6. Color? activeTickMarkColor,
  7. Color? inactiveTickMarkColor,
  8. Color? disabledActiveTickMarkColor,
  9. Color? disabledInactiveTickMarkColor,
  10. Color? thumbColor,
  11. Color? overlappingShapeStrokeColor,
  12. Color? disabledThumbColor,
  13. Color? overlayColor,
  14. Color? valueIndicatorColor,
  15. SliderComponentShape? overlayShape,
  16. SliderTickMarkShape? tickMarkShape,
  17. SliderComponentShape? thumbShape,
  18. SliderTrackShape? trackShape,
  19. SliderComponentShape? valueIndicatorShape,
  20. RangeSliderTickMarkShape? rangeTickMarkShape,
  21. RangeSliderThumbShape? rangeThumbShape,
  22. RangeSliderTrackShape? rangeTrackShape,
  23. RangeSliderValueIndicatorShape? rangeValueIndicatorShape,
  24. ShowValueIndicator? showValueIndicator,
  25. TextStyle? valueIndicatorTextStyle,
  26. double? minThumbSeparation,
  27. RangeThumbSelector? thumbSelector,
  28. MaterialStateProperty<MouseCursor?>? mouseCursor}
)

Creates a copy of this object but with the given fields replaced with the new values.

Implementation

SliderThemeData copyWith({
  double? trackHeight,
  Color? activeTrackColor,
  Color? inactiveTrackColor,
  Color? disabledActiveTrackColor,
  Color? disabledInactiveTrackColor,
  Color? activeTickMarkColor,
  Color? inactiveTickMarkColor,
  Color? disabledActiveTickMarkColor,
  Color? disabledInactiveTickMarkColor,
  Color? thumbColor,
  Color? overlappingShapeStrokeColor,
  Color? disabledThumbColor,
  Color? overlayColor,
  Color? valueIndicatorColor,
  SliderComponentShape? overlayShape,
  SliderTickMarkShape? tickMarkShape,
  SliderComponentShape? thumbShape,
  SliderTrackShape? trackShape,
  SliderComponentShape? valueIndicatorShape,
  RangeSliderTickMarkShape? rangeTickMarkShape,
  RangeSliderThumbShape? rangeThumbShape,
  RangeSliderTrackShape? rangeTrackShape,
  RangeSliderValueIndicatorShape? rangeValueIndicatorShape,
  ShowValueIndicator? showValueIndicator,
  TextStyle? valueIndicatorTextStyle,
  double? minThumbSeparation,
  RangeThumbSelector? thumbSelector,
  MaterialStateProperty<MouseCursor?>? mouseCursor,
}) {
  return SliderThemeData(
    trackHeight: trackHeight ?? this.trackHeight,
    activeTrackColor: activeTrackColor ?? this.activeTrackColor,
    inactiveTrackColor: inactiveTrackColor ?? this.inactiveTrackColor,
    disabledActiveTrackColor: disabledActiveTrackColor ?? this.disabledActiveTrackColor,
    disabledInactiveTrackColor: disabledInactiveTrackColor ?? this.disabledInactiveTrackColor,
    activeTickMarkColor: activeTickMarkColor ?? this.activeTickMarkColor,
    inactiveTickMarkColor: inactiveTickMarkColor ?? this.inactiveTickMarkColor,
    disabledActiveTickMarkColor: disabledActiveTickMarkColor ?? this.disabledActiveTickMarkColor,
    disabledInactiveTickMarkColor: disabledInactiveTickMarkColor ?? this.disabledInactiveTickMarkColor,
    thumbColor: thumbColor ?? this.thumbColor,
    overlappingShapeStrokeColor: overlappingShapeStrokeColor ?? this.overlappingShapeStrokeColor,
    disabledThumbColor: disabledThumbColor ?? this.disabledThumbColor,
    overlayColor: overlayColor ?? this.overlayColor,
    valueIndicatorColor: valueIndicatorColor ?? this.valueIndicatorColor,
    overlayShape: overlayShape ?? this.overlayShape,
    tickMarkShape: tickMarkShape ?? this.tickMarkShape,
    thumbShape: thumbShape ?? this.thumbShape,
    trackShape: trackShape ?? this.trackShape,
    valueIndicatorShape: valueIndicatorShape ?? this.valueIndicatorShape,
    rangeTickMarkShape: rangeTickMarkShape ?? this.rangeTickMarkShape,
    rangeThumbShape: rangeThumbShape ?? this.rangeThumbShape,
    rangeTrackShape: rangeTrackShape ?? this.rangeTrackShape,
    rangeValueIndicatorShape: rangeValueIndicatorShape ?? this.rangeValueIndicatorShape,
    showValueIndicator: showValueIndicator ?? this.showValueIndicator,
    valueIndicatorTextStyle: valueIndicatorTextStyle ?? this.valueIndicatorTextStyle,
    minThumbSeparation: minThumbSeparation ?? this.minThumbSeparation,
    thumbSelector: thumbSelector ?? this.thumbSelector,
    mouseCursor: mouseCursor ?? this.mouseCursor,
  );
}