addToBuilder static method

void addToBuilder(
  1. ObjCProtocolBuilder builder, {
  2. required ObjCObjectBase remoteObjectProxy(),
  3. required ObjCObjectBase remoteObjectProxyWithErrorHandler_(
    1. ObjCBlock<Void Function(NSError)>
    ),
  4. ObjCObjectBase synchronousRemoteObjectProxyWithErrorHandler_(
    1. ObjCBlock<Void Function(NSError)>
    )?,
  5. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSXPCProxyCreating protocol to an existing objc.ObjCProtocolBuilder.

Note: You cannot call this method after you have called builder.build.

Implementation

static void addToBuilder(
  objc.ObjCProtocolBuilder builder, {
  required Dartinstancetype Function() remoteObjectProxy,
  required objc.ObjCObjectBase Function(
    objc.ObjCBlock<ffi.Void Function(objc.NSError)>,
  )
  remoteObjectProxyWithErrorHandler_,
  objc.ObjCObjectBase Function(
    objc.ObjCBlock<ffi.Void Function(objc.NSError)>,
  )?
  synchronousRemoteObjectProxyWithErrorHandler_,
  bool $keepIsolateAlive = true,
}) {
  NSXPCProxyCreating.remoteObjectProxy.implement(builder, remoteObjectProxy);
  NSXPCProxyCreating.remoteObjectProxyWithErrorHandler_.implement(
    builder,
    remoteObjectProxyWithErrorHandler_,
  );
  NSXPCProxyCreating.synchronousRemoteObjectProxyWithErrorHandler_.implement(
    builder,
    synchronousRemoteObjectProxyWithErrorHandler_,
  );
  builder.addProtocol($protocol);
}