ReportTemplate constructor

ReportTemplate({
  1. required String id,
  2. required String name,
  3. String? description,
  4. ReportType reportType = ReportType.label,
  5. double pageWidth = 210,
  6. double pageHeight = 297,
  7. PageFormat pageFormat = PageFormat.a4Portrait,
  8. double marginTop = 10,
  9. double marginBottom = 10,
  10. double marginLeft = 10,
  11. double marginRight = 10,
  12. int itemsPerRow = 4,
  13. int itemsPerColumn = 6,
  14. double horizontalGap = 2,
  15. double verticalGap = 2,
  16. double itemWidth = 40,
  17. double itemHeight = 45,
  18. List<ReportElement>? elements,
  19. String? dataSchemaName,
  20. DataSchema? dataSchema,
  21. DateTime? createdAt,
  22. DateTime? updatedAt,
})

Implementation

ReportTemplate({
  required this.id,
  required this.name,
  this.description,
  this.reportType = ReportType.label,
  this.pageWidth = 210,
  this.pageHeight = 297,
  this.pageFormat = PageFormat.a4Portrait,
  this.marginTop = 10,
  this.marginBottom = 10,
  this.marginLeft = 10,
  this.marginRight = 10,
  this.itemsPerRow = 4,
  this.itemsPerColumn = 6,
  this.horizontalGap = 2,
  this.verticalGap = 2,
  this.itemWidth = 40, // Portrait: smaller width
  this.itemHeight = 45, // Portrait: larger height
  List<ReportElement>? elements,
  this.dataSchemaName,
  this.dataSchema,
  DateTime? createdAt,
  DateTime? updatedAt,
}) : elements = elements ?? [],
     createdAt = createdAt ?? DateTime.now(),
     updatedAt = updatedAt ?? DateTime.now();