copyWith method
ReportTemplate
copyWith({
- String? id,
- String? name,
- String? description,
- ReportType? reportType,
- double? pageWidth,
- double? pageHeight,
- PageFormat? pageFormat,
- double? marginTop,
- double? marginBottom,
- double? marginLeft,
- double? marginRight,
- int? itemsPerRow,
- int? itemsPerColumn,
- double? horizontalGap,
- double? verticalGap,
- double? itemWidth,
- double? itemHeight,
- List<
ReportElement> ? elements, - String? dataSchemaName,
- DataSchema? dataSchema,
Implementation
ReportTemplate copyWith({
String? id,
String? name,
String? description,
ReportType? reportType,
double? pageWidth,
double? pageHeight,
PageFormat? pageFormat,
double? marginTop,
double? marginBottom,
double? marginLeft,
double? marginRight,
int? itemsPerRow,
int? itemsPerColumn,
double? horizontalGap,
double? verticalGap,
double? itemWidth,
double? itemHeight,
List<ReportElement>? elements,
String? dataSchemaName,
DataSchema? dataSchema,
}) {
return ReportTemplate(
id: id ?? this.id,
name: name ?? this.name,
description: description ?? this.description,
reportType: reportType ?? this.reportType,
pageWidth: pageWidth ?? this.pageWidth,
pageHeight: pageHeight ?? this.pageHeight,
pageFormat: pageFormat ?? this.pageFormat,
marginTop: marginTop ?? this.marginTop,
marginBottom: marginBottom ?? this.marginBottom,
marginLeft: marginLeft ?? this.marginLeft,
marginRight: marginRight ?? this.marginRight,
itemsPerRow: itemsPerRow ?? this.itemsPerRow,
itemsPerColumn: itemsPerColumn ?? this.itemsPerColumn,
horizontalGap: horizontalGap ?? this.horizontalGap,
verticalGap: verticalGap ?? this.verticalGap,
itemWidth: itemWidth ?? this.itemWidth,
itemHeight: itemHeight ?? this.itemHeight,
elements: elements ?? this.elements.map((e) => e.copyWith()).toList(),
dataSchemaName: dataSchemaName ?? this.dataSchemaName,
dataSchema: dataSchema ?? this.dataSchema,
createdAt: createdAt,
updatedAt: DateTime.now(),
);
}