startExportAnnotationCommandListener function

CancelListener startExportAnnotationCommandListener(
  1. ExportAnnotationCommandListener listener
)

Listens for when local annotation changes have been committed to the document.

var annotCancel = startExportAnnotationCommandListener((xfdfCommand) {
  print('flutter xfdfCommand: $xfdfCommand');
});

Returns a function that can cancel the listener. To also raise this event upon undo/redo, Config.annotationManagerEnabled must be true, and Config.userId must not be null.

Implementation

CancelListener startExportAnnotationCommandListener(
    ExportAnnotationCommandListener listener) {
  var subscription = _exportAnnotationCommandChannel
      .receiveBroadcastStream(eventSinkId.exportAnnotationId.index)
      .listen(listener, cancelOnError: true);

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