font property Null safety

PdfFont? font

Gets or sets the list font.

//Create a new PDF document.
PdfDocument document = PdfDocument();
//Create a new ordered list.
PdfOrderedList(
    text: 'PDF\nXlsIO\nDocIO\nPPT',
    font: PdfStandardFont(PdfFontFamily.helvetica, 16,
        style: PdfFontStyle.italic),
    format: PdfStringFormat(lineSpacing: 20),
    marker: PdfOrderedMarker(style: PdfNumberStyle.numeric),
    style: PdfNumberStyle.numeric,
    indent: 15,
    textIndent: 10)
  ..draw(
      page: document.pages.add(), bounds: const Rect.fromLTWH(20, 20, 0, 0));
//Save the document.
List<int> bytes = document.save();
//Dispose the document.
document.dispose();

Implementation

PdfFont? get font => _font;
void font=(PdfFont? value)

Implementation

set font(PdfFont? value) {
  if (value != null) {
    _font = value;
  }
}