ensemble
ensemble copied to clipboard
Support for Accessibility
See this widget for reference: https://docs.flutter.dev/ui/accessibility-and-internationalization/accessibility?tab=browsers
Proposed EDL:
widget:
semantics:
focused: true //specify if a rectangle appears around the widget individually
label: 'This is label of widget that'll be spoken out'
hint: 'hint for the widget'
widget: semantics: focused: true //specify if a rectangle appears around the widget individually
- is it
focusedorfocusable? shouldn't a box always appear for the node that is focused? - what is the purpose of the hint if it is not going to be read by screen reader?
@amin-nas
We have widget content:
i.e, label, description, input value etc
And reader reads it in this order.
label: "Label", // spoken before widget content
hint: "Hint", // spoken After widget content
focusable: true , // optionally if property must be skipped in readers default true.
Comparison Table
| Property | Purpose | When to Use | When to Skip |
|---|---|---|---|
label |
Describes what the element is for screen readers. | - When an element does not have text (e.g., an icon button). - When an image or visual element needs a meaningful description. |
- When the element already has a visible text label. - When the element is purely decorative and does not require an announcement. |
hint |
Provides extra guidance about what an element does. | - When the label alone is not enough to explain the interaction. - When the user needs instructions on how to interact (e.g., "Double tap to delete"). |
- When the action is already clear from the label (e.g., "Logout" button). - When used on purely decorative elements. |
focusable |
Makes a non-interactive element focusable by assistive technologies. | - When a non-focusable widget needs to be accessible (e.g., Text).- When improving keyboard navigation for accessibility. - When making important content discoverable by screen readers. |
- When the element is already focusable (e.g., buttons, text fields). - When the element is decorative and should be ignored. |
When to Use and Skip These Properties
-
Use
labelwhen a widget has no text but needs to be described. -
Use
hintwhen extra instructions are needed for an interactive element. -
Use
focusablewhen making static elements likeTextselectable for accessibility.