implement static method

NSCandidateListTouchBarItemDelegate implement({
  1. void candidateListTouchBarItem_beginSelectingCandidateAtIndex_(
    1. NSCandidateListTouchBarItem,
    2. DartNSInteger
    )?,
  2. void candidateListTouchBarItem_changeSelectionFromCandidateAtIndex_toIndex_(
    1. NSCandidateListTouchBarItem,
    2. DartNSInteger,
    3. DartNSInteger
    )?,
  3. void candidateListTouchBarItem_endSelectingCandidateAtIndex_(
    1. NSCandidateListTouchBarItem,
    2. DartNSInteger
    )?,
  4. void candidateListTouchBarItem_changedCandidateListVisibility_(
    1. NSCandidateListTouchBarItem,
    2. bool
    )?,
  5. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSCandidateListTouchBarItemDelegate 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 NSCandidateListTouchBarItemDelegate implement({
  void Function(NSCandidateListTouchBarItem, DartNSInteger)?
  candidateListTouchBarItem_beginSelectingCandidateAtIndex_,
  void Function(NSCandidateListTouchBarItem, DartNSInteger, DartNSInteger)?
  candidateListTouchBarItem_changeSelectionFromCandidateAtIndex_toIndex_,
  void Function(NSCandidateListTouchBarItem, DartNSInteger)?
  candidateListTouchBarItem_endSelectingCandidateAtIndex_,
  void Function(NSCandidateListTouchBarItem, bool)?
  candidateListTouchBarItem_changedCandidateListVisibility_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(
    debugName: 'NSCandidateListTouchBarItemDelegate',
  );
  NSCandidateListTouchBarItemDelegate
      .candidateListTouchBarItem_beginSelectingCandidateAtIndex_
      .implement(
        builder,
        candidateListTouchBarItem_beginSelectingCandidateAtIndex_,
      );
  NSCandidateListTouchBarItemDelegate
      .candidateListTouchBarItem_changeSelectionFromCandidateAtIndex_toIndex_
      .implement(
        builder,
        candidateListTouchBarItem_changeSelectionFromCandidateAtIndex_toIndex_,
      );
  NSCandidateListTouchBarItemDelegate
      .candidateListTouchBarItem_endSelectingCandidateAtIndex_
      .implement(
        builder,
        candidateListTouchBarItem_endSelectingCandidateAtIndex_,
      );
  NSCandidateListTouchBarItemDelegate
      .candidateListTouchBarItem_changedCandidateListVisibility_
      .implement(
        builder,
        candidateListTouchBarItem_changedCandidateListVisibility_,
      );
  builder.addProtocol($protocol);
  return NSCandidateListTouchBarItemDelegate.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}