Semantics constructor

  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 link,
  12. bool header,
  13. bool textField,
  14. bool readOnly,
  15. bool focusable,
  16. bool focused,
  17. bool inMutuallyExclusiveGroup,
  18. bool obscured,
  19. bool multiline,
  20. bool scopesRoute,
  21. bool namesRoute,
  22. bool hidden,
  23. bool image,
  24. bool liveRegion,
  25. int maxValueLength,
  26. int currentValueLength,
  27. String label,
  28. String value,
  29. String increasedValue,
  30. String decreasedValue,
  31. String hint,
  32. String onTapHint,
  33. String onLongPressHint,
  34. TextDirection textDirection,
  35. SemanticsSortKey sortKey,
  36. VoidCallback onTap,
  37. VoidCallback onLongPress,
  38. VoidCallback onScrollLeft,
  39. VoidCallback onScrollRight,
  40. VoidCallback onScrollUp,
  41. VoidCallback onScrollDown,
  42. VoidCallback onIncrease,
  43. VoidCallback onDecrease,
  44. VoidCallback onCopy,
  45. VoidCallback onCut,
  46. VoidCallback onPaste,
  47. VoidCallback onDismiss,
  48. MoveCursorHandler onMoveCursorForwardByCharacter,
  49. MoveCursorHandler onMoveCursorBackwardByCharacter,
  50. SetSelectionHandler onSetSelection,
  51. VoidCallback onDidGainAccessibilityFocus,
  52. VoidCallback onDidLoseAccessibilityFocus,
  53. 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:


  Key key,
  Widget child,
  bool container = false,
  bool explicitChildNodes = false,
  bool excludeSemantics = false,
  bool enabled,
  bool checked,
  bool selected,
  bool toggled,
  bool button,
  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,
  String value,
  String increasedValue,
  String decreasedValue,
  String hint,
  String onTapHint,
  String onLongPressHint,
  TextDirection textDirection,
  SemanticsSortKey sortKey,
  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,
  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,
    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,
    value: value,
    increasedValue: increasedValue,
    decreasedValue: decreasedValue,
    hint: hint,
    textDirection: textDirection,
    sortKey: sortKey,
    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,
    customSemanticsActions: customSemanticsActions,
    hintOverrides: onTapHint != null || onLongPressHint != null ?
        onTapHint: onTapHint,
        onLongPressHint: onLongPressHint,
      ) : null,