SpeechRecognitionService class
Wraps SpeechToText with microphone permission management. Pass an instance to FeedbackWidget.speechService to enable voice input.
FeedbackWidget(
speechService: SpeechRecognitionService(),
...
)
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAvailable → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancel(
) → Future< void> -
ensureInitialized(
) → Future< bool> -
Requests microphone permission and initialises the STT engine once.
Returns
truewhen ready to listen. -
listen(
{required void onResult(String words, bool isFinal), String localeId = 'en_US', Duration listenFor = const Duration(seconds: 30), Duration pauseFor = const Duration(seconds: 3)}) → Future< void> -
Starts listening and calls
onResultwith partial/final transcriptions. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
stop(
) → Future< void> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited