-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
This is a technical debt issue, not a bug report or a feature request.
Each SemanticsObject may have zero or more roles associated with it. Which ones are assigned depends on the combination of flags and actions. This works, but code readability isn't great. For instance, it's not clear who is responsible for the role ARIA attribute. Any role manager can assign one, potentially stepping on another role manager. It's not clear in what order role managers are updated.
A better approach might be to assign one primary role, and internally the primary role manager may add as many secondary role managers as it needs. Only the primary role is responsible for assigning the role label. It also determine the order, in which it and secondary role managers update the node.
Examples:
- Primary role "button" may have secondary roles "labelled" and "focusable".
- Primary role "text" may have secondary role "labelled". It may also add "focusable" if
isFocusableis set on the object. - Primary role "text field" may not have any secondary roles because of bespoke needs for labelling, focus management, etc.
Expected results
Cleaner code
Actual results
Code not so clean
Code sample
Code sample
[Paste your code here]Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[Paste your output here]