copyWith method
Returns a new ButtonStyle instance with selectively updated properties.
Example:
final updated = primary.copyWith(
backgroundColor: '#004a99',
hoverColor: '#003366',
);
Implementation
ButtonStyle copyWith({
String? backgroundColor,
String? disabledColor,
TextStyle? textStyle,
BoxBorder? border,
String? hoverColor,
}) {
return ButtonStyle(
backgroundColor: backgroundColor ?? this.backgroundColor,
disabledColor: disabledColor ?? this.disabledColor,
textStyle: textStyle ?? this.textStyle,
border: border ?? this.border,
hoverColor: hoverColor ?? this.hoverColor,
);
}