startExportBookmarkListener function

CancelListener startExportBookmarkListener(
  1. ExportBookmarkListener listener
)

Listens for when user bookmark changes are committed to the document.

var bookmarkCancel = startExportBookmarkListener((bookmarkJson) {
  print('flutter bookmark: $bookmarkJson');
});

Returns a function that can cancel the listener.

Implementation

CancelListener startExportBookmarkListener(ExportBookmarkListener listener) {
  var subscription = _exportBookmarkChannel
      .receiveBroadcastStream(eventSinkId.exportBookmarkId.index)
      .listen(listener, cancelOnError: true);

  return () {
    subscription.cancel();
  };
}