copyWith method

SubHeaderCell copyWith({
  1. double? width,
  2. String? text,
  3. Color? backgroundColor,
})

Creates a copy of this SubHeaderCell but with the given fields replaced with new values.

This is essential for the ReportDesignBuilder to dynamically update properties like width during the layout phase.

Implementation

SubHeaderCell copyWith({
  double? width,
  String? text,
  Color? backgroundColor,
}) {
  return SubHeaderCell(
    text: text ?? this.text,
    span: span,
    backgroundColor: backgroundColor ?? this.backgroundColor,
    foregroundColor: foregroundColor,
    borderColor: borderColor,
    width: width ?? this.width,
    height: height,
    textSize: textSize,
    textAlignment: textAlignment,
  );
}