addChangeListener abstract method

FutureOr<ListenerToken> addChangeListener(
  1. QueryChangeListener<ResultSet> listener
)

Adds a listener to be notified of changes to the results of this query.

A new listener will be called with the current results, after being added. Subsequently it will only be called when the results change, either because the contents of the database have changed or this query's parameters have been changed through setParameters.

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> addChangeListener(QueryChangeListener listener);