implement static method
NSUserNotificationCenterDelegate
implement({})
Builds an object that implements the NSUserNotificationCenterDelegate protocol. To implement
multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly.
If $keepIsolateAlive is true, this protocol will keep this isolate
alive until it is garbage collected by both Dart and ObjC.
Implementation
static NSUserNotificationCenterDelegate implement({
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_
.implement(builder, userNotificationCenter_didDeliverNotification_);
NSUserNotificationCenterDelegate
.userNotificationCenter_didActivateNotification_
.implement(builder, userNotificationCenter_didActivateNotification_);
NSUserNotificationCenterDelegate
.userNotificationCenter_shouldPresentNotification_
.implement(builder, userNotificationCenter_shouldPresentNotification_);
builder.addProtocol($protocol);
return NSUserNotificationCenterDelegate.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}