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. bool? header,
  17. int? headingLevel,
  18. bool? textField,
  19. bool? readOnly,
  20. bool? focusable,
  21. bool? focused,
  22. bool? inMutuallyExclusiveGroup,
  23. bool? obscured,
  24. bool? multiline,
  25. bool? scopesRoute,
  26. bool? namesRoute,
  27. bool? hidden,
  28. bool? image,
  29. bool? liveRegion,
  30. bool? expanded,
  31. int? maxValueLength,
  32. int? currentValueLength,
  33. String? identifier,
  34. String? label,
  35. AttributedString? attributedLabel,
  36. String? value,
  37. AttributedString? attributedValue,
  38. String? increasedValue,
  39. AttributedString? attributedIncreasedValue,
  40. String? decreasedValue,
  41. AttributedString? attributedDecreasedValue,
  42. String? hint,
  43. AttributedString? attributedHint,
  44. String? tooltip,
  45. String? onTapHint,
  46. String? onLongPressHint,
  47. TextDirection? textDirection,
  48. SemanticsSortKey? sortKey,
  49. SemanticsTag? tagForChildren,
  50. VoidCallback? onTap,
  51. VoidCallback? onLongPress,
  52. VoidCallback? onScrollLeft,
  53. VoidCallback? onScrollRight,
  54. VoidCallback? onScrollUp,
  55. VoidCallback? onScrollDown,
  56. VoidCallback? onIncrease,
  57. VoidCallback? onDecrease,
  58. VoidCallback? onCopy,
  59. VoidCallback? onCut,
  60. VoidCallback? onPaste,
  61. VoidCallback? onDismiss,
  62. MoveCursorHandler? onMoveCursorForwardByCharacter,
  63. MoveCursorHandler? onMoveCursorBackwardByCharacter,
  64. SetSelectionHandler? onSetSelection,
  65. SetTextHandler? onSetText,
  66. VoidCallback? onDidGainAccessibilityFocus,
  67. VoidCallback? onDidLoseAccessibilityFocus,
  68. VoidCallback? onFocus,
  69. Map<CustomSemanticsAction, VoidCallback>? customSemanticsActions,
})

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,
  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,
}) : 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,
    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,
  ),
);