PdfUnorderedMarker constructor

PdfUnorderedMarker({
  1. PdfUnorderedMarkerStyle style = PdfUnorderedMarkerStyle.none,
  2. PdfFont? font,
  3. String? text,
  4. PdfTemplate? template,
})

Initializes a new instance of the PdfUnorderedMarker class with Pdf unordered marker style.

//Create a new PDF document.
PdfDocument document = PdfDocument();
//Create a new unordered list.
PdfUnorderedList uList = PdfUnorderedList(
    items: PdfListItemCollection(['Essential tools', 'Essential grid']),
    font: PdfStandardFont(PdfFontFamily.helvetica, 16,
        style: PdfFontStyle.italic),
    marker: //Create an unordered marker.
        PdfUnorderedMarker(style: PdfUnorderedMarkerStyle.disk))
  ..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

PdfUnorderedMarker(
    {this.style = PdfUnorderedMarkerStyle.none,
    PdfFont? font,
    String? text,
    PdfTemplate? template}) {
  _helper = PdfUnorderedMarkerHelper(this);
  if (font != null) {
    this.font = font;
  }
  if (text != null) {
    this.text = text;
    style = PdfUnorderedMarkerStyle.customString;
  } else if (template != null) {
    _template = template;
    style = PdfUnorderedMarkerStyle.customTemplate;
  }
}