table method

void table(
  1. String dataSource,
  2. double x,
  3. double y,
  4. double width,
  5. double height, {
  6. required String accent,
  7. required List<PrintColumn> columns,
})

Implementation

void table(
  String dataSource,
  double x,
  double y,
  double width,
  double height, {
  required String accent,
  required List<PrintColumn> columns,
}) {
  _add(ReportElementType.table, x, y, width, height, {
    'dataSource': dataSource,
    'columns': columns.map((column) => column.toJson()).toList(),
    'headerStyle': {
      'fontSize': 3.0,
      'fontWeight': 'bold',
      'backgroundColor': accent,
      'color': '#FFFFFF',
      'alignment': 'left',
      'verticalAlignment': 'center',
    },
    'cellStyle': {
      'fontSize': 3.0,
      'padding': 1.5,
      'alignment': 'left',
      'verticalAlignment': 'center',
      'stripeColor': '#F5F5F5',
    },
    'borderWidth': 0.0,
    'borderColor': '#E0E0E0',
  });
}