implementAsBlocking static method

NSTextInputTraits implementAsBlocking({
  1. NSTextInputTraitType autocorrectionType()?,
  2. void setAutocorrectionType_(
    1. NSTextInputTraitType
    )?,
  3. NSTextInputTraitType spellCheckingType()?,
  4. void setSpellCheckingType_(
    1. NSTextInputTraitType
    )?,
  5. NSTextInputTraitType grammarCheckingType()?,
  6. void setGrammarCheckingType_(
    1. NSTextInputTraitType
    )?,
  7. NSTextInputTraitType smartQuotesType()?,
  8. void setSmartQuotesType_(
    1. NSTextInputTraitType
    )?,
  9. NSTextInputTraitType smartDashesType()?,
  10. void setSmartDashesType_(
    1. NSTextInputTraitType
    )?,
  11. NSTextInputTraitType smartInsertDeleteType()?,
  12. void setSmartInsertDeleteType_(
    1. NSTextInputTraitType
    )?,
  13. NSTextInputTraitType textReplacementType()?,
  14. void setTextReplacementType_(
    1. NSTextInputTraitType
    )?,
  15. NSTextInputTraitType dataDetectionType()?,
  16. void setDataDetectionType_(
    1. NSTextInputTraitType
    )?,
  17. NSTextInputTraitType linkDetectionType()?,
  18. void setLinkDetectionType_(
    1. NSTextInputTraitType
    )?,
  19. NSTextInputTraitType textCompletionType()?,
  20. void setTextCompletionType_(
    1. NSTextInputTraitType
    )?,
  21. NSTextInputTraitType inlinePredictionType()?,
  22. void setInlinePredictionType_(
    1. NSTextInputTraitType
    )?,
  23. NSTextInputTraitType mathExpressionCompletionType()?,
  24. void setMathExpressionCompletionType_(
    1. NSTextInputTraitType
    )?,
  25. NSWritingToolsBehavior writingToolsBehavior()?,
  26. void setWritingToolsBehavior_(
    1. NSWritingToolsBehavior
    )?,
  27. NSWritingToolsResultOptions allowedWritingToolsResultOptions()?,
  28. void setAllowedWritingToolsResultOptions_(
    1. NSWritingToolsResultOptions
    )?,
  29. bool $keepIsolateAlive = true,
})

