pub struct SemanticsProperties {Show 78 fields
pub enabled: Option<bool>,
pub checked: Option<bool>,
pub mixed: Option<bool>,
pub expanded: Option<bool>,
pub toggled: Option<bool>,
pub selected: Option<bool>,
pub button: Option<bool>,
pub link: Option<bool>,
pub header: Option<bool>,
pub text_field: Option<bool>,
pub slider: Option<bool>,
pub keyboard_key: Option<bool>,
pub read_only: Option<bool>,
pub focusable: Option<bool>,
pub focused: Option<bool>,
pub accessibility_focus_block_type: Option<AccessibilityFocusBlockType>,
pub in_mutually_exclusive_group: Option<bool>,
pub hidden: Option<bool>,
pub obscured: Option<bool>,
pub multiline: Option<bool>,
pub scopes_route: Option<bool>,
pub names_route: Option<bool>,
pub image: Option<bool>,
pub live_region: Option<bool>,
pub is_required: Option<bool>,
pub max_value_length: Option<i32>,
pub current_value_length: Option<i32>,
pub identifier: Option<String>,
pub traversal_parent_identifier: Option<Rc<dyn Any>>,
pub traversal_child_identifier: Option<Rc<dyn Any>>,
pub label: Option<String>,
pub attributed_label: Option<AttributedString>,
pub value: Option<String>,
pub attributed_value: Option<AttributedString>,
pub increased_value: Option<String>,
pub attributed_increased_value: Option<AttributedString>,
pub decreased_value: Option<String>,
pub attributed_decreased_value: Option<AttributedString>,
pub hint: Option<String>,
pub attributed_hint: Option<AttributedString>,
pub tooltip: Option<String>,
pub heading_level: Option<i32>,
pub hint_overrides: Option<SemanticsHintOverrides>,
pub text_direction: Option<TextDirection>,
pub sort_key: Option<SemanticsSortKeyRef>,
pub tag_for_children: Option<Rc<SemanticsTag>>,
pub link_url: Option<String>,
pub on_tap: Option<VoidCallback>,
pub on_long_press: Option<VoidCallback>,
pub on_scroll_left: Option<VoidCallback>,
pub on_scroll_right: Option<VoidCallback>,
pub on_scroll_up: Option<VoidCallback>,
pub on_scroll_down: Option<VoidCallback>,
pub on_increase: Option<VoidCallback>,
pub on_decrease: Option<VoidCallback>,
pub on_copy: Option<VoidCallback>,
pub on_cut: Option<VoidCallback>,
pub on_paste: Option<VoidCallback>,
pub on_move_cursor_forward_by_character: Option<MoveCursorHandler>,
pub on_move_cursor_backward_by_character: Option<MoveCursorHandler>,
pub on_move_cursor_forward_by_word: Option<MoveCursorHandler>,
pub on_move_cursor_backward_by_word: Option<MoveCursorHandler>,
pub on_set_selection: Option<SetSelectionHandler>,
pub on_set_text: Option<SetTextHandler>,
pub on_did_gain_accessibility_focus: Option<VoidCallback>,
pub on_did_lose_accessibility_focus: Option<VoidCallback>,
pub on_focus: Option<VoidCallback>,
pub on_dismiss: Option<VoidCallback>,
pub on_expand: Option<VoidCallback>,
pub on_collapse: Option<VoidCallback>,
pub custom_semantics_actions: Option<IndexMap<CustomSemanticsAction, VoidCallback>>,
pub role: Option<SemanticsRole>,
pub controls_nodes: Option<IndexSet<String>>,
pub validation_result: SemanticsValidationResult,
pub hit_test_behavior: Option<SemanticsHitTestBehavior>,
pub input_type: Option<SemanticsInputType>,
pub max_value: Option<String>,
pub min_value: Option<String>,
}Expand description
Contains properties used by assistive technologies to make the application more accessible.
The properties of this class are used to generate a SemanticsNodes in the
semantics tree.
Dart’s class does not override ==: a render object compares two by identity, so they are
held as Rc<SemanticsProperties> and compared with Rc::ptr_eq.
Fields§
§enabled: Option<bool>If non-null, indicates that this subtree represents something that can be in an enabled or disabled state.
For example, a button that a user can currently interact with would set this field to true. A button that currently does not respond to user interactions would set this field to false.
checked: Option<bool>If non-null, indicates that this subtree represents a checkbox or similar widget with a “checked” state, and what its current state is.
When the Checkbox.value of a tristate Checkbox is null,
indicating a mixed-state, this value shall be false, in which
case, mixed will be true.
This is mutually exclusive with toggled and mixed.
mixed: Option<bool>If non-null, indicates that this subtree represents a checkbox or similar widget with a “half-checked” state or similar, and whether it is currently in this half-checked state.
This must be null when Checkbox.tristate is false, or
when the widget is not a checkbox. When a tristate
checkbox is fully unchecked/checked, this value shall
be false.
This is mutually exclusive with checked and toggled.
expanded: Option<bool>If non-null, indicates that this subtree represents something that can be in an “expanded” or “collapsed” state.
For example, if a SubmenuButton is opened, this property
should be set to true; otherwise, this property should be
false.
toggled: Option<bool>If non-null, indicates that this subtree represents a toggle switch or similar widget with an “on” state, and what its current state is.
This is mutually exclusive with checked and mixed.
selected: Option<bool>If non-null indicates that this subtree represents something that can be in a selected or unselected state, and what its current state is.
The active tab in a tab bar for example is considered “selected”, whereas all other tabs are unselected.
If non-null, indicates that this subtree represents a button.
TalkBack/VoiceOver provides users with the hint “button” when a button is focused.
link: Option<bool>If non-null, indicates that this subtree represents a link.
iOS’s VoiceOver provides users with a unique hint when a link is focused. Android’s Talkback will announce a link hint the same way it does a button.
header: Option<bool>If non-null, indicates that this subtree represents a header.
A header is typically the top element of a page or section, such as a page title or app bar title.
text_field: Option<bool>If non-null, indicates that this subtree represents a text field.
TalkBack/VoiceOver provide special affordances to enter text into a text field.
slider: Option<bool>If non-null, indicates that this subtree represents a slider.
Talkback/\VoiceOver provides users with the hint “slider” when a slider is focused.
keyboard_key: Option<bool>If non-null, indicates that this subtree represents a keyboard key.
read_only: Option<bool>If non-null, indicates that this subtree is read only.
Only applicable when textField is true.
TalkBack/VoiceOver will treat it as non-editable text field.
focusable: Option<bool>If non-null, whether the node is able to hold input focus.
If focusable is set to false, then focused must not be true.
Input focus indicates that the node will receive keyboard events. It is not to be confused with accessibility focus. Accessibility focus is the green/black rectangular highlight that TalkBack/VoiceOver draws around the element it is reading, and is separate from input focus.
Deprecated: use focused instead; setting focused automatically sets focusable.
focused: Option<bool>If non-null, whether the node currently holds input focus.
If null, the node is not focusable.
At most one node in the tree should hold input focus at any point in time,
and it should not be set to true if focusable is false.
Input focus indicates that the node will receive keyboard events. It is not to be confused with accessibility focus. Accessibility focus is the green/black rectangular highlight that TalkBack/VoiceOver draws around the element it is reading, and is separate from input focus.
accessibility_focus_block_type: Option<AccessibilityFocusBlockType>If non-null, indicates if this subtree or current node is blocked in a11y focus.
This is for accessibility focus, which is the focus used by screen readers like TalkBack and VoiceOver. It is different from input focus, which is usually held by the element that currently responds to keyboard inputs.
in_mutually_exclusive_group: Option<bool>If non-null, whether a semantic node is in a mutually exclusive group.
For example, a radio button is in a mutually exclusive group because only
one radio button in that group can be marked as checked.
If non-null, whether the node is considered hidden.
Hidden elements are currently not visible on screen. They may be covered by other elements or positioned outside of the visible area of a viewport.
Hidden elements cannot gain accessibility focus though regular touch. The only way they can be focused is by moving the focus to them via linear navigation.
Platforms are free to completely ignore hidden elements and new platforms are encouraged to do so.
Instead of marking an element as hidden it should usually be excluded from the semantics tree altogether. Hidden elements are only included in the semantics tree to work around platform limitations and they are mainly used to implement accessibility scrolling on iOS.
obscured: Option<bool>If non-null, whether value should be obscured.
This option is usually set in combination with textField to indicate
that the text field contains a password (or other sensitive information).
Doing so instructs screen readers to not read out the value.
multiline: Option<bool>Whether the value is coming from a field that supports multiline text
editing.
This option is only meaningful when textField is true to indicate
whether it’s a single-line or multiline text field.
This option is null when textField is false.
scopes_route: Option<bool>If non-null, whether the node corresponds to the root of a subtree for which a route name should be announced.
Generally, this is set in combination with
SemanticsConfiguration.explicitChildNodes, since nodes with this flag
are not considered focusable by Android or iOS.
names_route: Option<bool>If non-null, whether the node contains the semantic label for a route.
image: Option<bool>If non-null, whether the node represents an image.
live_region: Option<bool>If non-null, whether the node should be considered a live region.
A live region indicates that updates to semantics node are important. Platforms may use this information to make polite announcements to the user to inform them of updates to this node.
An example of a live region is a SnackBar widget. On Android and iOS,
live region causes a polite announcement to be generated automatically,
even if the widget does not have accessibility focus. This announcement
may not be spoken if the OS accessibility services are already
announcing something else, such as reading the label of a focused widget
or providing a system announcement.
is_required: Option<bool>If non-null, whether the node should be considered required.
If true, user input is required on the semantics node before a form can be submitted. If false, the node is optional before a form can be submitted. If null, the node does not have a required semantics.
For example, a login form requires its email text field to be non-empty.
On web, this will set a aria-required attribute on the DOM element
that corresponds to the semantics node.
max_value_length: Option<i32>The maximum number of characters that can be entered into an editable text field.
For the purpose of this function a character is defined as one Unicode scalar value.
This should only be set when textField is true. Defaults to null,
which means no limit is imposed on the text field.
current_value_length: Option<i32>The current number of characters that have been entered into an editable text field.
For the purpose of this function a character is defined as one Unicode scalar value.
This should only be set when textField is true. Must be set when
maxValueLength is set.
identifier: Option<String>Provides an identifier for the semantics node in native accessibility hierarchy.
This value is not exposed to the users of the app.
It’s usually used for UI testing with tools that work by querying the
native accessibility, like UIAutomator, XCUITest, or Appium. It can be
matched with CommonFinders.bySemanticsIdentifier.
When set, this property implicitly forces the creation of a new
SemanticsNode (equivalent to setting container to true in
Semantics). This ensures the identifier is always attached to its
own node and is not merged into an ancestor.
On Android, this is used for AccessibilityNodeInfo.setViewIdResourceName.
It’ll be appear in accessibility hierarchy as resource-id.
On iOS, this will set UIAccessibilityElement.accessibilityIdentifier.
On web, this will set a flt-semantics-identifier attribute on the DOM element
that corresponds to the semantics node.
traversal_parent_identifier: Option<Rc<dyn Any>>Provides an identifier for establishing parent-child relationships in the semantics traversal tree.
This property is used to create a logical parent-child relationship between
semantics nodes that may not be directly connected in the widget tree. It’s
primarily used with OverlayPortal to ensure proper accessibility traversal
order when overlay content needs to be semantically connected to its parent
widget.
When a semantics node has a traversalParentIdentifier, it indicates that
this node can act as a parent for other nodes that reference this identifier
in their traversalChildIdentifier. This allows assistive technologies
to navigate the UI in the correct logical order.
The traversalParentIdentifier must be unique in the semantics. No two
semantics node can have the same traversalParentIdentifier. This unique
identifier serves as the only reference for its traversal children. To
graft other nodes as the traversal children of this node, assign this same
value to their traversalChildIdentifier.
traversal_child_identifier: Option<Rc<dyn Any>>Provides an identifier for establishing parent-child relationships in the semantics traversal tree.
This property is used to create a logical parent-child relationship between
semantics nodes that may not be directly connected in the widget tree. It’s
primarily used with OverlayPortal to ensure proper accessibility traversal
order when overlay content needs to be semantically connected to its parent
widget.
When a semantics node has a traversalChildIdentifier, it indicates that
this node should be treated as a child of another node that has this same
identifier as its traversalParentIdentifier. This allows assistive technologies
to navigate the UI in the correct logical order.
The traversalChildIdentifier value may be duplicated across multiple
semantics nodes. To establish one or more nodes as the traversal children
of a parent node, assign this identifier the same value as the parent’s
traversalParentIdentifier.
label: Option<String>Provides a textual description of the widget.
If a label is provided, there must either by an ambient Directionality
or an explicit textDirection should be provided.
Callers must not provide both label and attributedLabel. One or both
must be null.
attributed_label: Option<AttributedString>Provides an AttributedString version of textual description of the widget.
If a attributedLabel is provided, there must either by an ambient
Directionality or an explicit textDirection should be provided.
Callers must not provide both label and attributedLabel. One or both
must be null.
value: Option<String>Provides a textual description of the value of the widget.
If a value is provided, there must either by an ambient Directionality
or an explicit textDirection should be provided.
Callers must not provide both value and attributedValue, One or both
must be null.
attributed_value: Option<AttributedString>Provides an AttributedString version of textual description of the value
of the widget.
If a attributedValue is provided, there must either by an ambient
Directionality or an explicit textDirection should be provided.
Callers must not provide both value and attributedValue, One or both
must be null.
increased_value: Option<String>The value that value or attributedValue will become after a
SemanticsAction.increase action has been performed on this widget.
If a value is provided, onIncrease must also be set and there must
either be an ambient Directionality or an explicit textDirection
must be provided.
Callers must not provide both increasedValue and
attributedIncreasedValue, One or both must be null.
attributed_increased_value: Option<AttributedString>The AttributedString that value or attributedValue will become after
a SemanticsAction.increase action has been performed on this widget.
If a attributedIncreasedValue is provided, onIncrease must also be set
and there must either be an ambient Directionality or an explicit
textDirection must be provided.
Callers must not provide both increasedValue and
attributedIncreasedValue, One or both must be null.
decreased_value: Option<String>The value that value or attributedValue will become after a
SemanticsAction.decrease action has been performed on this widget.
If a value is provided, onDecrease must also be set and there must
either be an ambient Directionality or an explicit textDirection
must be provided.
Callers must not provide both decreasedValue and
attributedDecreasedValue, One or both must be null.
attributed_decreased_value: Option<AttributedString>The AttributedString that value or attributedValue will become after
a SemanticsAction.decrease action has been performed on this widget.
If a attributedDecreasedValue is provided, onDecrease must also be set
and there must either be an ambient Directionality or an explicit
textDirection must be provided.
Callers must not provide both decreasedValue and
attributedDecreasedValue, One or both must be null/// provided.
hint: Option<String>Provides a brief textual description of the result of an action performed on the widget.
If a hint is provided, there must either be an ambient Directionality
or an explicit textDirection should be provided.
Callers must not provide both hint and attributedHint, One or both
must be null.
attributed_hint: Option<AttributedString>Provides an AttributedString version of brief textual description of the
result of an action performed on the widget.
If a attributedHint is provided, there must either by an ambient
Directionality or an explicit textDirection should be provided.
Callers must not provide both hint and attributedHint, One or both
must be null.
tooltip: Option<String>Provides a textual description of the widget’s tooltip.
In Android, this property sets the AccessibilityNodeInfo.setTooltipText.
In iOS, this property is appended to the end of the
UIAccessibilityElement.accessibilityLabel.
If a tooltip is provided, there must either by an ambient
Directionality or an explicit textDirection should be provided.
heading_level: Option<i32>The heading level in the document structure.
A heading divides content into sections. For example, an address book application might define headings A, B, C, etc. to divide the list of alphabetically sorted contacts into sections.
Screen readers use this value to determine which part of the page structure this heading represents. A level 1 heading usually indicates the main heading of a page, a level 2 heading the first subsection, a level 3 is a subsection of that, and so on.
On web, this sets the aria-level attribute (e.g., aria-level="1").
On Android, this sets the isHeading property for accessibility.
hint_overrides: Option<SemanticsHintOverrides>Overrides the default accessibility hints provided by the platform.
This hintOverrides property does not affect how the platform processes hints;
it only sets the custom text that will be read by assistive technology.
On Android, these overrides replace the default hints for semantics nodes
with tap or long-press actions. For example, if SemanticsHintOverrides.onTapHint
is provided, instead of saying Double tap to activate, the screen reader
will say Double tap to <onTapHint>.
On iOS, this property is ignored, and default platform behavior applies.
Example usage:
text_direction: Option<TextDirection>The reading direction of the label, value, increasedValue,
decreasedValue, and hint.
Defaults to the ambient Directionality.
sort_key: Option<SemanticsSortKeyRef>Determines the position of this node among its siblings in the traversal sort order.
This is used to describe the order in which the semantic node should be traversed by the accessibility services on the platform (e.g. VoiceOver on iOS and TalkBack on Android).
tag_for_children: Option<Rc<SemanticsTag>>A tag to be applied to the child SemanticsNodes of this widget.
The tag is added to all child SemanticsNodes that pass through the
RenderObject corresponding to this widget while looking to be attached
to a parent SemanticsNode.
Tags are used to communicate to a parent SemanticsNode that a child SemanticsNode was passed through a particular RenderObject. The parent can use this information to determine the shape of the semantics tree.
link_url: Option<String>The URL that this node links to.
On the web, this is used to set the href attribute of the DOM element.
on_tap: Option<VoidCallback>The handler for SemanticsAction.tap.
This is the semantic equivalent of a user briefly tapping the screen with the finger without moving it. For example, a button should implement this action.
VoiceOver users on iOS and TalkBack users on Android may trigger this action by double-tapping the screen while an element is focused.
Note: different OSes or assistive technologies may decide to interpret user inputs differently. Some may simulate real screen taps, while others may call semantics tap. One way to handle taps properly is to provide the same handler to both gesture tap and semantics tap.
on_long_press: Option<VoidCallback>The handler for SemanticsAction.longPress.
This is the semantic equivalent of a user pressing and holding the screen with the finger for a few seconds without moving it.
VoiceOver users on iOS and TalkBack users on Android may trigger this action by double-tapping the screen without lifting the finger after the second tap.
Note: different OSes or assistive technologies may decide to interpret user inputs differently. Some may simulate real long presses, while others may call semantics long press. One way to handle long press properly is to provide the same handler to both gesture long press and semantics long press.
on_scroll_left: Option<VoidCallback>The handler for SemanticsAction.scrollLeft.
This is the semantic equivalent of a user moving their finger across the screen from right to left. It should be recognized by controls that are horizontally scrollable.
VoiceOver users on iOS can trigger this action by swiping left with three
fingers. TalkBack users on Android can trigger this action by swiping
right and then left in one motion path. On Android, onScrollUp and
onScrollLeft share the same gesture. Therefore, only on of them should
be provided.
on_scroll_right: Option<VoidCallback>The handler for SemanticsAction.scrollRight.
This is the semantic equivalent of a user moving their finger across the screen from left to right. It should be recognized by controls that are horizontally scrollable.
VoiceOver users on iOS can trigger this action by swiping right with three
fingers. TalkBack users on Android can trigger this action by swiping
left and then right in one motion path. On Android, onScrollDown and
onScrollRight share the same gesture. Therefore, only on of them should
be provided.
on_scroll_up: Option<VoidCallback>The handler for SemanticsAction.scrollUp.
This is the semantic equivalent of a user moving their finger across the screen from bottom to top. It should be recognized by controls that are vertically scrollable.
VoiceOver users on iOS can trigger this action by swiping up with three
fingers. TalkBack users on Android can trigger this action by swiping
right and then left in one motion path. On Android, onScrollUp and
onScrollLeft share the same gesture. Therefore, only on of them should
be provided.
on_scroll_down: Option<VoidCallback>The handler for SemanticsAction.scrollDown.
This is the semantic equivalent of a user moving their finger across the screen from top to bottom. It should be recognized by controls that are vertically scrollable.
VoiceOver users on iOS can trigger this action by swiping down with three
fingers. TalkBack users on Android can trigger this action by swiping
left and then right in one motion path. On Android, onScrollDown and
onScrollRight share the same gesture. Therefore, only on of them should
be provided.
on_increase: Option<VoidCallback>The handler for SemanticsAction.increase.
This is a request to increase the value represented by the widget. For example, this action might be recognized by a slider control.
If a value is set, increasedValue must also be provided and
onIncrease must ensure that value will be set to increasedValue.
VoiceOver users on iOS can trigger this action by swiping up with one finger. TalkBack users on Android can trigger this action by pressing the volume up button.
on_decrease: Option<VoidCallback>The handler for SemanticsAction.decrease.
This is a request to decrease the value represented by the widget. For example, this action might be recognized by a slider control.
If a value is set, decreasedValue must also be provided and
onDecrease must ensure that value will be set to decreasedValue.
VoiceOver users on iOS can trigger this action by swiping down with one finger. TalkBack users on Android can trigger this action by pressing the volume down button.
on_copy: Option<VoidCallback>The handler for SemanticsAction.copy.
This is a request to copy the current selection to the clipboard.
TalkBack users on Android can trigger this action from the local context menu of a text field, for example.
on_cut: Option<VoidCallback>The handler for SemanticsAction.cut.
This is a request to cut the current selection and place it in the clipboard.
TalkBack users on Android can trigger this action from the local context menu of a text field, for example.
on_paste: Option<VoidCallback>The handler for SemanticsAction.paste.
This is a request to paste the current content of the clipboard.
TalkBack users on Android can trigger this action from the local context menu of a text field, for example.
on_move_cursor_forward_by_character: Option<MoveCursorHandler>The handler for SemanticsAction.moveCursorForwardByCharacter.
This handler is invoked when the user wants to move the cursor in a text field forward by one character.
TalkBack users can trigger this by pressing the volume up key while the input focus is in a text field.
on_move_cursor_backward_by_character: Option<MoveCursorHandler>The handler for SemanticsAction.moveCursorBackwardByCharacter.
This handler is invoked when the user wants to move the cursor in a text field backward by one character.
TalkBack users can trigger this by pressing the volume down key while the input focus is in a text field.
on_move_cursor_forward_by_word: Option<MoveCursorHandler>The handler for SemanticsAction.moveCursorForwardByWord.
This handler is invoked when the user wants to move the cursor in a text field backward by one word.
TalkBack users can trigger this by pressing the volume down key while the input focus is in a text field.
on_move_cursor_backward_by_word: Option<MoveCursorHandler>The handler for SemanticsAction.moveCursorBackwardByWord.
This handler is invoked when the user wants to move the cursor in a text field backward by one word.
TalkBack users can trigger this by pressing the volume down key while the input focus is in a text field.
on_set_selection: Option<SetSelectionHandler>The handler for SemanticsAction.setSelection.
This handler is invoked when the user either wants to change the currently selected text in a text field or change the position of the cursor.
TalkBack users can trigger this handler by selecting “Move cursor to beginning/end” or “Select all” from the local context menu.
on_set_text: Option<SetTextHandler>The handler for SemanticsAction.setText.
This handler is invoked when the user wants to replace the current text in the text field with a new text.
Voice access users can trigger this handler by speaking type <text> to
their Android devices.
on_did_gain_accessibility_focus: Option<VoidCallback>The handler for SemanticsAction.didGainAccessibilityFocus.
This handler is invoked when the node annotated with this handler gains the accessibility focus. The accessibility focus is the green (on Android with TalkBack) or black (on iOS with VoiceOver) rectangle shown on screen to indicate what element an accessibility user is currently interacting with.
The accessibility focus is different from the input focus. The input focus is usually held by the element that currently responds to keyboard inputs. Accessibility focus and input focus can be held by two different nodes!
on_did_lose_accessibility_focus: Option<VoidCallback>The handler for SemanticsAction.didLoseAccessibilityFocus.
This handler is invoked when the node annotated with this handler loses the accessibility focus. The accessibility focus is the green (on Android with TalkBack) or black (on iOS with VoiceOver) rectangle shown on screen to indicate what element an accessibility user is currently interacting with.
The accessibility focus is different from the input focus. The input focus is usually held by the element that currently responds to keyboard inputs. Accessibility focus and input focus can be held by two different nodes!
on_focus: Option<VoidCallback>The handler for SemanticsAction.focus.
This handler is invoked when the assistive technology requests that the
focusable widget corresponding to this semantics node gain input focus.
The FocusNode that manages the focus of the widget must gain focus. The
widget must begin responding to relevant key events. For example:
- Buttons must respond to tap/click events produced via keyboard shortcuts.
- Text fields must become focused and editable, showing an on-screen keyboard, if necessary.
- Checkboxes, switches, and radio buttons must become toggleable using keyboard shortcuts.
Focus behavior is specific to the platform and to the assistive technology
used. See the documentation of SemanticsAction.focus for more detail.
on_dismiss: Option<VoidCallback>The handler for SemanticsAction.dismiss.
This is a request to dismiss the currently focused node.
TalkBack users on Android can trigger this action in the local context menu, and VoiceOver users on iOS can trigger this action with a standard gesture or menu option.
on_expand: Option<VoidCallback>The handler for SemanticsAction.expand.
This is a request to expand the currently focused node. For example, this action might be recognized by a dropdown.
This handler should only be set when the node is in a collapsed state
(i.e., expanded is false).
on_collapse: Option<VoidCallback>The handler for SemanticsAction.collapse.
This is a request to collapse the currently focused node. For example, this action might be recognized by a dropdown.
This handler should only be set when the node is in an expanded state
(i.e., expanded is true).
custom_semantics_actions: Option<IndexMap<CustomSemanticsAction, VoidCallback>>A map from each supported CustomSemanticsAction to a provided handler.
The handler associated with each custom action is called whenever a
semantics action of type SemanticsAction.customAction is received. The
provided argument will be an identifier used to retrieve an instance of
a custom action which can then retrieve the correct handler from this map.
role: Option<SemanticsRole>A enum to describe what role the subtree represents.
Setting the role for a widget subtree helps assistive technologies, such as screen readers, to understand and interact with the UI correctly.
Defaults to SemanticsRole.none if not set, which means the subtree does
not represent any complex ui or controls.
For a list of available roles, see SemanticsRole.
controls_nodes: Option<IndexSet<String>>The SemanticsNode.identifiers of widgets controlled by this subtree.
If a widget is controlling the visibility or content of another widget,
for example, Tabs control child visibilities of TabBarView or
ExpansionTile controls visibility of its expanded content, one must
assign a SemanticsNode.identifier to the content and also provide a set
of identifiers including the content’s identifier to this property.
validation_result: SemanticsValidationResultDescribes the validation result for a form field represented by this widget.
Providing a validation result helps assistive technologies, such as screen readers, to communicate to the user whether they provided correct information in a form.
Defaults to SemanticsValidationResult.none if not set, which means no
validation information is available for the respective semantics node.
For a list of available validation results, see SemanticsValidationResult.
hit_test_behavior: Option<SemanticsHitTestBehavior>Describes how the semantic node should behave during hit testing.
See ui.SemanticsHitTestBehavior for more details.
input_type: Option<SemanticsInputType>The input type for of a editable widget.
This property is only used when the subtree represents a text field.
Assistive technologies use this property to provide better information to users. For example, screen reader reads out the input type of text field when focused.
max_value: Option<String>The maximum value of the node.
Used in conjunction with value to define the current value and range
of a node. A typical usage is for progress indicators, where value
represents the current progress and maxValue defines the maximum
possible value.
min_value: Option<String>The minimum value of the node.
Used in conjunction with value to define the current value and range
of a node. A typical usage is for progress indicators, where value
represents the current progress and minValue defines the minimum
possible value.
Implementations§
Source§impl SemanticsProperties
impl SemanticsProperties
Sourcepub fn new() -> SemanticsProperties
pub fn new() -> SemanticsProperties
Creates a semantic annotation.
Sourcepub fn enabled(self, enabled: bool) -> SemanticsProperties
pub fn enabled(self, enabled: bool) -> SemanticsProperties
Dart SemanticsProperties(enabled:).
Sourcepub fn checked(self, checked: bool) -> SemanticsProperties
pub fn checked(self, checked: bool) -> SemanticsProperties
Dart SemanticsProperties(checked:).
Sourcepub fn mixed(self, mixed: bool) -> SemanticsProperties
pub fn mixed(self, mixed: bool) -> SemanticsProperties
Dart SemanticsProperties(mixed:).
Sourcepub fn expanded(self, expanded: bool) -> SemanticsProperties
pub fn expanded(self, expanded: bool) -> SemanticsProperties
Dart SemanticsProperties(expanded:).
Sourcepub fn toggled(self, toggled: bool) -> SemanticsProperties
pub fn toggled(self, toggled: bool) -> SemanticsProperties
Dart SemanticsProperties(toggled:).
Sourcepub fn selected(self, selected: bool) -> SemanticsProperties
pub fn selected(self, selected: bool) -> SemanticsProperties
Dart SemanticsProperties(selected:).
Dart SemanticsProperties(button:).
Sourcepub fn link(self, link: bool) -> SemanticsProperties
pub fn link(self, link: bool) -> SemanticsProperties
Dart SemanticsProperties(link:).
Sourcepub fn header(self, header: bool) -> SemanticsProperties
pub fn header(self, header: bool) -> SemanticsProperties
Dart SemanticsProperties(header:).
Sourcepub fn text_field(self, text_field: bool) -> SemanticsProperties
pub fn text_field(self, text_field: bool) -> SemanticsProperties
Dart SemanticsProperties(textField:).
Sourcepub fn slider(self, slider: bool) -> SemanticsProperties
pub fn slider(self, slider: bool) -> SemanticsProperties
Dart SemanticsProperties(slider:).
Sourcepub fn keyboard_key(self, keyboard_key: bool) -> SemanticsProperties
pub fn keyboard_key(self, keyboard_key: bool) -> SemanticsProperties
Dart SemanticsProperties(keyboardKey:).
Sourcepub fn read_only(self, read_only: bool) -> SemanticsProperties
pub fn read_only(self, read_only: bool) -> SemanticsProperties
Dart SemanticsProperties(readOnly:).
Sourcepub fn focusable(self, focusable: bool) -> SemanticsProperties
pub fn focusable(self, focusable: bool) -> SemanticsProperties
Dart SemanticsProperties(focusable:).
Sourcepub fn focused(self, focused: bool) -> SemanticsProperties
pub fn focused(self, focused: bool) -> SemanticsProperties
Dart SemanticsProperties(focused:).
Sourcepub fn accessibility_focus_block_type(
self,
accessibility_focus_block_type: AccessibilityFocusBlockType,
) -> SemanticsProperties
pub fn accessibility_focus_block_type( self, accessibility_focus_block_type: AccessibilityFocusBlockType, ) -> SemanticsProperties
Dart SemanticsProperties(accessibilityFocusBlockType:).
Sourcepub fn in_mutually_exclusive_group(
self,
in_mutually_exclusive_group: bool,
) -> SemanticsProperties
pub fn in_mutually_exclusive_group( self, in_mutually_exclusive_group: bool, ) -> SemanticsProperties
Dart SemanticsProperties(inMutuallyExclusiveGroup:).
Dart SemanticsProperties(hidden:).
Sourcepub fn obscured(self, obscured: bool) -> SemanticsProperties
pub fn obscured(self, obscured: bool) -> SemanticsProperties
Dart SemanticsProperties(obscured:).
Sourcepub fn multiline(self, multiline: bool) -> SemanticsProperties
pub fn multiline(self, multiline: bool) -> SemanticsProperties
Dart SemanticsProperties(multiline:).
Sourcepub fn scopes_route(self, scopes_route: bool) -> SemanticsProperties
pub fn scopes_route(self, scopes_route: bool) -> SemanticsProperties
Dart SemanticsProperties(scopesRoute:).
Sourcepub fn names_route(self, names_route: bool) -> SemanticsProperties
pub fn names_route(self, names_route: bool) -> SemanticsProperties
Dart SemanticsProperties(namesRoute:).
Sourcepub fn image(self, image: bool) -> SemanticsProperties
pub fn image(self, image: bool) -> SemanticsProperties
Dart SemanticsProperties(image:).
Sourcepub fn live_region(self, live_region: bool) -> SemanticsProperties
pub fn live_region(self, live_region: bool) -> SemanticsProperties
Dart SemanticsProperties(liveRegion:).
Sourcepub fn is_required(self, is_required: bool) -> SemanticsProperties
pub fn is_required(self, is_required: bool) -> SemanticsProperties
Dart SemanticsProperties(isRequired:).
Sourcepub fn max_value_length(self, max_value_length: i32) -> SemanticsProperties
pub fn max_value_length(self, max_value_length: i32) -> SemanticsProperties
Dart SemanticsProperties(maxValueLength:).
Sourcepub fn current_value_length(
self,
current_value_length: i32,
) -> SemanticsProperties
pub fn current_value_length( self, current_value_length: i32, ) -> SemanticsProperties
Dart SemanticsProperties(currentValueLength:).
Sourcepub fn identifier(self, identifier: impl Into<String>) -> SemanticsProperties
pub fn identifier(self, identifier: impl Into<String>) -> SemanticsProperties
Dart SemanticsProperties(identifier:).
Sourcepub fn traversal_parent_identifier(
self,
traversal_parent_identifier: Rc<dyn Any>,
) -> SemanticsProperties
pub fn traversal_parent_identifier( self, traversal_parent_identifier: Rc<dyn Any>, ) -> SemanticsProperties
Dart SemanticsProperties(traversalParentIdentifier:).
Sourcepub fn traversal_child_identifier(
self,
traversal_child_identifier: Rc<dyn Any>,
) -> SemanticsProperties
pub fn traversal_child_identifier( self, traversal_child_identifier: Rc<dyn Any>, ) -> SemanticsProperties
Dart SemanticsProperties(traversalChildIdentifier:).
Sourcepub fn label(self, label: impl Into<String>) -> SemanticsProperties
pub fn label(self, label: impl Into<String>) -> SemanticsProperties
Dart SemanticsProperties(label:).
Sourcepub fn attributed_label(
self,
attributed_label: AttributedString,
) -> SemanticsProperties
pub fn attributed_label( self, attributed_label: AttributedString, ) -> SemanticsProperties
Dart SemanticsProperties(attributedLabel:).
Sourcepub fn value(self, value: impl Into<String>) -> SemanticsProperties
pub fn value(self, value: impl Into<String>) -> SemanticsProperties
Dart SemanticsProperties(value:).
Sourcepub fn attributed_value(
self,
attributed_value: AttributedString,
) -> SemanticsProperties
pub fn attributed_value( self, attributed_value: AttributedString, ) -> SemanticsProperties
Dart SemanticsProperties(attributedValue:).
Sourcepub fn increased_value(
self,
increased_value: impl Into<String>,
) -> SemanticsProperties
pub fn increased_value( self, increased_value: impl Into<String>, ) -> SemanticsProperties
Dart SemanticsProperties(increasedValue:).
Sourcepub fn attributed_increased_value(
self,
attributed_increased_value: AttributedString,
) -> SemanticsProperties
pub fn attributed_increased_value( self, attributed_increased_value: AttributedString, ) -> SemanticsProperties
Dart SemanticsProperties(attributedIncreasedValue:).
Sourcepub fn decreased_value(
self,
decreased_value: impl Into<String>,
) -> SemanticsProperties
pub fn decreased_value( self, decreased_value: impl Into<String>, ) -> SemanticsProperties
Dart SemanticsProperties(decreasedValue:).
Sourcepub fn attributed_decreased_value(
self,
attributed_decreased_value: AttributedString,
) -> SemanticsProperties
pub fn attributed_decreased_value( self, attributed_decreased_value: AttributedString, ) -> SemanticsProperties
Dart SemanticsProperties(attributedDecreasedValue:).
Sourcepub fn hint(self, hint: impl Into<String>) -> SemanticsProperties
pub fn hint(self, hint: impl Into<String>) -> SemanticsProperties
Dart SemanticsProperties(hint:).
Sourcepub fn attributed_hint(
self,
attributed_hint: AttributedString,
) -> SemanticsProperties
pub fn attributed_hint( self, attributed_hint: AttributedString, ) -> SemanticsProperties
Dart SemanticsProperties(attributedHint:).
Sourcepub fn tooltip(self, tooltip: impl Into<String>) -> SemanticsProperties
pub fn tooltip(self, tooltip: impl Into<String>) -> SemanticsProperties
Dart SemanticsProperties(tooltip:).
Sourcepub fn heading_level(self, heading_level: i32) -> SemanticsProperties
pub fn heading_level(self, heading_level: i32) -> SemanticsProperties
Dart SemanticsProperties(headingLevel:).
Sourcepub fn hint_overrides(
self,
hint_overrides: SemanticsHintOverrides,
) -> SemanticsProperties
pub fn hint_overrides( self, hint_overrides: SemanticsHintOverrides, ) -> SemanticsProperties
Dart SemanticsProperties(hintOverrides:).
Sourcepub fn text_direction(
self,
text_direction: TextDirection,
) -> SemanticsProperties
pub fn text_direction( self, text_direction: TextDirection, ) -> SemanticsProperties
Dart SemanticsProperties(textDirection:).
Sourcepub fn sort_key(self, sort_key: SemanticsSortKeyRef) -> SemanticsProperties
pub fn sort_key(self, sort_key: SemanticsSortKeyRef) -> SemanticsProperties
Dart SemanticsProperties(sortKey:).
Sourcepub fn tag_for_children(
self,
tag_for_children: Rc<SemanticsTag>,
) -> SemanticsProperties
pub fn tag_for_children( self, tag_for_children: Rc<SemanticsTag>, ) -> SemanticsProperties
Dart SemanticsProperties(tagForChildren:).
Sourcepub fn link_url(self, link_url: impl Into<String>) -> SemanticsProperties
pub fn link_url(self, link_url: impl Into<String>) -> SemanticsProperties
Dart SemanticsProperties(linkUrl:).
Sourcepub fn on_tap(self, on_tap: VoidCallback) -> SemanticsProperties
pub fn on_tap(self, on_tap: VoidCallback) -> SemanticsProperties
Dart SemanticsProperties(onTap:).
Sourcepub fn on_long_press(self, on_long_press: VoidCallback) -> SemanticsProperties
pub fn on_long_press(self, on_long_press: VoidCallback) -> SemanticsProperties
Dart SemanticsProperties(onLongPress:).
Sourcepub fn on_scroll_left(self, on_scroll_left: VoidCallback) -> SemanticsProperties
pub fn on_scroll_left(self, on_scroll_left: VoidCallback) -> SemanticsProperties
Dart SemanticsProperties(onScrollLeft:).
Sourcepub fn on_scroll_right(
self,
on_scroll_right: VoidCallback,
) -> SemanticsProperties
pub fn on_scroll_right( self, on_scroll_right: VoidCallback, ) -> SemanticsProperties
Dart SemanticsProperties(onScrollRight:).
Sourcepub fn on_scroll_up(self, on_scroll_up: VoidCallback) -> SemanticsProperties
pub fn on_scroll_up(self, on_scroll_up: VoidCallback) -> SemanticsProperties
Dart SemanticsProperties(onScrollUp:).
Sourcepub fn on_scroll_down(self, on_scroll_down: VoidCallback) -> SemanticsProperties
pub fn on_scroll_down(self, on_scroll_down: VoidCallback) -> SemanticsProperties
Dart SemanticsProperties(onScrollDown:).
Sourcepub fn on_increase(self, on_increase: VoidCallback) -> SemanticsProperties
pub fn on_increase(self, on_increase: VoidCallback) -> SemanticsProperties
Dart SemanticsProperties(onIncrease:).
Sourcepub fn on_decrease(self, on_decrease: VoidCallback) -> SemanticsProperties
pub fn on_decrease(self, on_decrease: VoidCallback) -> SemanticsProperties
Dart SemanticsProperties(onDecrease:).
Sourcepub fn on_copy(self, on_copy: VoidCallback) -> SemanticsProperties
pub fn on_copy(self, on_copy: VoidCallback) -> SemanticsProperties
Dart SemanticsProperties(onCopy:).
Sourcepub fn on_cut(self, on_cut: VoidCallback) -> SemanticsProperties
pub fn on_cut(self, on_cut: VoidCallback) -> SemanticsProperties
Dart SemanticsProperties(onCut:).
Sourcepub fn on_paste(self, on_paste: VoidCallback) -> SemanticsProperties
pub fn on_paste(self, on_paste: VoidCallback) -> SemanticsProperties
Dart SemanticsProperties(onPaste:).
Sourcepub fn on_move_cursor_forward_by_character(
self,
on_move_cursor_forward_by_character: MoveCursorHandler,
) -> SemanticsProperties
pub fn on_move_cursor_forward_by_character( self, on_move_cursor_forward_by_character: MoveCursorHandler, ) -> SemanticsProperties
Dart SemanticsProperties(onMoveCursorForwardByCharacter:).
Sourcepub fn on_move_cursor_backward_by_character(
self,
on_move_cursor_backward_by_character: MoveCursorHandler,
) -> SemanticsProperties
pub fn on_move_cursor_backward_by_character( self, on_move_cursor_backward_by_character: MoveCursorHandler, ) -> SemanticsProperties
Dart SemanticsProperties(onMoveCursorBackwardByCharacter:).
Sourcepub fn on_move_cursor_forward_by_word(
self,
on_move_cursor_forward_by_word: MoveCursorHandler,
) -> SemanticsProperties
pub fn on_move_cursor_forward_by_word( self, on_move_cursor_forward_by_word: MoveCursorHandler, ) -> SemanticsProperties
Dart SemanticsProperties(onMoveCursorForwardByWord:).
Sourcepub fn on_move_cursor_backward_by_word(
self,
on_move_cursor_backward_by_word: MoveCursorHandler,
) -> SemanticsProperties
pub fn on_move_cursor_backward_by_word( self, on_move_cursor_backward_by_word: MoveCursorHandler, ) -> SemanticsProperties
Dart SemanticsProperties(onMoveCursorBackwardByWord:).
Sourcepub fn on_set_selection(
self,
on_set_selection: SetSelectionHandler,
) -> SemanticsProperties
pub fn on_set_selection( self, on_set_selection: SetSelectionHandler, ) -> SemanticsProperties
Dart SemanticsProperties(onSetSelection:).
Sourcepub fn on_set_text(self, on_set_text: SetTextHandler) -> SemanticsProperties
pub fn on_set_text(self, on_set_text: SetTextHandler) -> SemanticsProperties
Dart SemanticsProperties(onSetText:).
Sourcepub fn on_did_gain_accessibility_focus(
self,
on_did_gain_accessibility_focus: VoidCallback,
) -> SemanticsProperties
pub fn on_did_gain_accessibility_focus( self, on_did_gain_accessibility_focus: VoidCallback, ) -> SemanticsProperties
Dart SemanticsProperties(onDidGainAccessibilityFocus:).
Sourcepub fn on_did_lose_accessibility_focus(
self,
on_did_lose_accessibility_focus: VoidCallback,
) -> SemanticsProperties
pub fn on_did_lose_accessibility_focus( self, on_did_lose_accessibility_focus: VoidCallback, ) -> SemanticsProperties
Dart SemanticsProperties(onDidLoseAccessibilityFocus:).
Sourcepub fn on_focus(self, on_focus: VoidCallback) -> SemanticsProperties
pub fn on_focus(self, on_focus: VoidCallback) -> SemanticsProperties
Dart SemanticsProperties(onFocus:).
Sourcepub fn on_dismiss(self, on_dismiss: VoidCallback) -> SemanticsProperties
pub fn on_dismiss(self, on_dismiss: VoidCallback) -> SemanticsProperties
Dart SemanticsProperties(onDismiss:).
Sourcepub fn on_expand(self, on_expand: VoidCallback) -> SemanticsProperties
pub fn on_expand(self, on_expand: VoidCallback) -> SemanticsProperties
Dart SemanticsProperties(onExpand:).
Sourcepub fn on_collapse(self, on_collapse: VoidCallback) -> SemanticsProperties
pub fn on_collapse(self, on_collapse: VoidCallback) -> SemanticsProperties
Dart SemanticsProperties(onCollapse:).
Sourcepub fn custom_semantics_actions(
self,
custom_semantics_actions: IndexMap<CustomSemanticsAction, VoidCallback>,
) -> SemanticsProperties
pub fn custom_semantics_actions( self, custom_semantics_actions: IndexMap<CustomSemanticsAction, VoidCallback>, ) -> SemanticsProperties
Dart SemanticsProperties(customSemanticsActions:).
Sourcepub fn role(self, role: SemanticsRole) -> SemanticsProperties
pub fn role(self, role: SemanticsRole) -> SemanticsProperties
Dart SemanticsProperties(role:).
Sourcepub fn controls_nodes(
self,
controls_nodes: IndexSet<String>,
) -> SemanticsProperties
pub fn controls_nodes( self, controls_nodes: IndexSet<String>, ) -> SemanticsProperties
Dart SemanticsProperties(controlsNodes:).
Sourcepub fn validation_result(
self,
validation_result: SemanticsValidationResult,
) -> SemanticsProperties
pub fn validation_result( self, validation_result: SemanticsValidationResult, ) -> SemanticsProperties
Dart SemanticsProperties(validationResult:).
Sourcepub fn hit_test_behavior(
self,
hit_test_behavior: SemanticsHitTestBehavior,
) -> SemanticsProperties
pub fn hit_test_behavior( self, hit_test_behavior: SemanticsHitTestBehavior, ) -> SemanticsProperties
Dart SemanticsProperties(hitTestBehavior:).
Sourcepub fn input_type(self, input_type: SemanticsInputType) -> SemanticsProperties
pub fn input_type(self, input_type: SemanticsInputType) -> SemanticsProperties
Dart SemanticsProperties(inputType:).
Sourcepub fn max_value(self, max_value: impl Into<String>) -> SemanticsProperties
pub fn max_value(self, max_value: impl Into<String>) -> SemanticsProperties
Dart SemanticsProperties(maxValue:).
Sourcepub fn min_value(self, min_value: impl Into<String>) -> SemanticsProperties
pub fn min_value(self, min_value: impl Into<String>) -> SemanticsProperties
Dart SemanticsProperties(minValue:).
Sourcepub fn debug_check_constructor(&self)
pub fn debug_check_constructor(&self)
Dart’s constructor asserts that relate two fields. The widgets built on these properties
run it from their debug_check_constructor; an assert on one field stays in its setter.
Trait Implementations§
Source§impl Clone for SemanticsProperties
impl Clone for SemanticsProperties
Source§impl Debug for SemanticsProperties
Dart’s debugFillProperties, as it lists them.
impl Debug for SemanticsProperties
Dart’s debugFillProperties, as it lists them.