brush property Null safety

PdfBrush? brush
read / write

Holds brush.

//Create a new instance of PdfDocument class.
PdfDocument document = PdfDocument();
//Create a new list.
PdfOrderedList()
  ..items.add(PdfListItem(
      text: 'PDF',
      font: PdfStandardFont(PdfFontFamily.timesRoman, 10),
      format: PdfStringFormat(alignment: PdfTextAlignment.left),
      pen: PdfPens.green,
      brush: PdfBrushes.red))
  ..draw(page: document.pages.add(), bounds: Rect.fromLTWH(10, 10, 0, 0));
//Save the document.
List<int> bytes = document.save();
//Dispose the document.
document.dispose();

Implementation

PdfBrush? brush;