style property Null safety

PdfFontStyle style

Gets style of the font.

//Create a new PDF document.
PdfDocument document = PdfDocument();
//Create a new PDF font instance.
PdfFont font = PdfStandardFont(PdfFontFamily.helvetica, 12);
//Draw string to PDF page.
document.pages.add().graphics.drawString(
    'Font Name: ${font.name}\nFont Size: ${font.size}\nFont Height: ${font.height}\nFont Style: ${font.style}',
    font);
//Save the document.
List<int> bytes = document.save();
//Close the document.
document.dispose();

Implementation

PdfFontStyle get style => _style;