copyWith method

ReportTemplate copyWith({
  1. String? id,
  2. String? name,
  3. String? description,
  4. ReportType? reportType,
  5. double? pageWidth,
  6. double? pageHeight,
  7. PageFormat? pageFormat,
  8. double? marginTop,
  9. double? marginBottom,
  10. double? marginLeft,
  11. double? marginRight,
  12. int? itemsPerRow,
  13. int? itemsPerColumn,
  14. double? horizontalGap,
  15. double? verticalGap,
  16. double? itemWidth,
  17. double? itemHeight,
  18. List<ReportElement>? elements,
  19. String? dataSchemaName,
  20. 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(),
  );
}