destroyPod method

  1. @override
Future<void> destroyPod(
  1. String podName,
  2. Object podInstance
)

Destroys a pod instance by name and instance.

This method handles the complete destruction lifecycle including removal from registries and invocation of destruction callbacks.

Usage Example:

final pod = await factory.getPod<MyPod>('myPod');
await factory.destroyPod('myPod', pod);

@param podName The name of the pod to destroy @param podInstance The pod instance to destroy @return A Future that completes when destruction is done

Implementation

@override
Future<void> destroyPod(String podName, Object podInstance) async {
  if (_parent != null && await _parent!.getPodFactory().containsLocalPod(podName)) {
    return await _parent!.getPodFactory().destroyPod(podName, podInstance);
  }

  return await getPodFactory().destroyPod(podName, podInstance);
}