Semantics constructor

Semantics({
  1. Key? key,
  2. Widget? child,
  3. bool container = false,
  4. bool explicitChildNodes = false,
  5. bool excludeSemantics = false,
  6. bool blockUserActions = false,
  7. bool? enabled,
  8. bool? checked,
  9. bool? mixed,
  10. bool? selected,
  11. bool? toggled,
  12. bool? button,
  13. bool? slider,
  14. bool? keyboardKey,
  15. bool? link,
  16. Uri? linkUrl,
  17. bool? header,
  18. int? headingLevel,
  19. bool? textField,
  20. bool? readOnly,
  21. bool? focusable,
  22. bool? focused,
  23. bool? inMutuallyExclusiveGroup,
  24. bool? obscured,
  25. bool? multiline,
  26. bool? scopesRoute,
  27. bool? namesRoute,
  28. bool? hidden,
  29. bool? image,
  30. bool? liveRegion,
  31. bool? expanded,
  32. bool? isRequired,
  33. int? maxValueLength,
  34. int? currentValueLength,
  35. String? identifier,
  36. String? label,
  37. AttributedString? attributedLabel,
  38. String? value,
  39. AttributedString? attributedValue,
  40. String? increasedValue,
  41. AttributedString? attributedIncreasedValue,
  42. String? decreasedValue,
  43. AttributedString? attributedDecreasedValue,
  44. String? hint,
  45. AttributedString? attributedHint,
  46. String? tooltip,
  47. String? onTapHint,
  48. String? onLongPressHint,
  49. TextDirection? textDirection,
  50. SemanticsSortKey? sortKey,
  51. SemanticsTag? tagForChildren,
  52. VoidCallback? onTap,
  53. VoidCallback? onLongPress,
  54. VoidCallback? onScrollLeft,
  55. VoidCallback? onScrollRight,
  56. VoidCallback? onScrollUp,
  57. VoidCallback? onScrollDown,
  58. VoidCallback? onIncrease,
  59. VoidCallback? onDecrease,
  60. VoidCallback? onCopy,
  61. VoidCallback? onCut,
  62. VoidCallback? onPaste,
  63. VoidCallback? onDismiss,
  64. MoveCursorHandler? onMoveCursorForwardByCharacter,
  65. MoveCursorHandler? onMoveCursorBackwardByCharacter,
  66. SetSelectionHandler? onSetSelection,
  67. SetTextHandler? onSetText,
  68. VoidCallback? onDidGainAccessibilityFocus,
  69. VoidCallback? onDidLoseAccessibilityFocus,
  70. VoidCallback? onFocus,
  71. Map<CustomSemanticsAction, VoidCallback>? customSemanticsActions,
  72. SemanticsRole? role,
  73. Set<String>? controlsNodes,
  74. SemanticsValidationResult validationResult = SemanticsValidationResult.none,
  75. SemanticsInputType? inputType,
})

Creates a semantic annotation.

To create a const instance of Semantics, use the Semantics.fromProperties constructor.

See also:

  • SemanticsProperties, which contains a complete documentation for each of the constructor parameters that belongs to semantics properties.
  • SemanticsSortKey for a class that determines accessibility traversal order.

Implementation

