Skip to content

Check for Semantics to verify and improve screen reader support #4

@MrCsabaToth

Description

@MrCsabaToth

Is your feature request related to a problem? Please describe.
An application rating mentioned difficulties from a user using screen reader. We should verify that the widget's Semantics are proper.

Describe the solution you'd like
Key concepts for semantic testing

  • Semantics tree: Flutter maintains a separate tree of semantic information alongside the normal widget tree. This tree is what assistive technologies, such as screen readers, use to describe the UI to users.
  • Semantics widget: You use the Semantics widget to explicitly add semantic information to your custom widgets, describing their purpose for accessibility tools.
  • WidgetTester.getSemantics(): This method is the core of automated semantic testing. It retrieves the semantic information for a specific widget in the tree, allowing you to run checks on it.
  • matchesSemantics(): A helper matcher from the flutter_test library that simplifies comparing the semantics of a widget against a predefined description.
    Describe alternatives you've considered

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions