implementAsBlocking static method

NSRuleEditorDelegate implementAsBlocking({
  1. required DartNSInteger ruleEditor_numberOfChildrenForCriterion_withRowType_(
    1. NSRuleEditor,
    2. ObjCObjectBase?,
    3. NSRuleEditorRowType
    ),
  2. required ObjCObjectBase ruleEditor_child_forCriterion_withRowType_(
    1. NSRuleEditor,
    2. DartNSInteger,
    3. ObjCObjectBase?,
    4. NSRuleEditorRowType,
    ),
  3. required ObjCObjectBase ruleEditor_displayValueForCriterion_inRow_(
    1. NSRuleEditor,
    2. ObjCObjectBase,
    3. DartNSInteger
    ),
  4. NSDictionary? ruleEditor_predicatePartsForCriterion_withDisplayValue_inRow_(
    1. NSRuleEditor,
    2. ObjCObjectBase,
    3. ObjCObjectBase,
    4. DartNSInteger,
    )?,
  5. void ruleEditorRowsDidChange_(
    1. NSNotification
    )?,
  6. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSRuleEditorDelegate 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 NSRuleEditorDelegate implementAsBlocking({
  required DartNSInteger Function(
    NSRuleEditor,
    objc.ObjCObjectBase?,
    NSRuleEditorRowType,
  )
  ruleEditor_numberOfChildrenForCriterion_withRowType_,
  required objc.ObjCObjectBase Function(
    NSRuleEditor,
    DartNSInteger,
    objc.ObjCObjectBase?,
    NSRuleEditorRowType,
  )
  ruleEditor_child_forCriterion_withRowType_,
  required objc.ObjCObjectBase Function(
    NSRuleEditor,
    objc.ObjCObjectBase,
    DartNSInteger,
  )
  ruleEditor_displayValueForCriterion_inRow_,
  objc.NSDictionary? Function(
    NSRuleEditor,
    objc.ObjCObjectBase,
    objc.ObjCObjectBase,
    DartNSInteger,
  )?
  ruleEditor_predicatePartsForCriterion_withDisplayValue_inRow_,
  void Function(objc.NSNotification)? ruleEditorRowsDidChange_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(debugName: 'NSRuleEditorDelegate');
  NSRuleEditorDelegate.ruleEditor_numberOfChildrenForCriterion_withRowType_
      .implement(
        builder,
        ruleEditor_numberOfChildrenForCriterion_withRowType_,
      );
  NSRuleEditorDelegate.ruleEditor_child_forCriterion_withRowType_.implement(
    builder,
    ruleEditor_child_forCriterion_withRowType_,
  );
  NSRuleEditorDelegate.ruleEditor_displayValueForCriterion_inRow_.implement(
    builder,
    ruleEditor_displayValueForCriterion_inRow_,
  );
  NSRuleEditorDelegate
      .ruleEditor_predicatePartsForCriterion_withDisplayValue_inRow_
      .implement(
        builder,
        ruleEditor_predicatePartsForCriterion_withDisplayValue_inRow_,
      );
  NSRuleEditorDelegate.ruleEditorRowsDidChange_.implementAsBlocking(
    builder,
    ruleEditorRowsDidChange_,
  );
  builder.addProtocol($protocol);
  return NSRuleEditorDelegate.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}