Semantics constructor
- 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? 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,
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,
),
);