# getNamedObject method

1. @override

Future<Object> getNamedObject(

1. String podName, [
2. List<ArgumentValue>? args

])
override

Retrieves a pod as a generic Object by its name with optional arguments.

This method is useful when the exact type of the pod is not known at compile time or when working with dynamic pod retrieval scenarios.

## Usage Example:

    final pod = await factory.getNamedObject('dataProcessor');
    if (pod is DataProcessor) {
      pod.processData();
    }

@param podName The name of the pod to retrieve @param args Optional list of argument values for pod construction @return A Future that completes with the pod instance as Object

## Implementation

    @override
    Future<Object> getNamedObject(String podName, [List<ArgumentValue>? args]) async {
      final f = getPodFactory();

      if (await f.containsLocalPod(podName)) {
        return await f.getNamedObject(podName, args);
      }

      if (_parent != null) {
        return await _parent!.getNamedObject(podName, args);
      }

      throw NoSuchPodDefinitionException.byNameWithMessage(podName, 'No named pod $podName');
    }