contains method

bool contains(
  1. PdfBookmark outline
)

Determines whether the specified outline presents in the collection.

//Create a new document.
PdfDocument document = PdfDocument();
//Add bookmarks to the document.
PdfBookmark bookmark = document.bookmarks.add('Page 1')
  ..destination = PdfDestination(document.pages.add(), Offset(20, 20));
//check whether the specified bookmark present in the collection
bool contains = document.bookmarks.contains(bookmark);
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();

Implementation

bool contains(PdfBookmark outline) {
  return _list.contains(outline);
}