Why I did a accessibility analysis on flutter app getting message as follows:
This item may not have a label readable by screen readers.
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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With