dispose method

  1. @mustCallSuper
void dispose()
inherited

Frees all the resources associated to this object.

This marks the object as no longer usable and will make all methods/properties besides mounted inaccessible.

Implementation

@mustCallSuper
void dispose() {
  assert(_debugIsMounted(), '');
  _listeners.clear();
  _controller?.close();
  _mounted = false;
}