fontSize property

  1. @override
double get fontSize
override

Gets/sets font size.

final Workbook workbook = Workbook();
final Worksheet sheet = workbook.worksheets[0];
final Style style = workbook.styles.add('style');
// set font size.
style.fontSize = 20;
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
double get fontSize {
  double fontSizeStyle = 11;
  bool first = true;

  final int last = _arrRanges.length;
  for (int index = 0; index < last; index++) {
    final Range range = _arrRanges[index];

    if (first) {
      fontSizeStyle = range.cellStyle.fontSize;
      first = false;
    } else if (range.cellStyle.fontSize != fontSizeStyle) {
      return 11;
    }
  }
  return fontSizeStyle;
}
  1. @override
set fontSize (double value)
override

Gets/sets font size.

final Workbook workbook = Workbook();
final Worksheet sheet = workbook.worksheets[0];
final Style style = workbook.styles.add('style');
// set font size.
style.fontSize = 20;
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 fontSize(double value) {
  final int last = _arrRanges.length;
  for (int index = 0; index < last; index++) {
    final Range range = _arrRanges[index];
    range.cellStyle.fontSize = value;
  }
}