copyWith method

ZeroSwitchStyle copyWith({
  1. Color? activeColor,
  2. Color? inactiveColor,
  3. Color? activeThumbColor,
  4. Color? inactiveThumbColor,
  5. double? thumbSize,
})

If the caller passes in a value for a parameter, use that value, otherwise use the value from this object.

A new instance of ZeroSwitchStyle with the same properties as the original instance, except for the properties that are explicitly overridden.

Implementation

ZeroSwitchStyle copyWith({
  Color? activeColor,
  Color? inactiveColor,
  Color? activeThumbColor,
  Color? inactiveThumbColor,
  double? thumbSize,
}) {
  return ZeroSwitchStyle(
    activeColor: activeColor ?? this.activeColor,
    inactiveColor: inactiveColor ?? this.inactiveColor,
    activeThumbColor: activeThumbColor ?? this.activeThumbColor,
    inactiveThumbColor: inactiveThumbColor ?? this.inactiveThumbColor,
    thumbSize: thumbSize ?? this.thumbSize,
  );
}