addToBuilderAsBlocking static method

void addToBuilderAsBlocking(
  1. ObjCProtocolBuilder builder, {
  2. required void pasteboard_item_provideDataForType_(
    1. NSPasteboard?,
    2. NSPasteboardItem,
    3. DartNSPasteboardType
    ),
  3. void pasteboardFinishedWithDataProvider_(
    1. NSPasteboard
    )?,
  4. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSPasteboardItemDataProvider protocol to an existing objc.ObjCProtocolBuilder. All methods that can be implemented as blocking listeners will be.

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

Implementation

static void addToBuilderAsBlocking(
  objc.ObjCProtocolBuilder builder, {
  required void Function(
    NSPasteboard?,
    NSPasteboardItem,
    DartNSPasteboardType,
  )
  pasteboard_item_provideDataForType_,
  void Function(NSPasteboard)? pasteboardFinishedWithDataProvider_,
  bool $keepIsolateAlive = true,
}) {
  NSPasteboardItemDataProvider.pasteboard_item_provideDataForType_
      .implementAsBlocking(builder, pasteboard_item_provideDataForType_);
  NSPasteboardItemDataProvider.pasteboardFinishedWithDataProvider_
      .implementAsBlocking(builder, pasteboardFinishedWithDataProvider_);
  builder.addProtocol($protocol);
}