setBuiltInStyle method

void setBuiltInStyle(
  1. BuiltInStyles? value
)

Set built-in-style.

Implementation

void setBuiltInStyle(BuiltInStyles? value) {
  if (value != null) {
    _styleName = value.toString().split('.').toList().removeAt(1);
    final Style globalStyle = workbook.styles.add(_styleName);
    if (isSingleRange) {
      _cellStyle = globalStyle;
      _setRange();
    } 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).cellStyle = globalStyle;
        }
      }
    }
  }
}