copyWith method

ButtonStyle copyWith({
  1. Color? foregroundColor,
  2. Color? backgroundColor,
  3. Color? focusColor,
  4. Color? focusBackgroundColor,
  5. Color? disabledColor,
  6. Color? disabledBackgroundColor,
  7. EdgeInsets? padding,
  8. bool? bold,
})

Creates a copy of this style with the given fields replaced.

Implementation

ButtonStyle copyWith({
  Color? foregroundColor,
  Color? backgroundColor,
  Color? focusColor,
  Color? focusBackgroundColor,
  Color? disabledColor,
  Color? disabledBackgroundColor,
  EdgeInsets? padding,
  bool? bold,
}) {
  return ButtonStyle(
    foregroundColor: foregroundColor ?? this.foregroundColor,
    backgroundColor: backgroundColor ?? this.backgroundColor,
    focusColor: focusColor ?? this.focusColor,
    focusBackgroundColor: focusBackgroundColor ?? this.focusBackgroundColor,
    disabledColor: disabledColor ?? this.disabledColor,
    disabledBackgroundColor:
        disabledBackgroundColor ?? this.disabledBackgroundColor,
    padding: padding ?? this.padding,
    bold: bold ?? this.bold,
  );
}