PdfListItem constructor

PdfListItem(
  1. {String text = '',
  2. PdfFont? font,
  3. PdfStringFormat? format,
  4. PdfPen? pen,
  5. PdfBrush? brush,
  6. PdfList? subList}
)

Initializes a new instance of the PdfListItem class.

//Create a new instance of PdfDocument class.
PdfDocument document = PdfDocument();
//Create a new list.
PdfOrderedList(
    font: PdfStandardFont(PdfFontFamily.timesRoman, 10,
        style: PdfFontStyle.italic))
  ..items.add(
      //Create list item.
      PdfListItem(text: 'PDF'))
  ..draw(page: document.pages.add(), bounds: Rect.fromLTWH(10, 10, 0, 0));
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();

Implementation

PdfListItem(
    {this.text = '',
    this.font,
    PdfStringFormat? format,
    this.pen,
    this.brush,
    this.subList}) {
  stringFormat = format;
}