copyWith method Null safety
- {MaterialStateProperty<
Color?> ? thumbColor, - MaterialStateProperty<
Color?> ? trackColor, - MaterialTapTargetSize? materialTapTargetSize,
- MaterialStateProperty<
MouseCursor?> ? mouseCursor, - MaterialStateProperty<
Color?> ? overlayColor, - double? splashRadius}
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,
MaterialTapTargetSize? materialTapTargetSize,
MaterialStateProperty<MouseCursor?>? mouseCursor,
MaterialStateProperty<Color?>? overlayColor,
double? splashRadius,
}) {
return SwitchThemeData(
thumbColor: thumbColor ?? this.thumbColor,
trackColor: trackColor ?? this.trackColor,
materialTapTargetSize: materialTapTargetSize ?? this.materialTapTargetSize,
mouseCursor: mouseCursor ?? this.mouseCursor,
overlayColor: overlayColor ?? this.overlayColor,
splashRadius: splashRadius ?? this.splashRadius,
);
}