close method

  1. @mustCallSuper
void close()

Stops listening to the provider.

It is safe to call this method multiple times.

Implementation

@mustCallSuper
void close() {
  if (_closed) return;
  _closed = true;

  final Object listener = source;
  if (listener is ProviderElementBase) {
    listener._subscriptions?.remove(this);
  }
}