provideTokenOptional<T> method

T provideTokenOptional<T>(
  1. OpaqueToken<T> token
)
inherited

Finds and returns an object instance provided for a token.

Unlike provideToken, null is returned if a provider is not found.

Implementation

T provideTokenOptional<T>(OpaqueToken<T> token) {
  return unsafeCast(get(token, null));
}