cleanupNamespace method

void cleanupNamespace(
  1. String namespace
)

Cleanup state by namespace

Implementation

void cleanupNamespace(String namespace) {
  final keysToRemove = _state.keys
      .where((key) => key.startsWith('$namespace:'))
      .toList();

  for (final key in keysToRemove) {
    _state[key]?.dispose();
    _state.remove(key);
  }
}