implementAsBlocking static method
NSDrawerDelegate
implementAsBlocking({})
Builds an object that implements the NSDrawerDelegate 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 NSDrawerDelegate implementAsBlocking({
bool Function(NSDrawer)? drawerShouldOpen_,
bool Function(NSDrawer)? drawerShouldClose_,
NSSize Function(NSDrawer, NSSize)? drawerWillResizeContents_toSize_,
void Function(objc.NSNotification)? drawerWillOpen_,
void Function(objc.NSNotification)? drawerDidOpen_,
void Function(objc.NSNotification)? drawerWillClose_,
void Function(objc.NSNotification)? drawerDidClose_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(debugName: 'NSDrawerDelegate');
NSDrawerDelegate.drawerShouldOpen_.implement(builder, drawerShouldOpen_);
NSDrawerDelegate.drawerShouldClose_.implement(builder, drawerShouldClose_);
NSDrawerDelegate.drawerWillResizeContents_toSize_.implement(
builder,
drawerWillResizeContents_toSize_,
);
NSDrawerDelegate.drawerWillOpen_.implementAsBlocking(
builder,
drawerWillOpen_,
);
NSDrawerDelegate.drawerDidOpen_.implementAsBlocking(
builder,
drawerDidOpen_,
);
NSDrawerDelegate.drawerWillClose_.implementAsBlocking(
builder,
drawerWillClose_,
);
NSDrawerDelegate.drawerDidClose_.implementAsBlocking(
builder,
drawerDidClose_,
);
builder.addProtocol($protocol);
return NSDrawerDelegate.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}