exportSize method

Size exportSize(
  1. BuildContext context, {
  2. List<int>? rowIndices,
})

Natural dimensions of buildExport, before screenshot/PDF scaling.

Implementation

Size exportSize(BuildContext context, {List<int>? rowIndices}) {
  final indices = rowIndices ?? List<int>.generate(rowCount, (i) => i);
  final outer = padding.resolve(Directionality.of(context));
  final inner = rowPadding.resolve(Directionality.of(context));
  var width = rowHeaderBuilder == null ? 0.0 : rowHeaderWidth;
  for (var col = 0; col < columnCount; col++) {
    width += columnWidthBuilder?.call(col) ?? 180;
  }
  var height = showColumnHeader ? headerHeight : 0.0;
  for (final row in indices) {
    if (row < 0 || row >= rowCount) throw RangeError.index(row, indices);
    height += rowHeightBuilder?.call(row) ?? 92;
  }
  return Size(
      width + outer.horizontal + inner.horizontal, height + outer.vertical);
}