# getPodNames method

1. @override

Future<List<String>> getPodNames(

1. Class type, {
2. bool includeNonSingletons = false,
3. bool allowEagerInit = false,

})
override

Retrieves all pod names for pods of the specified type.

This method can include or exclude non-singleton pods and control eager initialization behavior.

## Usage Example:

    // Get all repository pod names
    final repoNames = await factory.getPodNames(
      Class<Repository>(),
      includeNonSingletons: true,
    );

    for (final name in repoNames) {
      final repo = await factory.getPod<Repository>(name);
      await repo.initialize();
    }

@param type The type of pods to find @param includeNonSingletons Whether to include non-singleton pods @param allowEagerInit Whether to allow eager initialization during lookup @return A Future that completes with a list of pod names

## Implementation

    @override
    Future<List<String>> getPodNames(Class type, {bool includeNonSingletons = false, bool allowEagerInit = false}) async {
      final result = <String>[];
      final cache = includeNonSingletons ? _singletonAndNonSingletonPodNames : _singletonPodNames;
      final resolvedNames = cache[type];

      if(resolvedNames != null && _configurationFrozen) {
        return resolvedNames;
      }

      // Check definition registry
      try {
        final names = getDefinitionNames();
        for (String name in names) {
          if (isAlias(name)) {
            continue;
          }

          final definition = getDefinition(name);
          final cls = definition.type;
          final notLazy = definition.lifecycle.isLazy != null ? !definition.lifecycle.isLazy! : false;

          if (!definition.isAbstractAndNoFactory() && (allowEagerInit || notLazy || !await _requiresEagerInit(name))) {
            final isPp = await isPodProvider(name);
            final allowPpInit = allowEagerInit || containsSingleton(name);
            final isS = await isSingleton(name);

            if (cls == type || cls.isSubclassOf(type) || type.isAssignableFrom(cls) || cls.isInstance(type)) {
              if (!isPp) {
                if (includeNonSingletons || isS) {
                  if (allowPpInit) {
                    await get(type);
                  }

                  result.add(name);
                }
              } else {
                name = podProviderName(name);
                if (includeNonSingletons || isS) {
                  if (allowPpInit) {
                    await get(type);
                  }

                  result.add(name);
                }
              }
            }
          }
        }
      } on PodDefinitionStoreException catch (e) {
        if (allowEagerInit) {
          rethrow;
        }

        if (_logger.getIsTraceEnabled()) {
          _logger.trace("Could not get pod names for type '$type'. $e");
        }

        onSuppressedException(e);
      }

      cache.add(type, result);

      return result;
    }