defaultLayer property Null safety

PdfPageLayer defaultLayer

Gets the default layer of the page (Read only).

//Create a new PDF documentation
PdfDocument document = PdfDocument();
//Create a new PDF page and gets the default layer
PdfPageLayer defaultLayer = document.pages.add().defaultLayer;
//Save the document.
List<int> bytes = document.save();
//Dispose the document.
document.dispose();

Implementation

PdfPageLayer get defaultLayer => layers[defaultLayerIndex];