Open kmahmood74 opened 1 year ago
@kmahmood74 I would suggest creating an action so that it's easier to access throughout the app and not limited to text field.
@kmahmood74 I would suggest creating an action so that it's easier to access throughout the app and not limited to text field.
I agree, good point. Let's do an action. Actions are incredibly powerful and useful
proposed EDL -
Button:
onTap:
startListening: #initializes the speechToText if needed
id: #optional. needed to reference it
onStatus: #optional, invoke any action. status is accessed as this.status or use id instead of this
onError: #invoke any action. if not specified, we should have a default one to show the error as toast
onResult: #could be any action.
isListening: #boolean
#recognized works from speechToText are always available as lastWords and you should be able to bind to that. Recognized words from the last run are available as this.result or <id>.result. The result object has the following properties - recognizedWords, confidence, hasConfidenceRating
@vusters ?
Use case -
this could be a good candidate - https://pub.dev/packages/speech_to_text I have not tested this myself so please test it first.
Suggestion:
on TextField (single and multiline), it should be a configuration property such as allowVoiceInput with default = false Otherwise it should be an action - listen with two callbacks:
unavailable: called if the user denies speech recognition onComplete: speech is complete. With event.recognizedWords
Needed by multiple customers
cc @vusters