# forTypeWithProviderAndResolver static method

ResolvableType forTypeWithProviderAndResolver(

1. Type type,
2. TypeProvider? typeProvider,
3. VariableResolver? variableResolver

)

Returns a ResolvableType with both TypeProvider and VariableResolver.

This is the most comprehensive factory method that allows specifying both a TypeProvider (for type information) and a VariableResolver (for type variable resolution). This provides maximum flexibility for complex type resolution scenarios.

Parameters:

- `type`: The Type to create a ResolvableType for
- `typeProvider`: Optional TypeProvider for additional type information
- `variableResolver`: Optional VariableResolver for type variable resolution

Returns:

- ResolvableType with the specified providers and resolvers

Example:

    // Create custom providers
    class CustomTypeProvider implements TypeProvider {
      @override
      Type? getType() => String; // Override the actual type

      @override
      Object? getSource() => this;
    }

    class CustomVariableResolver implements VariableResolver {
      @override
      Object getSource() => this;

      @override
      ResolvableType? resolveVariable(Object variable) {
        return ResolvableType.forClass(int);
      }
    }

    final provider = CustomTypeProvider();
    final resolver = CustomVariableResolver();

    final complexType = ResolvableType.forTypeWithProviderAndResolver(
      Object, // Base type
      provider, // Will override to String
      resolver  // Will resolve variables to int
    );

    // This type will use both custom provider and resolver

## Implementation

    static ResolvableType forTypeWithProviderAndResolver(
        Type type, TypeProvider? typeProvider, VariableResolver? variableResolver) {
      if (type == _EmptyType._instance) {
        return NONE;
      }

      // For simple Class references, build the wrapper right away
      try {
        final classObj = Class.forType(type);
        // Use the classObj to create a more complete ResolvableType
        final result = ResolvableType._(type, typeProvider, variableResolver);
        result._resolved = classObj;
        return result;
      } catch (e) {
        // Continue with caching logic
      }

      // Check the cache
      final resultType = ResolvableType._(type, typeProvider, variableResolver);
      ResolvableType? cachedType = _cache[resultType];
      if (cachedType == null) {
        cachedType = ResolvableType._(type, typeProvider, variableResolver, hash: resultType.hashCode);
        _cache[cachedType] = cachedType;
      }
      return cachedType;
    }