removeSingleton method

  1. @override
void removeSingleton(
  1. String name
)

Remove the pod associated with name.

This method removes a pod from the registry, making the name available for reuse (depending on implementation constraints).

name: The name of the pod to remove

Throws:

  • IllegalArgumentException if name is null or empty
  • PodNotFoundException if no pod exists with the given name
  • UnsupportedOperationException if the registry doesn't support removal

Example:

if (registry.containsSingleton('oldService')) {
  registry.removeSingleton('oldService');
  print('Removed oldService from registry');
}

Implementation

@override
void removeSingleton(String name) {
  getPodFactory().removeSingleton(name);
}