getService<T> method

Future<T> getService<T>([
  1. Object? tokenOrType
])

Gets a service of type T.

  • tokenOrType: An optional token (e.g., InjectorToken) or Type to disambiguate between different implementations of the same type.

Throws an error if the service cannot be resolved.

Implementation

Future<T> getService<T>([Object? tokenOrType]) => _resolver.getService<T>(tokenOrType);