Service Layer medium complexity mobile
1
Dependencies
2
Dependents
0
Entities
0
Integrations

Description

Manages the full speech recognition session lifecycle by wrapping the speech_to_text Flutter plugin, which delegates to Apple SpeechRecognizer on iOS and Android SpeechRecognizer on Android. Handles permission checks, session start/stop, interim result streaming, silence timeout, and error recovery.

Feature: Speech-to-Text Input

stt-service-integration

Sources & reasoning

The service encapsulates all platform-specific STT complexity behind a single interface so the widget remains platform-agnostic. The org config flag check belongs here - at the service layer - so that even a direct API call cannot bypass the toggle. Session lifecycle (silence timeout, error recovery) is non-trivial and warrants its own component.

No source references — this artifact was included based on reasoning alone (see above).

Responsibilities

  • Initialize speech_to_text plugin and verify platform STT availability
  • Start and stop recognition sessions on user action or silence timeout
  • Stream interim results to the registered listener
  • Surface recognition errors with retry signaling
  • Read the organization config flag to gate feature availability

Interfaces

initialize() -> Future<bool>
startSession(onInterim, onFinal, onError)
stopSession()
isAvailable() -> bool
isSpeechEnabled() -> bool

Relationships

Dependencies (1)

Components this component depends on

Dependents (2)

Components that depend on this component