Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessibility Scanner issue: No readable label for Flutter apps

Why I did a accessibility analysis on flutter app getting message as follows:

This item may not have a label readable by screen readers.

enter image description here

My widget has this code:

Semantics(
  label: 'Login page.',
  child: Scaffold(
    backgroundColor: Colors.grey[900],
    body: Container(
      padding: EdgeInsets.all(25),
      child: Center(
        child: Text("My app!!!", style: labelTextStyle, semanticsLabel: 'app of semantic',)
      ),
    ),
  ),
);

How to fix this?

like image 744
Piccaza De Avatar asked Sep 08 '25 10:09

Piccaza De


2 Answers

Unfortunately, Accessibility Scanner doesn't work with Flutter apps yet, despite Google recommending it in official Flutter docs.

You can keep tabs on support for it via Flutter issue #39531.

like image 185
Tin Man Avatar answered Sep 11 '25 09:09

Tin Man


I work closely with a friend who is blind and uses screens readers to code and use his phone.

Using Semantics on top of an Scaffold would make the whole page to only say the label (in your case Login Page.) So the Accessibility Inspector is telling you that one of the labels (the Text's one) will not be readable by screens readers because the Semantics is over of it.

like image 25
Diego Cattarinich Clavel Avatar answered Sep 11 '25 09:09

Diego Cattarinich Clavel