wrapText property
Gets/sets cell wraptext.
final Workbook workbook = Workbook();
final Worksheet sheet = workbook.worksheets[0];
final Style style = workbook.styles.add('style');
// set wrap text.
style.wrapText = true;
final Range range1 = sheet.getRangeByIndex(3, 4);
range1.number = 10;
range1.cellStyle = style;
final List<int> bytes = workbook.saveAsStream();
File('CellStyle.xlsx').writeAsBytes(bytes);
workbook.dispose();
Implementation
@override
bool get wrapText {
bool wrapTextStyle = false;
bool first = true;
final int last = _arrRanges.length;
for (int index = 0; index < last; index++) {
final Range range = _arrRanges[index];
if (first) {
wrapTextStyle = range.cellStyle.wrapText;
first = false;
} else if (range.cellStyle.wrapText != wrapTextStyle) {
return false;
}
}
return wrapTextStyle;
}
Gets/sets cell wraptext.
final Workbook workbook = Workbook();
final Worksheet sheet = workbook.worksheets[0];
final Style style = workbook.styles.add('style');
// set wrap text.
style.wrapText = true;
final Range range1 = sheet.getRangeByIndex(3, 4);
range1.number = 10;
range1.cellStyle = style;
final List<int> bytes = workbook.saveAsStream();
File('CellStyle.xlsx').writeAsBytes(bytes);
workbook.dispose();
Implementation
@override
set wrapText(bool value) {
final int last = _arrRanges.length;
for (int index = 0; index < last; index++) {
final Range range = _arrRanges[index];
range.cellStyle.wrapText = value;
}
}