implementAsBlocking static method
NSPasteboardItemDataProvider
implementAsBlocking({
- required void pasteboard_item_provideDataForType_(),
- void pasteboardFinishedWithDataProvider_()?,
- bool $keepIsolateAlive = true,
Builds an object that implements the NSPasteboardItemDataProvider protocol. To implement
multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly. All
methods that can be implemented as blocking listeners will be.
If $keepIsolateAlive is true, this protocol will keep this isolate
alive until it is garbage collected by both Dart and ObjC.
Implementation
static NSPasteboardItemDataProvider implementAsBlocking({
required void Function(
NSPasteboard?,
NSPasteboardItem,
DartNSPasteboardType,
)
pasteboard_item_provideDataForType_,
void Function(NSPasteboard)? pasteboardFinishedWithDataProvider_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(
debugName: 'NSPasteboardItemDataProvider',
);
NSPasteboardItemDataProvider.pasteboard_item_provideDataForType_
.implementAsBlocking(builder, pasteboard_item_provideDataForType_);
NSPasteboardItemDataProvider.pasteboardFinishedWithDataProvider_
.implementAsBlocking(builder, pasteboardFinishedWithDataProvider_);
builder.addProtocol($protocol);
return NSPasteboardItemDataProvider.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}