ReportElement constructor

ReportElement({
  1. required String id,
  2. required ElementType type,
  3. double x = 50,
  4. double y = 50,
  5. double width = 180,
  6. double height = 40,
  7. String value = '',
  8. double fontSize = 12,
  9. bool bold = false,
  10. String textAlign = 'left',
  11. String fontFamily = 'Helvetica',
  12. int printColor = 0xff172033,
  13. String dataSource = 'items',
  14. List<ReportColumn>? columns,
  15. double rowHeight = 24,
  16. int headerColor = 0xff3156d3,
  17. int headerTextColor = 0xffffffff,
  18. int alternateRowColor = 0xfff3f5f9,
  19. bool showBorders = true,
  20. String imageBase64 = '',
  21. String imageName = '',
  22. String imageFit = 'contain',
  23. bool showSummary = true,
  24. bool showSubtotal = true,
  25. bool showTaxes = true,
  26. String amountExpression = 'total',
  27. double discountPercent = 0,
  28. String discountLabel = 'Rabatt',
  29. String subtotalLabel = 'Zwischensumme',
  30. String totalLabel = 'Gesamtbetrag',
  31. List<TaxRule>? taxRules,
  32. List<AggregateRule>? aggregateRules,
  33. String lineDirection = 'horizontal',
  34. double lineThickness = 1.5,
  35. String codeValue = '',
  36. String barcodeType = 'ean13',
  37. bool showCodeText = true,
  38. String band = 'body',
  39. String visibilityCondition = '',
  40. ElementPageVisibility pageVisibility = ElementPageVisibility.all,
  41. bool locked = false,
  42. bool hidden = false,
  43. bool keepTogether = false,
  44. bool flow = false,
  45. String section = 'body',
  46. String groupBy = '',
  47. String groupHeader = '{{group}}',
  48. String groupFooter = 'Zwischensumme',
  49. bool showGroupHeader = true,
  50. bool showGroupFooter = true,
  51. ChartType chartType = ChartType.bar,
  52. String chartCategoryField = 'label',
  53. String chartValueExpression = 'value',
  54. bool chartShowLegend = true,
  55. bool chartShowLabels = true,
  56. List<int>? chartColors,
})

Creates a report element with type-specific styling and data settings.

Implementation

ReportElement({
  required this.id,
  required this.type,
  this.x = 50,
  this.y = 50,
  this.width = 180,
  this.height = 40,
  this.value = '',
  this.fontSize = 12,
  this.bold = false,
  this.textAlign = 'left',
  this.fontFamily = 'Helvetica',
  this.printColor = 0xff172033,
  this.dataSource = 'items',
  List<ReportColumn>? columns,
  this.rowHeight = 24,
  this.headerColor = 0xff3156d3,
  this.headerTextColor = 0xffffffff,
  this.alternateRowColor = 0xfff3f5f9,
  this.showBorders = true,
  this.imageBase64 = '',
  this.imageName = '',
  this.imageFit = 'contain',
  this.showSummary = true,
  this.showSubtotal = true,
  this.showTaxes = true,
  this.amountExpression = 'total',
  this.discountPercent = 0,
  this.discountLabel = 'Rabatt',
  this.subtotalLabel = 'Zwischensumme',
  this.totalLabel = 'Gesamtbetrag',
  List<TaxRule>? taxRules,
  List<AggregateRule>? aggregateRules,
  this.lineDirection = 'horizontal',
  this.lineThickness = 1.5,
  this.codeValue = '',
  this.barcodeType = 'ean13',
  this.showCodeText = true,
  this.band = 'body',
  this.visibilityCondition = '',
  this.pageVisibility = ElementPageVisibility.all,
  this.locked = false,
  this.hidden = false,
  this.keepTogether = false,
  this.flow = false,
  this.section = 'body',
  this.groupBy = '',
  this.groupHeader = '{{group}}',
  this.groupFooter = 'Zwischensumme',
  this.showGroupHeader = true,
  this.showGroupFooter = true,
  this.chartType = ChartType.bar,
  this.chartCategoryField = 'label',
  this.chartValueExpression = 'value',
  this.chartShowLegend = true,
  this.chartShowLabels = true,
  List<int>? chartColors,
}) : columns = columns ?? [],
     taxRules = taxRules ?? [],
     aggregateRules = aggregateRules ?? [],
     chartColors = chartColors == null || chartColors.isEmpty
         ? const [0xff3156d3, 0xff22a06b, 0xfff59e0b, 0xffdc4c64, 0xff7c3aed]
         : chartColors;