callService method

Future<Response> callService(
  1. String name, {
  2. String? isolateId,
  3. Map<String, dynamic>? args,
})
inherited

Call a service that is registered by exactly one client.

Implementation

Future<Response> callService(
  String name, {
  String? isolateId,
  Map<String, dynamic>? args,
}) async {
  final registered = _registeredMethodsForService[name] ?? const [];
  if (registered.isEmpty) {
    throw Exception('There are no registered methods for service "$name"');
  }
  return service!.callMethod(
    registered.first,
    isolateId: isolateId,
    args: args,
  );
}