Skip to content

Commit dc75435

Browse files
committed
Added semantic announce action
1 parent 1dc765e commit dc75435

File tree

2 files changed

+58
-29
lines changed

2 files changed

+58
-29
lines changed

docs/ff-concepts/localization-accessibility/accessibility.md

Lines changed: 58 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ Here are some key accessibility features you can use:
2828

2929
For example, in an e-commerce app, you can add a semantic label to an '*Add to Bag*' button with a message like '*Add the selected item to cart*', which helps users better understand the button's action.
3030

31-
You can also dynamically set semantic labels using variables or expressions. This allows the label to change based on the app context, so screen readers announce exactly what’s on the screen instead of generic terms like "image" or "button." For example, a product image can read out the product name (e.g., "Red Running Shoes" pulled from Firestore) instead of just saying "image."
32-
3331
To add a semantic label for any widget, select the widget, move to the properties panel (right side), tap the document icon inside the **Accessibility & Semantic Label** section, add the message, and click **Save**.
3432

3533

@@ -59,21 +57,75 @@ To add a semantic label for any widget, select the widget, move to the propertie
5957
</div>
6058
<p></p>
6159

62-
Moreover, to add a semantic label for every widget in your app that has an action trigger `OnTap` or `onLongPress`, you can enable the **Add Warning for Semantic Widgets**. By doing so, you'll get a warning if any widget has an action but doesn't have a semantic label added yet.
63-
6460
:::tip
61+
You can also dynamically set semantic labels using variables or expressions. This allows the label to change based on the app context, so screen readers announce exactly what’s on the screen instead of generic terms like "image" or "button." For example, a product image can read out the product name (e.g., "Red Running Shoes" pulled from Firestore) instead of just saying "image."
62+
:::
6563

66-
You can click on the warning item to directly navigate to that widget.
64+
### Advanced Semantic Settings (Enterprise Only)
65+
66+
These settings help make your app more accessible by giving you better control over how screen readers interpret and describe your UI.
67+
68+
:::info
69+
70+
These settings are only available to **Enterprise** users.
6771

6872
:::
6973

74+
Here’s what each option does:
75+
76+
- **Is Container**: Indicates the widget acts as a grouping for other semantic widgets.
77+
- **Is Image**: Tells screen readers the widget represents an image.
78+
- **Is Button**: Declares the widget behaves like a button.
79+
- **Is Header**: Identifies a widget as a heading for better navigation.
80+
- **Explicit Child Nodes**: Forces semantics to include all child nodes, even if normally ignored.
81+
- **Exclude Semantics**: Prevents screen readers from announcing this widget.
82+
- **Is Live Region**: Tells assistive tech that the widget’s content may change dynamically and should be re-announced.
83+
- **Hint Text**: Provides an additional hint for users (e.g., "Double tap to open").
84+
- **Tooltip Text**: Displays helpful text on long press or hover.
85+
- **Ordinal Sort Key**: Controls the order in which widgets are accessed by screen readers.
86+
87+
:::tip
88+
You can add a semantic label for every widget in your app that has an action trigger `OnTap` or `onLongPress`, by enabling the **Add Warning for Semantic Widgets**.
89+
By doing so, you'll get a warning if any widget has an action but doesn't have a semantic label added yet. You can click on the warning item to directly navigate to that widget.
90+
:::
91+
7092
![add-warning-for-semantic-widgets.avif](imgs/add-warning-for-semantic-widgets.avif)
7193

7294
After you add semantic labels, enable **TalkBack** on Android or **VoiceOver** on iOS to test how screen readers interact with your app. These screen readers will help you verify that all UI elements are read clearly, descriptions are meaningful, and users can navigate logically without getting lost.
7395

