Our widget tests were green, our golden files matched, and TalkBack still read a checkout screen as "Pay, Cancel, 3 items, total" with no indication that Pay was a button. That gap is the reason we run a Flutter accessibility audit with a real screen reader before calling any screen done. Widget tests verify that a widget tree builds and responds to taps. They say almost nothing about what the platform accessibility services actually receive, and that is where the bugs live.

This post covers three classes of semantics bugs we hit in production Flutter code, what TalkBack (Android) and VoiceOver (iOS) did with them, and the small assertion harness we added to CI so they stay fixed.

Why widget tests pass while screen readers fail

Flutter builds a separate semantics tree alongside the render tree. Platform bridges translate it into AccessibilityNodeInfo on Android and UIAccessibilityElement on iOS. A typical widget test taps by finder, which walks the widget tree. It never consults the semantics tree, so a screen can be fully tappable by finger and nearly unusable by ear.

The other trap is that the two platforms disagree on edge cases. TalkBack and VoiceOver differ in how they traverse, how they treat grouped nodes, and what they announce when a label is empty. Passing on one is not evidence for the other. We test on both, and the native Kotlin and Swift sides of our apps occasionally matter here, particularly for platform views embedded in a Flutter screen.

Three bugs a screen reader found and tests didn't

1. Merged semantics swallowing buttons

The pattern: a list tile built as a Row inside an InkWell, wrapped in MergeSemantics (or a parent Semantics(container: true) with excludeSemantics: true) to get one clean announcement per row. It works until a row contains a secondary action, such as a trailing "remove" icon button. Merging collapses the child's actions into the parent. The screen reader now reports one focusable element, and the remove action is either gone or reachable only through the custom actions rotor, which most users never open.

The fix was to stop merging blindly. The row keeps its merged label for the primary action, and the secondary control is lifted out as a sibling with its own Semantics(button: true, label: ...), or exposed through customSemanticsActions when it genuinely belongs to the row. The rule we use: merge text, never merge independent actions.

2. Custom painters with no labels

A CustomPaint chart or progress ring produces no semantics by default. To TalkBack it is dead air, so the user swipes right and lands on the next widget with no hint that a graphic existed. Adding semanticsBuilder to the painter fixes this, but the failure mode is subtle: a label that is static ("progress chart") is almost as bad as none. The label has to carry the value, and it has to update. We generate it from the same model object that drives the paint, so the spoken text and the pixels cannot drift apart.

3. Focus order breaking after route transitions

After a Navigator.push, VoiceOver sometimes left focus on the element that triggered the navigation, on a screen that was now covered. Other times it jumped to the middle of the new page. Both come from the same root: the new route's semantics nodes arrive while the transition animation is still running, and the accessibility focus is placed against a tree that is about to change.

What helped: giving each page an explicit top-level Semantics(scopesRoute: true, namesRoute: true, label: 'Order summary') so the platform announces the route change, and setting sortKey with OrdinalSortKey on pages where visual order and reading order differ, such as a floating action button declared early in a Stack but visually last. For dialogs, we verified that the barrier is excluded, otherwise the content behind a modal stays reachable.

A semantics assertion harness for CI

We wanted something small. A full accessibility testing framework was more than we needed. The core is a helper that pumps a widget, enables semantics with tester.ensureSemantics(), and walks the resulting SemanticsNode tree through tester.getSemantics and the node's visitor APIs. On that tree we assert a few invariants:

  • Every tappable node has a label. Any node with a tap action and an empty label fails the test. This single rule catches most icon-only buttons.
  • No merged node hides more than one action. If a node carries two or more distinct actions, such as tap and a custom dismiss, it must have been declared on purpose via an allowlist keyed by widget key.
  • Painters expose a value. Screens with a CustomPaint must have a semantics node whose label matches the model's current state, asserted against the model rather than a hardcoded string.
  • Traversal order matches a declared sequence. For key screens, we assert the ordered list of labels as a screen reader would traverse them. When someone adds a widget, the test diff shows exactly where it landed.

Flutter also ships meetsGuideline(labeledTapTargetGuideline) and androidTapTargetGuideline, which we run alongside. They catch missing labels and undersized targets cheaply. They do not catch merged-action loss or ordering, which is why the custom assertions exist.

The honest limits: this harness checks the semantics tree Flutter produces, not what TalkBack or VoiceOver do with it. Focus placement after transitions, in particular, still needs a human with a device. We treat the harness as a regression net for the bugs we have already found, running in the CI/CD pipeline on every pull request, and keep a short manual screen-reader pass in the release checklist for anything touching navigation.

What we'd tell a team starting this

Start with one screen and a real device. Turn the screen off if you can, since it is the fastest way to find out which parts of your UI depend on sight. Write down every moment you get lost, then convert each one into an assertion. A list of ten specific invariants beats a generic accessibility checklist, because each one corresponds to a bug you've seen.

If your Flutter codebase has grown past the point where nobody is sure what a screen reader hears, that is a reasonable candidate for a focused code audit. orithLabs does this kind of work: reading the codebase, running it with assistive tech, and handing back a prioritized list plus the tests that keep the fixes in place. You'd be talking directly to the engineers who write the code, not an account manager.