Builds an object that implements the NSTextInputTraits 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 NSTextInputTraits implementAsBlocking({
  NSTextInputTraitType Function()? autocorrectionType,
  void Function(NSTextInputTraitType)? setAutocorrectionType_,
  NSTextInputTraitType Function()? spellCheckingType,
  void Function(NSTextInputTraitType)? setSpellCheckingType_,
  NSTextInputTraitType Function()? grammarCheckingType,
  void Function(NSTextInputTraitType)? setGrammarCheckingType_,
  NSTextInputTraitType Function()? smartQuotesType,
  void Function(NSTextInputTraitType)? setSmartQuotesType_,
  NSTextInputTraitType Function()? smartDashesType,
  void Function(NSTextInputTraitType)? setSmartDashesType_,
  NSTextInputTraitType Function()? smartInsertDeleteType,
  void Function(NSTextInputTraitType)? setSmartInsertDeleteType_,
  NSTextInputTraitType Function()? textReplacementType,
  void Function(NSTextInputTraitType)? setTextReplacementType_,
  NSTextInputTraitType Function()? dataDetectionType,
  void Function(NSTextInputTraitType)? setDataDetectionType_,
  NSTextInputTraitType Function()? linkDetectionType,
  void Function(NSTextInputTraitType)? setLinkDetectionType_,
  NSTextInputTraitType Function()? textCompletionType,
  void Function(NSTextInputTraitType)? setTextCompletionType_,
  NSTextInputTraitType Function()? inlinePredictionType,
  void Function(NSTextInputTraitType)? setInlinePredictionType_,
  NSTextInputTraitType Function()? mathExpressionCompletionType,
  void Function(NSTextInputTraitType)? setMathExpressionCompletionType_,
  NSWritingToolsBehavior Function()? writingToolsBehavior,
  void Function(NSWritingToolsBehavior)? setWritingToolsBehavior_,
  NSWritingToolsResultOptions Function()? allowedWritingToolsResultOptions,
  void Function(NSWritingToolsResultOptions)?
  setAllowedWritingToolsResultOptions_,
  bool $keepIsolateAlive = true,
}) {
  final builder = objc.ObjCProtocolBuilder(debugName: 'NSTextInputTraits');
  NSTextInputTraits.autocorrectionType.implement(builder, autocorrectionType);
  NSTextInputTraits.setAutocorrectionType_.implementAsBlocking(
    builder,
    setAutocorrectionType_,
  );
  NSTextInputTraits.spellCheckingType.implement(builder, spellCheckingType);
  NSTextInputTraits.setSpellCheckingType_.implementAsBlocking(
    builder,
    setSpellCheckingType_,
  );
  NSTextInputTraits.grammarCheckingType.implement(
    builder,
    grammarCheckingType,
  );
  NSTextInputTraits.setGrammarCheckingType_.implementAsBlocking(
    builder,
    setGrammarCheckingType_,
  );
  NSTextInputTraits.smartQuotesType.implement(builder, smartQuotesType);
  NSTextInputTraits.setSmartQuotesType_.implementAsBlocking(
    builder,
    setSmartQuotesType_,
  );
  NSTextInputTraits.smartDashesType.implement(builder, smartDashesType);
  NSTextInputTraits.setSmartDashesType_.implementAsBlocking(
    builder,
    setSmartDashesType_,
  );
  NSTextInputTraits.smartInsertDeleteType.implement(
    builder,
    smartInsertDeleteType,
  );
  NSTextInputTraits.setSmartInsertDeleteType_.implementAsBlocking(
    builder,
    setSmartInsertDeleteType_,
  );
  NSTextInputTraits.textReplacementType.implement(
    builder,
    textReplacementType,
  );
  NSTextInputTraits.setTextReplacementType_.implementAsBlocking(
    builder,
    setTextReplacementType_,
  );
  NSTextInputTraits.dataDetectionType.implement(builder, dataDetectionType);
  NSTextInputTraits.setDataDetectionType_.implementAsBlocking(
    builder,
    setDataDetectionType_,
  );
  NSTextInputTraits.linkDetectionType.implement(builder, linkDetectionType);
  NSTextInputTraits.setLinkDetectionType_.implementAsBlocking(
    builder,
    setLinkDetectionType_,
  );
  NSTextInputTraits.textCompletionType.implement(builder, textCompletionType);
  NSTextInputTraits.setTextCompletionType_.implementAsBlocking(
    builder,
    setTextCompletionType_,
  );
  NSTextInputTraits.inlinePredictionType.implement(
    builder,
    inlinePredictionType,
  );
  NSTextInputTraits.setInlinePredictionType_.implementAsBlocking(
    builder,
    setInlinePredictionType_,
  );
  NSTextInputTraits.mathExpressionCompletionType.implement(
    builder,
    mathExpressionCompletionType,
  );
  NSTextInputTraits.setMathExpressionCompletionType_.implementAsBlocking(
    builder,
    setMathExpressionCompletionType_,
  );
  NSTextInputTraits.writingToolsBehavior.implement(
    builder,
    writingToolsBehavior,
  );
  NSTextInputTraits.setWritingToolsBehavior_.implementAsBlocking(
    builder,
    setWritingToolsBehavior_,
  );
  NSTextInputTraits.allowedWritingToolsResultOptions.implement(
    builder,
    allowedWritingToolsResultOptions,
  );
  NSTextInputTraits.setAllowedWritingToolsResultOptions_.implementAsBlocking(
    builder,
    setAllowedWritingToolsResultOptions_,
  );
  builder.addProtocol($protocol);
  return NSTextInputTraits.castFrom(
    builder.build(keepIsolateAlive: $keepIsolateAlive),
  );
}