resolveInstance<T> method

T resolveInstance<T>(
  1. Qualifier? qualifier,
  2. Type runtimeType,
  3. ParametersDefinition? parameters
)

Implementation

T resolveInstance<T>(Qualifier? qualifier, Type runtimeType,
    ParametersDefinition? parameters) {
  final IndexKey key = generateKey(runtimeType, qualifier);

  T? instance = _instanceRegistry.resolveInstance(key, parameters) ??
      getFromSource() ??
      _parameters?.getTypeOrNull() ??
      findInOtherScope(qualifier, parameters);
  if (null == instance) {
    throw Exception('no instance found for $key on scope ${toString()}');
  }
  return instance;
}