implement static method
NSScrubberDataSource
implement({
- required DartNSInteger numberOfItemsForScrubber_(),
- required NSScrubberItemView scrubber_viewForItemAtIndex_(),
- bool $keepIsolateAlive = true,
Builds an object that implements the NSScrubberDataSource 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 NSScrubberDataSource implement({
required DartNSInteger Function(NSScrubber) numberOfItemsForScrubber_,
required NSScrubberItemView Function(NSScrubber, DartNSInteger)
scrubber_viewForItemAtIndex_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(debugName: 'NSScrubberDataSource');
NSScrubberDataSource.numberOfItemsForScrubber_.implement(
builder,
numberOfItemsForScrubber_,
);
NSScrubberDataSource.scrubber_viewForItemAtIndex_.implement(
builder,
scrubber_viewForItemAtIndex_,
);
builder.addProtocol($protocol);
return NSScrubberDataSource.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}