dispose method

void dispose()

Discards any resources used by the object.

This method should be called when the object is no longer needed. After calling this method, the object is no longer in a usable state.

Implementation

void dispose() {
  _listeners.clear();
}