addDocumentChangeListener abstract method

FutureOr<ListenerToken> addDocumentChangeListener(
  1. String id,
  2. DocumentChangeListener listener
)

Adds a listener to be notified of changes to the Document with the given id.

Adding a listener

If a Future is returned, the listener will only start listening after the Future has completed. Otherwise the listener is listening immediately after this method returns.

Removing a listener

The returned ListenerToken needs to be provided to removeChangeListener, to remove the given listener. Regardless of whether a Future is returned or not, the listener immediately stops being called.

See also:

Implementation

FutureOr<ListenerToken> addDocumentChangeListener(
  String id,
  DocumentChangeListener listener,
);