Speech Input Widget
Component Detail
User Interface
medium complexity
Shared Component
mobile
1
Dependencies
0
Dependents
0
Entities
0
Integrations
Description
Reusable Flutter widget that attaches to any opt-in TextFormField as a microphone icon button. Manages the full recording lifecycle: permission check, listening indicator, interim transcript display, and final text injection. Designed for WCAG 2.2 AA - clearly communicates when the device is and is not listening, satisfying Blindeforbundet's requirement that users know recording never occurs during a visit.
speech-input-widget
Responsibilities
- Render microphone button in opt-in TextFormField and toggle recording state on tap
- Display animated listening indicator and interim transcript text during dictation
- Inject final transcript into the parent field and clear interim state on completion
- Show permission-denied state with actionable guidance when microphone access is refused
- Degrade gracefully when the device does not support speech recognition
Interfaces
SpeechInputWidget({required TextEditingController controller, String? hintText})
onTranscriptReceived(String text)
onPermissionDenied()
onRecognitionUnavailable()