Semantics({
  Key? key,
  Widget? child,
  bool container = false,
  bool explicitChildNodes = false,
  bool excludeSemantics = false,
  bool blockUserActions = false,
  bool? enabled,
  bool? checked,
  bool? mixed,
  bool? selected,
  bool? toggled,
  bool? button,
  bool? slider,
  bool? keyboardKey,
  bool? link,
  Uri? linkUrl,
  bool? header,
  int? headingLevel,
  bool? textField,
  bool? readOnly,
  bool? focusable,
  bool? focused,
  bool? inMutuallyExclusiveGroup,
  bool? obscured,
  bool? multiline,
  bool? scopesRoute,
  bool? namesRoute,
  bool? hidden,
  bool? image,
  bool? liveRegion,
  bool? expanded,
  bool? isRequired,
  int? maxValueLength,
  int? currentValueLength,
  String? identifier,
  String? label,
  AttributedString? attributedLabel,
  String? value,
  AttributedString? attributedValue,
  String? increasedValue,
  AttributedString? attributedIncreasedValue,
  String? decreasedValue,
  AttributedString? attributedDecreasedValue,
  String? hint,
  AttributedString? attributedHint,
  String? tooltip,
  String? onTapHint,
  String? onLongPressHint,
  TextDirection? textDirection,
  SemanticsSortKey? sortKey,
  SemanticsTag? tagForChildren,
  VoidCallback? onTap,
  VoidCallback? onLongPress,
  VoidCallback? onScrollLeft,
  VoidCallback? onScrollRight,
  VoidCallback? onScrollUp,
  VoidCallback? onScrollDown,
  VoidCallback? onIncrease,
  VoidCallback? onDecrease,
  VoidCallback? onCopy,
  VoidCallback? onCut,
  VoidCallback? onPaste,
  VoidCallback? onDismiss,
  MoveCursorHandler? onMoveCursorForwardByCharacter,
  MoveCursorHandler? onMoveCursorBackwardByCharacter,
  SetSelectionHandler? onSetSelection,
  SetTextHandler? onSetText,
  VoidCallback? onDidGainAccessibilityFocus,
  VoidCallback? onDidLoseAccessibilityFocus,
  VoidCallback? onFocus,
  Map<CustomSemanticsAction, VoidCallback>? customSemanticsActions,
  SemanticsRole? role,
  Set<String>? controlsNodes,
  SemanticsValidationResult validationResult = SemanticsValidationResult.none,
  ui.SemanticsInputType? inputType,
}) : this.fromProperties(
       key: key,
       child: child,
       container: container,
       explicitChildNodes: explicitChildNodes,
       excludeSemantics: excludeSemantics,
       blockUserActions: blockUserActions,
       properties: SemanticsProperties(
         enabled: enabled,
         checked: checked,
         mixed: mixed,
         expanded: expanded,
         toggled: toggled,
         selected: selected,
         button: button,
         slider: slider,
         keyboardKey: keyboardKey,
         link: link,
         linkUrl: linkUrl,
         header: header,
         headingLevel: headingLevel,
         textField: textField,
         readOnly: readOnly,
         focusable: focusable,
         focused: focused,
         inMutuallyExclusiveGroup: inMutuallyExclusiveGroup,
         obscured: obscured,
         multiline: multiline,
         scopesRoute: scopesRoute,
         namesRoute: namesRoute,
         hidden: hidden,
         image: image,
         liveRegion: liveRegion,
         isRequired: isRequired,
         maxValueLength: maxValueLength,
         currentValueLength: currentValueLength,
         identifier: identifier,
         label: label,
         attributedLabel: attributedLabel,
         value: value,
         attributedValue: attributedValue,
         increasedValue: increasedValue,
         attributedIncreasedValue: attributedIncreasedValue,
         decreasedValue: decreasedValue,
         attributedDecreasedValue: attributedDecreasedValue,
         hint: hint,
         attributedHint: attributedHint,
         tooltip: tooltip,
         textDirection: textDirection,
         sortKey: sortKey,
         tagForChildren: tagForChildren,
         onTap: onTap,
         onLongPress: onLongPress,
         onScrollLeft: onScrollLeft,
         onScrollRight: onScrollRight,
         onScrollUp: onScrollUp,
         onScrollDown: onScrollDown,
         onIncrease: onIncrease,
         onDecrease: onDecrease,
         onCopy: onCopy,
         onCut: onCut,
         onPaste: onPaste,
         onMoveCursorForwardByCharacter: onMoveCursorForwardByCharacter,
         onMoveCursorBackwardByCharacter: onMoveCursorBackwardByCharacter,
         onDidGainAccessibilityFocus: onDidGainAccessibilityFocus,
         onDidLoseAccessibilityFocus: onDidLoseAccessibilityFocus,
         onFocus: onFocus,
         onDismiss: onDismiss,
         onSetSelection: onSetSelection,
         onSetText: onSetText,
         customSemanticsActions: customSemanticsActions,
         hintOverrides:
             onTapHint != null || onLongPressHint != null
                 ? SemanticsHintOverrides(onTapHint: onTapHint, onLongPressHint: onLongPressHint)
                 : null,
         role: role,
         controlsNodes: controlsNodes,
         validationResult: validationResult,
         inputType: inputType,
       ),
     );