writableDictionary method

PdfDict<PdfDataType>? writableDictionary()

The annotation dictionary, ready for writing.

Returns null when the annotation cannot be materialized.

Implementation

PdfDict<PdfDataType>? writableDictionary() {
  final ref = reference;
  if (ref != null) return _collection.mutator.dictFor(ref);

  // The annotation written directly in the array already belongs to the
  // page: the dictionary converted by the parser is an instance exclusive to
  // it, and writing into it affects nobody else.
  return _direct;
}