|
|
|
@ -217,11 +217,11 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
|
|
|
|
|
|
|
|
|
|
|
|
void resultListener(SpeechRecognitionResult result) {
|
|
|
|
void resultListener(SpeechRecognitionResult result) {
|
|
|
|
// lastWords = "${result.recognizedWords} - ${result.finalResult}";
|
|
|
|
// lastWords = "${result.recognizedWords} - ${result.finalResult}";
|
|
|
|
print(result);
|
|
|
|
|
|
|
|
reconizedWord = result.recognizedWords;
|
|
|
|
reconizedWord = result.recognizedWords;
|
|
|
|
event.setValue({"searchText": reconizedWord});
|
|
|
|
event.setValue({"searchText": reconizedWord});
|
|
|
|
if (result.finalResult == true) {
|
|
|
|
if (result.finalResult == true) {
|
|
|
|
RoboSearch.closeAlertDialog(context);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
// setState(() {
|
|
|
|
|
|
|
|
|
|
|
|
@ -230,6 +230,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
Future.delayed(const Duration(seconds: 1), () {
|
|
|
|
Future.delayed(const Duration(seconds: 1), () {
|
|
|
|
_speak(reconizedWord);
|
|
|
|
_speak(reconizedWord);
|
|
|
|
|
|
|
|
RoboSearch.closeAlertDialog(context);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//});
|
|
|
|
//});
|
|
|
|
@ -942,9 +943,14 @@ class RoboSearch {
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
flex: 1,
|
|
|
|
flex: 1,
|
|
|
|
child: Center(
|
|
|
|
child: Center(
|
|
|
|
child: Text(searchText != null
|
|
|
|
child: Text(searchText != null && searchText != 'null'
|
|
|
|
? searchText
|
|
|
|
? searchText
|
|
|
|
: 'Try saying something')))
|
|
|
|
: 'Try saying something'))),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// searchText == 'null' ? Center(child:RaisedButton(child: Text('Retry'), onPressed: (){
|
|
|
|
|
|
|
|
// //RoboSearch.closeAlertDialog(context);
|
|
|
|
|
|
|
|
// new FloatingSearchButton().createState().startVoiceSearch();
|
|
|
|
|
|
|
|
// }, )) :SizedBox()
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
|