onPdfPassword property Null safety

PdfPasswordCallback? onPdfPassword
read / write

The event raised on Pdf password.

//Load an existing PDF document
PdfDocument document =
    PdfDocument(inputBytes: File('input.pdf').readAsBytesSync())
      //Subsribe the onPdfPassword event
      ..onPdfPassword = loadOnPdfPassword;
//Access the attachments
PdfAttachmentCollection attachmentCollection = document.attachments;
//Iterates the attachments
for (int i = 0; i < attachmentCollection.count; i++) {
  //Extracts the attachment and saves it to the disk
//Disposes the document

void loadOnPdfPassword(PdfDocument sender, PdfPasswordArgs args) {
  //Sets the value of PDF password.
  args.attachmentOpenPassword = 'syncfusion';


PdfPasswordCallback? onPdfPassword;