items property Null safety

PdfListItemCollection items

Gets items of the list.

//Create a new instance of PdfDocument class.
PdfDocument document = PdfDocument();
//Create a new list.
PdfOrderedList(
    indent: 10,
    textIndent: 10,
    font: PdfStandardFont(PdfFontFamily.timesRoman, 10,
        style: PdfFontStyle.italic))
  ..items.add(PdfListItem(text: 'PDF'))
  ..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

PdfListItemCollection get items {
  _items ??= PdfListItemCollection();
  return _items!;
}