getDefinition method

  1. @override
PodDefinition getDefinition(
  1. String name
)
override

Retrieve the pod registered under name.

This method returns the pod associated with the given name. The exact behavior and returned type depend on the registry implementation and the generic type T.

name: The name of the pod to retrieve Returns the pod object of type T associated with the name

Throws:

Example:

// Get a pod definition
final podDef = definitionRegistry.getDefinition('userService');
print('Pod class: ${podDef.getPodClassName()}');

Implementation

@override
PodDefinition getDefinition(String name) {
  final pod = _definitions[name];
  if(pod == null) {
    throw NoSuchPodDefinitionException.byName(name);
  }

  return pod;
}