PdfPasswordCallback typedef Null safety

PdfPasswordCallback = void Function(PdfDocument sender, PdfPasswordArgs args)

Delegate for handling the 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';


typedef PdfPasswordCallback = void Function(
    PdfDocument sender, PdfPasswordArgs args);