voice command

merge-update-with-lab-changes
Sultan Khan 5 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/parmacyModule/order-preview-service.dart';
import 'core/service/notifications_service.dart';
import 'core/service/privilege_service.dart';
import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'core/service/parmacyModule/parmacy_module_service.dart';
@ -153,6 +154,7 @@ void setupLocator() {
locator.registerLazySingleton(() => OrderPreviewService());
locator.registerLazySingleton(() => CustomerAddressesService());
// locator.registerLazySingleton(() => TermsConditionService());
locator.registerLazySingleton(() => PrivilegeService());
/// View Model
locator.registerFactory(() => HospitalViewModel());

@ -94,37 +94,37 @@ class AppScaffold extends StatelessWidget {
appBar = preferredSize == 0
? appBarWidget
: PreferredSize(
child: appBarWidget,
preferredSize: Size.fromHeight(preferredSize));
child: appBarWidget,
preferredSize: Size.fromHeight(preferredSize));
} else {
appBar = this.appBarWidget;
}
return Scaffold(
backgroundColor:
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: appBar,
body: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
isShowDecPage)
? NotAutPage(
title: appBarTitle,
description: description,
infoList: infoList,
imagesInfo: imagesInfo,
)
: baseViewModel != null
? NetworkBaseView(
child: buildBodyWidget(context),
baseViewModel: baseViewModel,
)
: buildBodyWidget(context),
bottomSheet: bottomSheet
backgroundColor:
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: appBar,
body: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
isShowDecPage)
? NotAutPage(
title: appBarTitle,
description: description,
infoList: infoList,
imagesInfo: imagesInfo,
)
: baseViewModel != null
? NetworkBaseView(
child: buildBodyWidget(context),
baseViewModel: baseViewModel,
)
: buildBodyWidget(context),
bottomSheet: bottomSheet
//floatingActionButton: floatingActionButton ?? floatingActionButton,
// bottomNavigationBar:
// this.isBottomBar == true ? BottomBarSearch() : SizedBox()
//floatingActionButton: FloatingSearchButton(),
);
//floatingActionButton: floatingActionButton ?? floatingActionButton,
// bottomNavigationBar:
// this.isBottomBar == true ? BottomBarSearch() : SizedBox()
//floatingActionButton: FloatingSearchButton(),
);
}
buildAppLoaderWidget(bool isLoading) {
@ -133,10 +133,9 @@ class AppScaffold extends StatelessWidget {
buildBodyWidget(context) {
// return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
return Stack(children: <Widget>[
body,
isHelp==true && Provider.of<ProjectViewModel>(context, listen: false).havePrivilege(77) ? RobotIcon() : Container()
]);
//&& Provider.of<ProjectViewModel>(context, listen: false).havePrivilege(77) need to added
return Stack(
children: <Widget>[body, isHelp == true ? RobotIcon() : Container()]);
}
}

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