isBlackAndWhite property

bool isBlackAndWhite
getter/setter pair

Indicates whether to print the worksheet as black and white.

final Workbook workbook = Workbook();
final Worksheet sheet = workbook.worksheets[0];
final Style style = workbook.styles.add('style');
style.fontColor = '#C67878';
final Range range = sheet.getRangeByName('A1:D4');
range.text = 'BlackWhite';
range.cellStyle = style;
sheet.pageSetup.isBlackAndWhite = true;
final List<int> bytes = workbook.saveAsStream();
saveAsExcel(bytes, 'isBlackAndWhite.xlsx');
workbook.dispose();

Implementation

late bool isBlackAndWhite;