isDraft property

bool isDraft
getter/setter pair

Indicates whether to print the worksheet as draft without graphics.

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.isDraft = true;
final List<int> bytes = workbook.saveAsStream();
saveAsExcel(bytes, 'isDraft.xlsx');
workbook.dispose();

Implementation

late bool isDraft;