copyWith method

BoxStyle copyWith({
  1. String? name,
  2. Border? border,
  3. Color? borderColor,
  4. BorderRadius? borderRadius,
  5. Color? color,
  6. BoxDecoration? decoration,
  7. double? height,
  8. EdgeInsets? padding,
  9. Color? textColor,
  10. double? textSize,
  11. TextStyle? textStyle,
  12. FontWeight? textWeight,
  13. double? width,
  14. Box? activeStyle,
  15. Box? disabledStyle,
  16. Box? errorStyle,
  17. Box? hoverStyle,
})

Implementation

BoxStyle copyWith({
  String? name,
  Border? border,
  Color? borderColor,
  BorderRadius? borderRadius,
  Color? color,
  BoxDecoration? decoration,
  double? height,
  EdgeInsets? padding,
  Color? textColor,
  double? textSize,
  TextStyle? textStyle,
  FontWeight? textWeight,
  double? width,
  Box? activeStyle,
  Box? disabledStyle,
  Box? errorStyle,
  Box? hoverStyle,
}) {
  return BoxStyle(
    name: name ?? this.name,
    color: color ?? this.color,
    padding: padding ?? this.padding,
    decoration: decoration ?? this.decoration,
    border: border ?? this.border,
    borderRadius: borderRadius ?? this.borderRadius,
    borderColor: borderColor ?? this.borderColor,
    textColor: textColor ?? this.textColor,
    textSize: textSize ?? this.textSize,
    textWeight: textWeight ?? this.textWeight,
    textStyle: this.textStyle.merge(textStyle),
    height: height ?? this.height,
    width: width ?? this.width,
    hoverStyle: this.hoverStyle.merge([hoverStyle]),
    activeStyle: this.activeStyle.merge([activeStyle]),
    errorStyle: this.errorStyle.merge([errorStyle]),
    disabledStyle: this.disabledStyle.merge([disabledStyle]),
  );
}