7496
Learn more about [enabling screen reader on your device](https://docs.flutter.dev/ui/accessibility-and-internationalization/accessibility#screen-readers).
7597

76-
### Focus Configuration
98+
## Semantic Announce [Action]
99+
100+
The **Semantic Announce** action lets you notify screen reader users about important UI changes or provide contextual updates. It sends a request to the device’s accessibility service (TalkBack/VoiceOver) to speak the text out loud.
101+
102+
It significantly improves accessibility by allowing screen reader users to receive timely and meaningful feedback. This is especially helpful when visual feedback might be missed or unavailable.
103+
104+
:::tip[possible use cases]
105+
106+
- **Form Submission**: After a user submits a form, you can trigger a screen reader announcement like "Your form has been submitted successfully," giving immediate feedback without requiring visual cues.
107+
- **Dynamic Content Updates**: When new content is added or changed on the screen—like loading new chat messages or refreshing a feed—you can announce messages like "3 new messages loaded" to ensure screen reader users are aware of the update.
108+
- **Error or Validation Messages**: If a user enters invalid input, you can announce helpful validation feedback like "Please enter a valid email address".
109+
110+
:::
111+
112+
The Semantic Announce action allows you to trigger screen reader announcements with the following settings:
113+
114+
- **Announcement Text**: The message you want the screen reader to speak aloud (e.g., "Item added to favorites").
115+
- **Is Text Right to Left**: Set this to True for right-to-left languages like Arabic or Hebrew. It defaults to False, which is appropriate for left-to-right languages like English.
116+
117+
![semantic-announcement.avif](imgs/semantic-announcement.avif)
118+
119+
:::info[Best Practices]
120+
121+
- Long announcements can overwhelm the user. Aim for a concise phrase like "Search complete—3 results."
122+
- Too many announcements can confuse or irritate the user. Only announce critical or timely changes that aren’t otherwise discoverable.
123+
- Use the correct language direction of the message. If your app supports multiple locales, dynamic direction binding can help.
124+
- Screen reader behavior can vary across Android (TalkBack) and iOS (VoiceOver). Test thoroughly on real hardware to confirm the experience.
125+
126+
:::
127+
128+
## Focus Configuration
77129

78130
**Focus Configuration** helps improve keyboard and remote-control navigation in your app—especially important for web, desktop, TV, and kiosk apps. It controls how users move through widgets using the <kbd>Tab</kbd> key or other navigation inputs (like arrow keys or D-pad on TV or remote).
79131

@@ -92,29 +144,6 @@ The **Focus Traversal Group** defines a context or scope for focus traversal, an
92144

93145
:::
94146

95-
### Advanced Semantic Settings (Enterprise Only)
96-
97-
These settings help make your app more accessible by giving you better control over how screen readers interpret and describe your UI.
98-
99-
:::info
100-
101-
These settings are only available to **Enterprise** users.
102-
103-
:::
104-
105-
Here’s what each option does:
106-
107-
- **Is Container**: Indicates the widget acts as a grouping for other semantic widgets.
108-
- **Is Image**: Tells screen readers the widget represents an image.
109-
- **Is Button**: Declares the widget behaves like a button.
110-
- **Is Header**: Identifies a widget as a heading for better navigation.
111-
- **Explicit Child Nodes**: Forces semantics to include all child nodes, even if normally ignored.
112-
- **Exclude Semantics**: Prevents screen readers from announcing this widget.
113-
- **Is Live Region**: Tells assistive tech that the widget’s content may change dynamically and should be re-announced.
114-
- **Hint Text**: Provides an additional hint for users (e.g., "Double tap to open").
115-
- **Tooltip Text**: Displays helpful text on long press or hover.
116-
- **Ordinal Sort Key**: Controls the order in which widgets are accessed by screen readers.
117-
118147
## Keyboard Navigation
119148

120149
You can use the [On Shortcut Press](../../resources/ui/pages/page-lifecycle.md#on-shortcut-press-action-trigger) action trigger to bind keyboard shortcuts to specific actions. This makes it easier for users with disabilities to navigate your app, especially in web and desktop environments.
Binary file not shown.

0 commit comments

Comments
 (0)