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. int? maxValueLength,
  33. int? currentValueLength,
  34. String? identifier,
  35. String? label,
  36. AttributedString? attributedLabel,
  37. String? value,
  38. AttributedString? attributedValue,
  39. String? increasedValue,
  40. AttributedString? attributedIncreasedValue,
  41. String? decreasedValue,
  42. AttributedString? attributedDecreasedValue,
  43. String? hint,
  44. AttributedString? attributedHint,
  45. String? tooltip,
  46. String? onTapHint,
  47. String? onLongPressHint,
  48. TextDirection? textDirection,
  49. SemanticsSortKey? sortKey,
  50. SemanticsTag? tagForChildren,
  51. VoidCallback? onTap,
  52. VoidCallback? onLongPress,
  53. VoidCallback? onScrollLeft,
  54. VoidCallback? onScrollRight,
  55. VoidCallback? onScrollUp,
  56. VoidCallback? onScrollDown,
  57. VoidCallback? onIncrease,
  58. VoidCallback? onDecrease,
  59. VoidCallback? onCopy,
  60. VoidCallback? onCut,
  61. VoidCallback? onPaste,
  62. VoidCallback? onDismiss,
  63. MoveCursorHandler? onMoveCursorForwardByCharacter,
  64. MoveCursorHandler? onMoveCursorBackwardByCharacter,
  65. SetSelectionHandler? onSetSelection,
  66. SetTextHandler? onSetText,
  67. VoidCallback? onDidGainAccessibilityFocus,
  68. VoidCallback? onDidLoseAccessibilityFocus,
  69. VoidCallback? onFocus,
  70. Map<CustomSemanticsAction, VoidCallback>? customSemanticsActions,
  71. SemanticsRole? role,
})

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,
  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,
  ui.SemanticsRole? role,
}) : 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,
         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,
       ),
     );