dispose method

  1. @override
void dispose()
override

This method calls dispose() on the notifier this KeyValueNotifer was instantiated with.

Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener, addValueListener, removeListener and removeValueListener) will throw after the object is disposed).

This method should only be called by the object's owner.

Implementation

@override
void dispose() {
  _listeners = const {};
  _notifier.dispose();
}