columns property

ColumnCollection get columns

Represents all the columns in the specified worksheet.

Workbook workbook = Workbook();
Worksheet sheet = workbook.worksheets[0];
Column col = sheet.columns.add();
col.width = 25;
List<int> bytes = workbook.saveAsStream();
File('ExcelColumns.xlsx').writeAsBytes(bytes);
workbook.dispose();

Implementation

ColumnCollection get columns {
  _columns ??= ColumnCollection(this);
  return _columns!;
}