voice command

merge-requests/140/head
Sultan Khan 6 years ago
parent ce7a64e86e
commit 7742313923

@ -50,6 +50,7 @@ import 'core/service/medical/reports_monthly_service.dart';
import 'core/service/medical/vital_sign_service.dart'; import 'core/service/medical/vital_sign_service.dart';
import 'core/service/parmacyModule/order-preview-service.dart'; import 'core/service/parmacyModule/order-preview-service.dart';
import 'core/service/notifications_service.dart'; import 'core/service/notifications_service.dart';
import 'core/service/privilege_service.dart';
import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'core/service/parmacyModule/parmacy_module_service.dart'; import 'core/service/parmacyModule/parmacy_module_service.dart';
@ -153,6 +154,7 @@ void setupLocator() {
locator.registerLazySingleton(() => OrderPreviewService()); locator.registerLazySingleton(() => OrderPreviewService());
locator.registerLazySingleton(() => CustomerAddressesService()); locator.registerLazySingleton(() => CustomerAddressesService());
// locator.registerLazySingleton(() => TermsConditionService()); // locator.registerLazySingleton(() => TermsConditionService());
locator.registerLazySingleton(() => PrivilegeService());
/// View Model /// View Model
locator.registerFactory(() => HospitalViewModel()); locator.registerFactory(() => HospitalViewModel());

@ -133,10 +133,9 @@ class AppScaffold extends StatelessWidget {
buildBodyWidget(context) { buildBodyWidget(context) {
// return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]); // return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
return Stack(children: <Widget>[ //&& Provider.of<ProjectViewModel>(context, listen: false).havePrivilege(77) need to added
body, return Stack(
isHelp==true && Provider.of<ProjectViewModel>(context, listen: false).havePrivilege(77) ? RobotIcon() : Container() children: <Widget>[body, isHelp == true ? RobotIcon() : Container()]);
]);
} }
} }

@ -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()
]), ]),
)); ));
}), }),

Loading…
Cancel
Save