removeInstance<T> method
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;
}