SemanticsModifier constructor

SemanticsModifier({
  1. Key? key,
  2. Key? modifierKey,
  3. Widget? child,
  4. bool container = false,
  5. bool explicitChildNodes = false,
  6. bool excludeSemantics = false,
  7. bool? enabled,
  8. bool? checked,
  9. bool? selected,
  10. bool? toggled,
  11. bool? button,
  12. bool? slider,
  13. bool? keyboardKey,
  14. bool? link,
  15. bool? header,
  16. bool? textField,
  17. bool? readOnly,
  18. bool? focusable,
  19. bool? focused,
  20. bool? inMutuallyExclusiveGroup,
  21. bool? obscured,
  22. bool? multiline,
  23. bool? scopesRoute,
  24. bool? namesRoute,
  25. bool? hidden,
  26. bool? image,
  27. bool? liveRegion,
  28. int? maxValueLength,
  29. int? currentValueLength,
  30. String? label,
  31. AttributedString? attributedLabel,
  32. String? value,
  33. AttributedString? attributedValue,
  34. String? increasedValue,
  35. AttributedString? attributedIncreasedValue,
  36. String? decreasedValue,
  37. AttributedString? attributedDecreasedValue,
  38. String? hint,
  39. AttributedString? attributedHint,
  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

SemanticsModifier({
  Key? key,
  Key? modifierKey,
  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? 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,
        modifierKey: modifierKey,
        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,
          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,
        ),
      );