# resolveGenericsWithFallback method

List<Class> resolveGenericsWithFallback(

1. Class fallback

)

Convenience method that resolves generic parameters with a fallback for unresolvable types.

This method gets all generic parameters and resolves each one to a Class, using the provided fallback Class for any unresolvable generics.

Parameters:

- `fallback`: The Class to use when a generic parameter cannot be resolved

Returns:

- List of Class instances with no null values (fallback used for unresolvable generics)

Example:

    final mapType = ResolvableType.forClass(Map<String, dynamic>);
    final objectFallback = Class.forType(Object);
    final resolvedGenerics = mapType.resolveGenericsWithFallback(objectFallback);

    print(resolvedGenerics.length); // 2
    print(resolvedGenerics[0].getType()); // String
    print(resolvedGenerics[1].getType()); // Object (fallback for dynamic)

    // Useful for safe generic instantiation
    List<Class> getSafeGenerics(ResolvableType type) {
      final objectClass = Class.forType(Object);
      return type.resolveGenericsWithFallback(objectClass);
    }

## Implementation

    List<Class> resolveGenericsWithFallback(Class fallback) {
      final generics = getGenerics();
      final resolvedGenerics = <Class>[];
      for (final generic in generics) {
        final resolved = generic.resolve(fallback);
        if(resolved != null) {
          resolvedGenerics.add(resolved);
        }
      }
      return resolvedGenerics;
    }