# registerPod<T> method

1. @override

Future<void> registerPod<T>(

1. Class<T> podClass, {
2. Consumer<Spec<T>>? customizer,
3. String? name,

})
override

Registers a pod of type `T` in the registry.

- `podClass` defines the class type for the pod.
- `customizer` allows refining the Spec of the pod.
- `name` can be provided to identify the pod uniquely.

## Implementation

    @override
    Future<void> registerPod<T>(Class<T> podClass, {Consumer<Spec<T>>? customizer, String? name}) async {
      if (podFactory != null) {
        PodDefinition podDef = RootPodDefinition(type: podClass);
        String podName;

        if(name != null) {
          podDef.name = name;
          podDef.scope = ScopeDesign.type(ScopeType.SINGLETON.name);
          registerDefinition(name, podDef);

          podName = name;
        } else if(customizer != null) {
          final customizerImpl = PodSpec<T>(PodSpecContext(podFactory!));
          customizer(customizerImpl);

          podDef = customizerImpl.clone();

          if (podDef.name.isNotEmpty) {
            registerDefinition(podDef.name, podDef);
          } else {
            podName = AnnotatedPodNameGenerator().generate(podDef, podFactory!);
            registerDefinition(podName, podDef);
          }
        } else {
          podDef.scope = ScopeDesign.type(ScopeType.SINGLETON.name);
          podName = AnnotatedPodNameGenerator().generate(podDef, podFactory!);
          registerDefinition(podName, podDef);
        }
      }

      return Future.value();
    }