dispose method

void dispose()

Disposes of all active stream subscriptions and resets rate limits.

This method should be called when the RTDB instance is no longer needed to free up resources.

Implementation

void dispose() {
  for (var subscription in _runningStreams.values) {
    subscription.close();
  }
  _runningStreams.clear();
  _listenedValues.clear();
  _resetTimer?.cancel();
  _client.close();
}