connectToServiceWithChannel<T> method

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

void connectToServiceWithChannel <T>(AsyncProxy<T>? serviceProxy, Channel? channel)

Implementation

void connectToServiceWithChannel<T>(
    AsyncProxy<T>? serviceProxy, Channel? channel) {
  if (serviceProxy == null) {
    throw ArgumentError.notNull('serviceProxy');
  }
  if (channel == null) {
    throw ArgumentError.notNull('channel');
  }
  final String? serviceName = serviceProxy.ctrl.$serviceName;
  if (serviceName == null) {
    throw Exception(
        "${serviceProxy.ctrl.$interfaceName}'s controller.\$serviceName must "
        'not be null. Check the FIDL file for a missing [Discoverable]');
  }
  connectToServiceByNameWithChannel(serviceName, channel);
}