removeInstance<T> method

bool removeInstance<T>(
  1. String? tag
)

Remove an instance

Implementation

bool removeInstance<T>(String? tag) {
  if (!_instances.containsKey(T)) return false;

  final removed = _instances[T]?.remove(tag);

  // Clean up empty maps
  if (_instances[T]?.isEmpty ?? false) {
    _instances.remove(T);
  }

  return removed != null;
}