implementAsBlocking static method
NSUserNotificationCenterDelegate
implementAsBlocking({})
Builds an object that implements the NSUserNotificationCenterDelegate 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 NSUserNotificationCenterDelegate implementAsBlocking({
void Function(NSUserNotificationCenter, NSUserNotification)?
userNotificationCenter_didDeliverNotification_,
void Function(NSUserNotificationCenter, NSUserNotification)?
userNotificationCenter_didActivateNotification_,
bool Function(NSUserNotificationCenter, NSUserNotification)?
userNotificationCenter_shouldPresentNotification_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(
debugName: 'NSUserNotificationCenterDelegate',
);
NSUserNotificationCenterDelegate
.userNotificationCenter_didDeliverNotification_
.implementAsBlocking(
builder,
userNotificationCenter_didDeliverNotification_,
);
NSUserNotificationCenterDelegate
.userNotificationCenter_didActivateNotification_
.implementAsBlocking(
builder,
userNotificationCenter_didActivateNotification_,
);
NSUserNotificationCenterDelegate
.userNotificationCenter_shouldPresentNotification_
.implement(builder, userNotificationCenter_shouldPresentNotification_);
builder.addProtocol($protocol);
return NSUserNotificationCenterDelegate.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}