copyWith method

  1. @override
M3ESwitchTheme copyWith({
  1. double? trackWidth,
  2. double? trackHeight,
  3. double? trackPadding,
  4. double? thumbSizePressed,
  5. double? thumbSizeSelected,
  6. double? thumbSizeUnselected,
  7. double? thumbSizeWithIcon,
  8. double? stateLayerSize,
  9. double? targetSize,
  10. double? iconSize,
  11. double? borderWidth,
  12. double? disabledTrackOpacity,
  13. double? disabledThumbOpacity,
  14. double? disabledSelectedHandleOpacity,
  15. double? disabledOutlineOpacity,
  16. double? hoverStateLayerOpacity,
  17. double? focusStateLayerOpacity,
  18. double? pressedStateLayerOpacity,
  19. double? focusIndicatorThickness,
  20. double? focusIndicatorOffset,
  21. Color? focusIndicatorColor,
  22. bool clearFocusIndicatorColor = false,
  23. M3ESpring? positionSpring,
  24. M3ESpring? sizeSpring,
})
override

Returns a copy with non-null fields replaced.

Implementation

@override
M3ESwitchTheme copyWith({
  double? trackWidth,
  double? trackHeight,
  double? trackPadding,
  double? thumbSizePressed,
  double? thumbSizeSelected,
  double? thumbSizeUnselected,
  double? thumbSizeWithIcon,
  double? stateLayerSize,
  double? targetSize,
  double? iconSize,
  double? borderWidth,
  double? disabledTrackOpacity,
  double? disabledThumbOpacity,
  double? disabledSelectedHandleOpacity,
  double? disabledOutlineOpacity,
  double? hoverStateLayerOpacity,
  double? focusStateLayerOpacity,
  double? pressedStateLayerOpacity,
  double? focusIndicatorThickness,
  double? focusIndicatorOffset,
  Color? focusIndicatorColor,
  bool clearFocusIndicatorColor = false,
  M3ESpring? positionSpring,
  M3ESpring? sizeSpring,
}) {
  return M3ESwitchTheme(
    trackWidth: trackWidth ?? this.trackWidth,
    trackHeight: trackHeight ?? this.trackHeight,
    trackPadding: trackPadding ?? this.trackPadding,
    thumbSizePressed: thumbSizePressed ?? this.thumbSizePressed,
    thumbSizeSelected: thumbSizeSelected ?? this.thumbSizeSelected,
    thumbSizeUnselected: thumbSizeUnselected ?? this.thumbSizeUnselected,
    thumbSizeWithIcon: thumbSizeWithIcon ?? this.thumbSizeWithIcon,
    stateLayerSize: stateLayerSize ?? this.stateLayerSize,
    targetSize: targetSize ?? this.targetSize,
    iconSize: iconSize ?? this.iconSize,
    borderWidth: borderWidth ?? this.borderWidth,
    disabledTrackOpacity: disabledTrackOpacity ?? this.disabledTrackOpacity,
    disabledThumbOpacity: disabledThumbOpacity ?? this.disabledThumbOpacity,
    disabledSelectedHandleOpacity:
        disabledSelectedHandleOpacity ?? this.disabledSelectedHandleOpacity,
    disabledOutlineOpacity:
        disabledOutlineOpacity ?? this.disabledOutlineOpacity,
    hoverStateLayerOpacity:
        hoverStateLayerOpacity ?? this.hoverStateLayerOpacity,
    focusStateLayerOpacity:
        focusStateLayerOpacity ?? this.focusStateLayerOpacity,
    pressedStateLayerOpacity:
        pressedStateLayerOpacity ?? this.pressedStateLayerOpacity,
    focusIndicatorThickness:
        focusIndicatorThickness ?? this.focusIndicatorThickness,
    focusIndicatorOffset: focusIndicatorOffset ?? this.focusIndicatorOffset,
    focusIndicatorColor: clearFocusIndicatorColor
        ? null
        : (focusIndicatorColor ?? this.focusIndicatorColor),
    positionSpring: positionSpring ?? this.positionSpring,
    sizeSpring: sizeSpring ?? this.sizeSpring,
  );
}