dispose method

void dispose()

Discards any active listeners. After this is called the object will not be in a usable state.

Implementation

void dispose() {
  _listeners?.forEach(removeListener);
  _listeners = null;
}