EndItemLayoutCallback typedef Null safety

void EndItemLayoutCallback(
  1. Object sender,
  2. EndItemLayoutArgs args
)

typedef for handling EndItemLayoutEvent.

//Create a new PDF document.
PdfDocument document = PdfDocument();
//Create a new list.
PdfOrderedList(
    text: 'PDF\nXlsIO\nDocIO\nPPT',
    font: PdfStandardFont(PdfFontFamily.helvetica, 16,
        style: PdfFontStyle.italic),
    format: PdfStringFormat(lineSpacing: 20))
  //Begin item layout event.
  ..beginItemLayout = (Object sender, BeginItemLayoutArgs args) {
    args.item.text += '_Beginsave';
  }
  //End item layout event.
  ..endItemLayout = (Object sender, EndItemLayoutArgs args) {
    args.page.graphics.drawRectangle(
        brush: PdfBrushes.red,
        bounds: const Rect.fromLTWH(400, 400, 100, 100));
  }
  ..draw(
      page: document.pages.add(), bounds: const Rect.fromLTWH(20, 20, 0, 0));
//Save the document.
List<int> bytes = document.save();
//Dispose the document.
document.dispose();

Implementation

typedef EndItemLayoutCallback = void Function(
    Object sender, EndItemLayoutArgs args);