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