Skip to content

Instantly share code, notes, and snippets.

@jtmuller5
Created April 15, 2021 02:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtmuller5/a316c22004777ff2c0b3643537f83604 to your computer and use it in GitHub Desktop.
Save jtmuller5/a316c22004777ff2c0b3643537f83604 to your computer and use it in GitHub Desktop.
import 'package:desk_monkey/services/services.dart';
import 'package:stacked/stacked.dart';
class SingleCommandViewModel extends BaseViewModel{
String recognizedWords = '';
void initialize(){
}
void startListening(){
speechService.startListening((result) {
print('Recognized words: '+ result.recognizedWords);
if(result.recognizedWords != null){
recognizedWords = result.recognizedWords;
notifyListeners();
}
});
}
@override
void dispose() {
super.dispose();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment