MethodChannelLocalVoice class

An implementation of LocalVoicePlatform that uses method + event channels to talk to the native on-device recognizer.

Inheritance

Constructors

MethodChannelLocalVoice()

Properties

eventChannel EventChannel
The event channel streaming transcript/error/status updates.
final
events Stream<LocalVoiceEvent>
Stream of transcript, error, and status events for the lifetime of the plugin. A single broadcast stream is shared across listen sessions.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
methodChannel MethodChannel
The method channel used for one-shot calls to the native platform.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancel() Future<void>
Immediately aborts the current session with no final result.
override
hasPermission() Future<bool>
Whether microphone + speech-recognition permission has already been granted.
override
isAvailable() Future<bool>
Whether on-device speech recognition is available on this device right now (model downloaded, hardware supported). Does not request permission.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestPermission() Future<bool>
Prompts the user for microphone + speech-recognition permission. Returns whether permission was granted.
override
startListening({String? localeId, Duration? pauseFor, Duration? listenFor}) Future<void>
Starts an on-device listening session.
override
stopListening() Future<void>
Stops capturing audio; the recognizer will still emit a final result for whatever was captured so far.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited