April 2020
Intermediate to advanced
380 pages
9h 24m
English
Now that we've activated the speech recognizer, we will add a mic icon beside the send button to allow the user to utilize the option for speech recognition. Follow these steps to do so:
Widget createMicButton() { return new Container( margin: const EdgeInsets.symmetric(horizontal: 4.0), child: new IconButton( icon: new Icon(Icons.mic), onPressed: () { if (_isAvailable && !_isListening) { _speechRecognition.recognitionStartedHandler(); _speechRecognition .listen(locale: "en_US") .then((transcription) => print('$transcription')); } else if (_isListening) { _isListening = false; transcription ...
Read now
Unlock full access