Semantics constructor Null safety

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

Creates a semantic annotation.

The container argument must not be null. To create a const instance of Semantics, use the Semantics.fromProperties constructor.

See also:

Implementation

Semantics({
  Key? key,
  Widget? child,
  bool container = false,
  bool explicitChildNodes = false,
  bool excludeSemantics = false,
  bool? enabled,
  bool? checked,
  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,
  int? maxValueLength,
  int? currentValueLength,
  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,
  properties: SemanticsProperties(
    enabled: enabled,
    checked: checked,
    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,
    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,
  ),
);