# getNested method

ResolvableType getNested(

1. int nestingLevel, [
2. Map<int, int>? typeIndexesPerLevel

])

Returns a ResolvableType for the specified nesting level.

This method navigates through nested generic types or array component types to reach a specific nesting level. It's useful for working with complex nested generic structures.

Parameters:

- `nestingLevel`: The target nesting level (1-based)
- `typeIndexesPerLevel`: Optional map specifying which generic parameter to follow at each level

Returns:

- ResolvableType at the specified nesting level
- ResolvableType.NONE if the nesting level cannot be reached

Example:

    // For List<List<String>>
    final nestedListType = ResolvableType.forClass(List<List<String>>);

    final level1 = nestedListType.getNested(1); // List<List<String>>
    final level2 = nestedListType.getNested(2); // List<String>
    final level3 = nestedListType.getNested(3); // String

    print(level1.resolve()?.getType()); // List<List<String>>
    print(level2.resolve()?.getType()); // List<String>
    print(level3.resolve()?.getType()); // String

    // For Map<String, List<Integer>>
    final complexMapType = ResolvableType.forClass(Map<String, List<int>>);
    final valueType = complexMapType.getNested(2, {2: 1}); // Navigate to List<int> (index 1 at level 2)
    final elementType = complexMapType.getNested(3, {2: 1}); // Navigate to int

## Implementation

    ResolvableType getNested(int nestingLevel, [Map<int, int>? typeIndexesPerLevel]) {
      ResolvableType result = this;
      for (int i = 2; i <= nestingLevel; i++) {
        if (result.isArray()) {
          result = result.getComponentType();
        } else {
          // Handle derived types
          while (result != NONE && !result.hasGenerics()) {
            result = result.getSuperType();
          }
          int? index = typeIndexesPerLevel?[i];
          index ??= result.getGenerics().length - 1;
          result = result.getGeneric([index]);
        }
      }
      return result;
    }