How to implement speech to text in flutter with better accuracy and control
As the name suggests speech to text is process which gives android apps voice maneuvers. This article explains the use of speech to text package rather than “speech_recognition” package which is not supported well in flutter.
Voice maneuver is better than typing everything manually tediously.
Include the following package in pubspec.yaml file
and run “Flutter pub get “ to build the package inside your app.
Change the minimum SDK version to 21 in build grade file of app subfolder of android folder . As speech to text minimum support SDK is 21.
Include the following line
import ‘package: speech_to_text/speech_to_text.dart’ as stt;
In the page where you want to speech recognition to be implemented
Create a floating action button with mic Symbol . Call the “ _listen” function inside “on pressed “ of floating action button. _listen code is given below.
Give it a test.
https://github.com/coeaimrm/flutter_voice/tree/improved(Forked and improved on MarcusNG)