PdfUnorderedList constructor

PdfUnorderedList({
  1. PdfUnorderedMarker? marker,
  2. PdfListItemCollection? items,
  3. String? text,
  4. PdfFont? font,
  5. PdfUnorderedMarkerStyle style = PdfUnorderedMarkerStyle.disk,
  6. PdfStringFormat? format,
  7. double indent = 10,
  8. double textIndent = 5,
})

Initializes a new instance of the PdfUnorderedList class.

//Create a new PDF document.
PdfDocument document = PdfDocument();
//Create a new unordered list.
PdfUnorderedList(
    items: PdfListItemCollection(['Essential tools', 'Essential grid']),
    font: PdfStandardFont(PdfFontFamily.helvetica, 16,
        style: PdfFontStyle.italic),
    marker: PdfUnorderedMarker(style: PdfUnorderedMarkerStyle.disk),
    format: PdfStringFormat(lineSpacing: 20),
    indent: 15,
    textIndent: 10)
  ..draw(
      page: document.pages.add(), bounds: const Rect.fromLTWH(20, 20, 0, 0));
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();

Implementation

PdfUnorderedList(
    {PdfUnorderedMarker? marker,
    PdfListItemCollection? items,
    String? text,
    PdfFont? font,
    PdfUnorderedMarkerStyle style = PdfUnorderedMarkerStyle.disk,
    PdfStringFormat? format,
    double indent = 10,
    double textIndent = 5})
    : super() {
  final PdfListHelper helper = PdfListHelper(this);
  this.marker = marker ?? _createMarker(style);
  stringFormat = format;
  super.indent = indent;
  super.textIndent = textIndent;
  if (font != null) {
    helper.font = font;
  }
  if (items != null) {
    helper.items = items;
  } else if (text != null) {
    helper.items = PdfListHelper.createItems(text);
  }
}