rowHeight property
double
get
rowHeight
Represents the row height.
Implementation
double get rowHeight {
final Row? rowObj = _worksheet.rows[row];
if (rowObj != null) {
return rowObj.height;
}
return 0;
}
set
rowHeight
(double value)
Sets the height of all the rows in the range, measured in points.
Workbook workbook = new Workbook();
Worksheet sheet = workbook.worksheets[0];
Range range = sheet.getRangeByName('A1');
range.rowHeight = 25;
List<int> bytes = workbook.saveAsStream();
File('RowHeight.xlsx').writeAsBytes(bytes);
workbook.dispose();
Implementation
set rowHeight(double value) {
if (isSingleRange) {
Row? rowObj = _worksheet.rows[row];
if (rowObj == null) {
rowObj = Row(_worksheet);
rowObj.index = row;
worksheet.rows[row] = rowObj;
}
rowObj.height = value;
} else {
// ignore: prefer_final_locals
for (int iRow = row, iLastRow = lastRow; iRow <= iLastRow; iRow++) {
// ignore: prefer_final_locals
for (int iCol = column, iLastCol = lastColumn;
iCol <= iLastCol;
iCol++) {
worksheet.getRangeByIndex(iRow, iCol).rowHeight = value;
}
}
}
}