provideUntyped<T> method

  1. @protected
T provideUntyped<T>(
  1. Object token, [
  2. Object? orElse = throwIfNotFound
])

Injects and returns an object representing token.

If the key was not found, returns orElse (default is null).

NOTE: This is an internal-only method and may be removed.

Implementation

@protected
T provideUntyped<T>(
  Object token, [
  Object? orElse = throwIfNotFound,
]) {
  errors.debugInjectorEnter(token);
  var result = injectFromSelfOptional(token, orElse);
  if (identical(result, orElse)) {
    result = injectFromAncestryOptional(token, orElse);
  }
  errors.debugInjectorLeave(token);
  return unsafeCast(result);
}