Google is committed to advancing racial equity for Black communities. See how.

addServiceForName<T> method

*[<Null safety>](https://dart.dev/null-safety)*

void addServiceForName <T>(void connector(InterfaceRequest<T>), String serviceName)

Registers the connector function with the given serviceName. The connector function is invoked when the service provider is asked by the framework to connect to the service in the connectToService method.

Implementation

void addServiceForName<T>(
    void Function(InterfaceRequest<T>) connector, String serviceName) {
  _connectorThunks[serviceName] = (Channel? channel) {
    connector(InterfaceRequest<T>(channel));
  };
}