copyWith method

SwitchThemeData copyWith({
  1. MaterialStateProperty<Color?>? thumbColor,
  2. MaterialStateProperty<Color?>? trackColor,
  3. MaterialStateProperty<Color?>? trackOutlineColor,
  4. MaterialStateProperty<double?>? trackOutlineWidth,
  5. MaterialTapTargetSize? materialTapTargetSize,
  6. MaterialStateProperty<MouseCursor?>? mouseCursor,
  7. MaterialStateProperty<Color?>? overlayColor,
  8. double? splashRadius,
  9. MaterialStateProperty<Icon?>? thumbIcon,
})

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

Implementation

SwitchThemeData copyWith({
  MaterialStateProperty<Color?>? thumbColor,
  MaterialStateProperty<Color?>? trackColor,
  MaterialStateProperty<Color?>? trackOutlineColor,
  MaterialStateProperty<double?>? trackOutlineWidth,
  MaterialTapTargetSize? materialTapTargetSize,
  MaterialStateProperty<MouseCursor?>? mouseCursor,
  MaterialStateProperty<Color?>? overlayColor,
  double? splashRadius,
  MaterialStateProperty<Icon?>? thumbIcon,
}) {
  return SwitchThemeData(
    thumbColor: thumbColor ?? this.thumbColor,
    trackColor: trackColor ?? this.trackColor,
    trackOutlineColor: trackOutlineColor ?? this.trackOutlineColor,
    trackOutlineWidth: trackOutlineWidth ?? this.trackOutlineWidth,
    materialTapTargetSize: materialTapTargetSize ?? this.materialTapTargetSize,
    mouseCursor: mouseCursor ?? this.mouseCursor,
    overlayColor: overlayColor ?? this.overlayColor,
    splashRadius: splashRadius ?? this.splashRadius,
    thumbIcon: thumbIcon ?? this.thumbIcon,
  );
}