implement static method
NSComboBoxDataSource
implement({
- DartNSInteger numberOfItemsInComboBox_()?,
- ObjCObjectBase? comboBox_objectValueForItemAtIndex_()?,
- DartNSUInteger comboBox_indexOfItemWithStringValue_(
- NSComboBox,
- NSString
- NSString? comboBox_completedString_(
- NSComboBox,
- NSString
- bool $keepIsolateAlive = true,
Builds an object that implements the NSComboBoxDataSource 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 NSComboBoxDataSource implement({
DartNSInteger Function(NSComboBox)? numberOfItemsInComboBox_,
objc.ObjCObjectBase? Function(NSComboBox, DartNSInteger)?
comboBox_objectValueForItemAtIndex_,
DartNSUInteger Function(NSComboBox, objc.NSString)?
comboBox_indexOfItemWithStringValue_,
objc.NSString? Function(NSComboBox, objc.NSString)?
comboBox_completedString_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(debugName: 'NSComboBoxDataSource');
NSComboBoxDataSource.numberOfItemsInComboBox_.implement(
builder,
numberOfItemsInComboBox_,
);
NSComboBoxDataSource.comboBox_objectValueForItemAtIndex_.implement(
builder,
comboBox_objectValueForItemAtIndex_,
);
NSComboBoxDataSource.comboBox_indexOfItemWithStringValue_.implement(
builder,
comboBox_indexOfItemWithStringValue_,
);
NSComboBoxDataSource.comboBox_completedString_.implement(
builder,
comboBox_completedString_,
);
builder.addProtocol($protocol);
return NSComboBoxDataSource.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}