getRequiredKeyedServiceFromType method

Object getRequiredKeyedServiceFromType(
  1. Type serviceType,
  2. Object? serviceKey
)

/// Get service of type serviceType from the ServiceProvider.

Implementation

Object getRequiredKeyedServiceFromType(
  Type serviceType,
  Object? serviceKey,
) {
  if (this is KeyedServiceProvider) {
    return (this as KeyedServiceProvider).getRequiredKeyedServiceFromType(
      serviceType,
      serviceKey,
    );
  }

  throw InvalidOperationException(
    message: 'This service provider doesn\'t support keyed services.',
  );
}