sendInvokeMethod method

Future<Object?> sendInvokeMethod(
  1. String channelName,
  2. Object instance,
  3. String methodName,
  4. List<Object?> arguments,
)

Send a message to invoke a method on the PairedInstance paired with instance.

Implementation

Future<Object?> sendInvokeMethod(
  String channelName,
  Object instance,
  String methodName,
  List<Object?> arguments,
) async {
  assert(isPaired(instance));

  final Object? result = await messageDispatcher.sendInvokeMethod(
    channelName,
    getPairedPairedInstance(instance)!,
    methodName,
    converter.convertInstances(instanceManager, arguments)! as List<Object?>,
  );

  return converter.convertPairedInstances(instanceManager, result);
}