implementAsBlocking static method
NSTextStorageDelegate
implementAsBlocking({
- void textStorage_willProcessEditing_range_changeInLength_()?,
- void textStorage_didProcessEditing_range_changeInLength_()?,
- bool $keepIsolateAlive = true,
Builds an object that implements the NSTextStorageDelegate 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 NSTextStorageDelegate implementAsBlocking({
void Function(
NSTextStorage,
NSTextStorageEditActions,
NSRange,
DartNSInteger,
)?
textStorage_willProcessEditing_range_changeInLength_,
void Function(
NSTextStorage,
NSTextStorageEditActions,
NSRange,
DartNSInteger,
)?
textStorage_didProcessEditing_range_changeInLength_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(
debugName: 'NSTextStorageDelegate',
);
NSTextStorageDelegate.textStorage_willProcessEditing_range_changeInLength_
.implementAsBlocking(
builder,
textStorage_willProcessEditing_range_changeInLength_,
);
NSTextStorageDelegate.textStorage_didProcessEditing_range_changeInLength_
.implementAsBlocking(
builder,
textStorage_didProcessEditing_range_changeInLength_,
);
builder.addProtocol($protocol);
return NSTextStorageDelegate.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}