copyWith method

Box copyWith({
  1. Color? color,
  2. double? height,
  3. double? width,
  4. EdgeInsets? padding,
  5. Border? border,
  6. BorderRadius? borderRadius,
  7. Color? borderColor,
  8. BoxDecoration? decoration,
  9. Color? textColor,
  10. FontWeight? textWeight,
  11. double? textSize,
  12. TextStyle? textStyle,
})

Implementation

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