Sub topic 3
Trying your app with TalkBack and VoiceOver
This chapter assumes you can build Flutter layouts, run an app on an emulator or a physical device, and read the semantics tree described in the previous chapter. It covers how to turn on the two mobile screen readers, which gestures you need, what to listen for, and which problems show up most often.
Why test with a real screen reader
Code review and automated checks cannot tell you what a screen reader user will experience. They can confirm that a label exists. They cannot confirm that the label makes sense, that the order is logical, or that a flow can be finished without looking at the screen.
A screen reader is software that reads the interface aloud and lets a user act on it without seeing it. Android's screen reader is TalkBack. iOS's is VoiceOver. Flutter builds a semantics tree from your widgets and passes it to each platform's accessibility API, so the same Dart code is spoken by two different engines. They can behave differently, so test on both.
Turning on TalkBack (Android)
- Open Settings, then Accessibility, then TalkBack.
- Switch TalkBack on and confirm the permission dialog.
- Complete the short tutorial if one appears.
On some devices, Settings may place TalkBack under Accessibility, then Installed apps or Screen readers. The exact menu names vary by manufacturer and Android version. On an emulator, use an image that includes Google Play services so that TalkBack is installed. If it is missing, install "Android Accessibility Suite" from the Play Store.
With TalkBack on, a single tap selects an item and reads it. A double tap anywhere on the screen activates the selected item. Common gestures:
| Action | TalkBack gesture |
|---|---|
| Move to next item | Swipe right with one finger |
| Move to previous item | Swipe left with one finger |
| Activate the selected item | Double tap |
| Scroll a list | Swipe with two fingers |
| Go back | Swipe down then left (default gesture) |
| Open the actions menu | Swipe up then right |
Gesture assignments can be changed in TalkBack settings, so check them on your device if something does not respond.
Turning on VoiceOver (iOS)
- Open Settings, then Accessibility, then VoiceOver, and switch it on.
- Optionally, set Accessibility Shortcut (triple-click the side or Home button) to VoiceOver so you can toggle it quickly.
The iOS Simulator does not run VoiceOver. To hear it, use a physical iPhone or iPad. For the simulator, you can use the Accessibility Inspector in Xcode, which shows the labels and traits of the element under the cursor. It is useful for checking text, but it does not tell you how navigation feels.
| Action | VoiceOver gesture |
|---|---|
| Move to next item | Swipe right with one finger |
| Move to previous item | Swipe left with one finger |
| Activate the selected item | Double tap |
| Scroll a list | Swipe with three fingers |
| Open the rotor | Rotate two fingers on the screen |
| Hear custom actions | Swipe up or down on an item that has actions |
What to listen for
Move through each screen one item at a time with the swipe gesture and note what is spoken. For each item, ask these questions.
- Does it have a name? Silence, or a bare word such as "button", means a missing label.
- Is the role correct? A tappable item should be announced as a button, a field as an edit box or text field, and a toggle with its on or off state.
- Is the name useful out of context? "Edit" repeated in ten list rows gives no way to tell them apart.
- Is it announced once? An icon plus its text read as two separate stops is noise. The grouping chapter covers the fix.
- Does the order match the visual and logical order? Reading should go top to bottom, and left to right in left-to-right languages.
- Can you reach everything? Anything you can see and tap should be reachable by swiping.
- Are decorations skipped? Dividers and background art should not be spoken.
- Do changes get announced? After you submit a form or an error appears, you should learn about it without hunting.
A simple method is to write the expected spoken output for each screen in a checklist, then compare it with what you actually hear.
Example: a screen with a missing label
Here is a small screen with two problems. The icon button has no tooltip, and a custom tap target has no semantics.
import 'package:flutter/material.dart';
void main() => runApp(const MaterialApp(home: ListenDemo()));
class ListenDemo extends StatefulWidget {
const ListenDemo({super.key});
@override
State<ListenDemo> createState() => _ListenDemoState();
}
class _ListenDemoState extends State<ListenDemo> {
bool _favorite = false;
void _toggleFavorite() => setState(() => _favorite = !_favorite);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Listen demo')),
body: Column(
children: [
IconButton(
icon: const Icon(Icons.share),
onPressed: () {},
),
GestureDetector(
onTap: _toggleFavorite,
child: Icon(
_favorite ? Icons.favorite : Icons.favorite_border,
size: 48,
),
),
],
),
);
}
}With a screen reader on, the share button is announced only as "button", because IconButton has a role but no name. The heart icon may not be reachable at all: GestureDetector adds a tap handler but no semantics node, and Icon has no label unless you give it one.
Fix both with the properties from the earlier chapters.
IconButton(
icon: const Icon(Icons.share),
tooltip: 'Share',
onPressed: () {},
),
Semantics(
button: true,
toggled: _favorite,
label: 'Favorite',
child: GestureDetector(
onTap: _toggleFavorite,
child: Icon(
_favorite ? Icons.favorite : Icons.favorite_border,
size: 48,
),
),
),Run the app again. TalkBack and VoiceOver should now announce "Share, button" and "Favorite, button" with its on or off state. Toggle it and confirm that the state spoken changes.
Platform differences you will notice
TalkBack and VoiceOver use different wording and ordering rules, so the same screen will not sound identical.
- Phrasing. Order and wording of role, state and hint differ. Do not try to match exact phrases across platforms.
- Hints. VoiceOver reads hints after a pause by default, and users can turn them off. TalkBack handles hints differently. Never put essential information only in a hint.
- Custom actions. VoiceOver lists them through the swipe-up or swipe-down gesture. TalkBack lists them in its actions menu.
- Headings. Both support navigating by heading. On VoiceOver, use the rotor. On TalkBack, change the reading controls to Headings, then swipe up or down. Mark section titles with
Semantics(header: true, ...)so users can jump between them. - Text fields. Check that the field label is spoken when focus lands on it, and that the label does not disappear when the user starts typing.
Common problems and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| Button read as only "button" | No label or tooltip | Add `tooltip`, or wrap in `Semantics` with `label` |
| Custom tappable widget skipped | No semantics node for `GestureDetector` | Wrap in `Semantics(button: true, ...)` |
| Icon and text read as two stops | Siblings not grouped | Wrap in `MergeSemantics` |
| Decorative image spoken | Image has a label or default semantics | Use `excludeFromSemantics: true` |
| Wrong reading order | Stack or custom layout differs from visual order | Adjust order with traversal tools |
| Status change goes unnoticed | No announcement | Use a live region or an announcement |
| Gesture-only feature unreachable | Swipe or long press has no alternative | Add custom semantics actions |
Make the check repeatable
Turn your listening notes into a short routine you run before each release.
- Test each primary flow on one Android device and one iPhone with the screen reader on.
- Complete each flow with the screen curtain on.
- Repeat with large text enabled, because wrapped text changes the reading order and what fits on screen.
- Record any failure as a bug with the screen, the spoken output, and the expected output.
Automated tests, covered later in this tutorial, can catch regressions in labels and tap targets, but only manual listening finds problems with clarity and flow.
Exercise
You turn on VoiceOver and swipe through a list of ten rows. Each row has a product photo, a name, a price, and a trash icon button with no tooltip. VoiceOver stops on each row's photo, name and price separately, and the trash button is read as just "button". Name two changes that improve the experience.
Show answer
First, give the trash button a label, either with tooltip: 'Delete <product name>' on the IconButton or by wrapping it in Semantics with a label, so each button says what it removes and for which item. Second, group the photo, name and price with MergeSemantics (and mark the photo as excluded if it is decorative, or give it a useful semanticLabel), so each row is read as one item instead of three stops.
Exercise
Why can you not fully verify VoiceOver behavior on the iOS Simulator, and what do you use instead?
Show answer
The Simulator does not run the VoiceOver screen reader, so you cannot hear how navigation and announcements work. Use a physical iPhone or iPad for real testing. The Accessibility Inspector in Xcode can show labels and traits for the element under the cursor, but it only inspects properties and does not replace listening.