action property Null safety

PdfAction? action

Gets or sets the action for the outline.

//Create a new document.
PdfDocument document = PdfDocument();
//Create document bookmarks.
document.bookmarks.add('Page 1')
  ..destination = PdfDestination(document.pages.add(), Offset(20, 20))
  ..textStyle = [PdfTextStyle.bold]
  ..color = PdfColor(255, 0, 0)
  //Set the bookmark action.
  ..action = PdfUriAction('http://www.google.com');
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();

Implementation

PdfAction? get action => _action;
void action=(PdfAction? value)

Implementation

set action(PdfAction? value) {
  if (value != null && _action != value) {
    _action = value;
    _helper.dictionary!.setProperty(PdfDictionaryProperties.a,
        PdfReferenceHolder(PdfActionHelper.getHelper(_action!).dictionary));
  }
}