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. bool isChecked = false,
  11. String textAlign = 'left',
  12. String fontFamily = 'Helvetica',
  13. int printColor = 0xff172033,
  14. int fillColor = 0,
  15. int zIndex = 0,
  16. String dataSource = 'items',
  17. List<ReportColumn>? columns,
  18. double rowHeight = 24,
  19. int headerColor = 0xff3156d3,
  20. int headerTextColor = 0xffffffff,
  21. int alternateRowColor = 0xfff3f5f9,
  22. bool showBorders = true,
  23. String imageBase64 = '',
  24. String imageName = '',
  25. String imageFit = 'contain',
  26. bool showSummary = true,
  27. bool showSubtotal = true,
  28. bool showTaxes = true,
  29. String amountExpression = 'total',
  30. double discountPercent = 0,
  31. String discountLabel = 'Rabatt',
  32. String subtotalLabel = 'Zwischensumme',
  33. String totalLabel = 'Gesamtbetrag',
  34. List<TaxRule>? taxRules,
  35. List<AggregateRule>? aggregateRules,
  36. String lineDirection = 'horizontal',
  37. double lineThickness = 1.5,
  38. String codeValue = '',
  39. String barcodeType = 'ean13',
  40. bool showCodeText = true,
  41. String band = 'body',
  42. String visibilityCondition = '',
  43. String checkedCondition = '',
  44. ElementPageVisibility pageVisibility = ElementPageVisibility.all,
  45. bool locked = false,
  46. bool hidden = false,
  47. bool keepTogether = false,
  48. bool flow = false,
  49. String section = 'body',
  50. String groupBy = '',
  51. String groupHeader = '{{group}}',
  52. String groupFooter = 'Zwischensumme',
  53. bool showGroupHeader = true,
  54. bool showGroupFooter = true,
  55. ChartType chartType = ChartType.bar,
  56. String chartCategoryField = 'label',
  57. String chartValueExpression = 'value',
  58. bool chartShowLegend = true,
  59. bool chartShowLabels = true,
  60. 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.isChecked = false,
  this.textAlign = 'left',
  this.fontFamily = 'Helvetica',
  this.printColor = 0xff172033,
  this.fillColor = 0,
  this.zIndex = 0,
  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.checkedCondition = '',
  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;