Accessibility Live Region Announcer
Component Detail
Description
A shared utility that posts accessibility announcements to the platform's screen reader via Flutter's SemanticsService. Used by the recording state indicator to broadcast dictation state changes (started, stopped, transcription ready, error) as live regions so VoiceOver and TalkBack users receive real-time feedback without needing to focus a specific widget.
accessibility-live-region-announcer
Summaries
The Accessibility Live Region Announcer is a shared infrastructure component that ensures the application is genuinely usable — not merely technically compliant — for volunteers who are blind or have significant visual impairments. Partner organizations like Blindeforbundet and HLF represent communities where screen reader use is the norm, not the exception. Without real-time audio feedback for state changes like 'Recording started' or 'Transcription ready,' users relying on VoiceOver or TalkBack would have no reliable way to know the dictation system is responding to them. This component directly delivers on the core accessibility promise of the platform, protecting against negative feedback from the disability organizations that are the application's primary stakeholders and most visible advocates.
Low complexity and shared across all dictation-related features, making this component a high-leverage early deliverable. Because it is shared (`is_shared: true`), it must be built and tested before any consumer feature reaches integration testing. Testing must be conducted on physical devices with VoiceOver (iOS) and TalkBack (Android) enabled — emulators do not reliably reproduce screen reader behavior. Key test scenarios: rapid state transitions (verify queue prevents announcement overlap), error announcements (verify assertive priority over polite), and system accessibility settings (verify verbosity respects user preferences).
The component's simplicity means it can be owned by any mobile developer; assign it early in the sprint as a dependency unblock for dictation UI work. No deployment risk — client-side only.
Accessibility Live Region Announcer is a thin wrapper around Flutter's `SemanticsService.announce()` with added queueing logic and priority discrimination. `announceAssertive()` maps to `TextDirection`-aware assertive announcements and should interrupt any currently queued polite announcement. `announcePolite()` enqueues behind existing announcements. `announceError()` is a convenience alias for assertive with an error prefix string injected for screen reader context.
The queue must be implemented carefully: Flutter's `SemanticsService` does not natively queue, so rapid calls can result in dropped announcements. A short debounce (~100ms) combined with a FIFO queue flushed after each announcement completes (via a completion callback or fixed delay) is the recommended approach. `clearQueue()` is used when the UI navigates away to prevent stale announcements from firing after context changes. As a shared component, expose as a singleton via DI and avoid storing any state beyond the current queue.
Responsibilities
- Post assertive live region announcements for critical state changes (recording started/stopped)
- Post polite live region announcements for informational updates (transcription ready)
- Queue announcements to avoid overlapping speech on rapid state transitions
- Respect the user's system accessibility settings when deciding announcement verbosity
Interfaces
announceAssertive(String message)
announcePolite(String message)
announceError(String message)
clearQueue()