implement static method

NSComboBoxCellDataSource implement({
  1. DartNSInteger numberOfItemsInComboBoxCell_(
    1. NSComboBoxCell
    )?,
  2. ObjCObjectBase comboBoxCell_objectValueForItemAtIndex_(
    1. NSComboBoxCell,
    2. DartNSInteger
    )?,
  3. DartNSUInteger comboBoxCell_indexOfItemWithStringValue_(
    1. NSComboBoxCell,
    2. NSString
    )?,
  4. NSString? comboBoxCell_completedString_(
    1. NSComboBoxCell,
    2. NSString
    )?,
  5. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSComboBoxCellDataSource 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 NSComboBoxCellDataSource implement({
  DartNSInteger Function(NSComboBoxCell)? numberOfItemsInComboBoxCell_,
  objc.ObjCObjectBase Function(NSComboBoxCell, DartNSInteger)?
  comboBoxCell_objectValueForItemAtIndex_,
  DartNSUInteger Function(NSComboBoxCell, objc.NSString)?
  comboBoxCell_indexOfItemWithStringValue_,
  objc.NSString? Function(NSComboBoxCell, objc.NSString)?
  comboBoxCell_completedString_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(
    debugName: 'NSComboBoxCellDataSource',
  );
  NSComboBoxCellDataSource.numberOfItemsInComboBoxCell_.implement(
    builder,
    numberOfItemsInComboBoxCell_,
  );
  NSComboBoxCellDataSource.comboBoxCell_objectValueForItemAtIndex_.implement(
    builder,
    comboBoxCell_objectValueForItemAtIndex_,
  );
  NSComboBoxCellDataSource.comboBoxCell_indexOfItemWithStringValue_.implement(
    builder,
    comboBoxCell_indexOfItemWithStringValue_,
  );
  NSComboBoxCellDataSource.comboBoxCell_completedString_.implement(
    builder,
    comboBoxCell_completedString_,
  );
  builder.addProtocol($protocol);
  return NSComboBoxCellDataSource.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}