addListener method

void addListener(
  1. dynamic listener()
)

Register a closure to be called when the object changes.

This method should not be called during a call to notifyListeners.

Implementation

void addListener(Function() listener) {
  _listeners.add(listener);
}