voice command priv

merge-requests/140/head
Sultan Khan 5 years ago
parent a004610ac3
commit 7f44677242

@ -52,6 +52,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
var notificationCount = ''; var notificationCount = '';
var themeNotifier; var themeNotifier;
///inject the user data ///inject the user data
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
@ -75,8 +76,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
LocationUtils locationUtils; LocationUtils locationUtils;
_changeCurrentTab(int tab) { _changeCurrentTab(int tab) {
setState(() { setState(() {
currentTab = tab; currentTab = tab;
pageController.jumpToPage(tab); pageController.jumpToPage(tab);
}); });
} }
@ -140,18 +142,17 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
locationUtils = locationUtils =
new LocationUtils(isShowConfirmDialog: true, context: context); new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance WidgetsBinding.instance
.addPostFrameCallback((_) => locationUtils.getCurrentLocation()); .addPostFrameCallback((_) => locationUtils.getCurrentLocation());
if (Platform.isIOS) { if (Platform.isIOS) {
_firebaseMessaging.requestNotificationPermissions(); _firebaseMessaging.requestNotificationPermissions();
} }
_firebaseMessaging.getToken().then((String token) async { _firebaseMessaging.getToken().then((String token) async {
sharedPref.setString(PUSH_TOKEN, token); sharedPref.setString(PUSH_TOKEN, token);
if (token != null && await sharedPref.getObject(USER_PROFILE) ==null) { if (token != null && await sharedPref.getObject(USER_PROFILE) == null) {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;
checkUserStatus(token); checkUserStatus(token);
} }
@ -392,7 +393,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
notificationCount, notificationCount,
style: new TextStyle( style: new TextStyle(
color: Colors.white, color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 9, fontSize: projectViewModel.isArabic ? 8 : 9,
), ),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
@ -416,7 +417,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
SETTINGS, SETTINGS,
); );
else else
login(); login();
}, //do something, }, //do something,
) )
], ],
@ -430,7 +431,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
children: [ children: [
HomePage( HomePage(
goToMyProfile: () { goToMyProfile: () {
_changeCurrentTab(1); // _changeCurrentTab(1);
}, },
), ),
MedicalProfilePage(), MedicalProfilePage(),
@ -471,45 +472,46 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return TranslationBase.of(context).bookAppo; return TranslationBase.of(context).bookAppo;
} }
} }
setTheme() async{
// setTheme() async {
// defaultTheme = //
// ThemeData( // defaultTheme =
// fontFamily:projectViewModel.isArabic ? 'Cairo' : 'WorkSans', // ThemeData(
// primarySwatch: Colors.blue, // fontFamily:projectViewModel.isArabic ? 'Cairo' : 'WorkSans',
// visualDensity: VisualDensity.adaptivePlatformDensity, // primarySwatch: Colors.blue,
// brightness: Brightness.light, // visualDensity: VisualDensity.adaptivePlatformDensity,
// pageTransitionsTheme: const PageTransitionsTheme( // brightness: Brightness.light,
// builders: { // pageTransitionsTheme: const PageTransitionsTheme(
// TargetPlatform.android: ZoomPageTransitionsBuilder(), // builders: {
// TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), // TargetPlatform.android: ZoomPageTransitionsBuilder(),
// }, // TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
// ), // },
// hintColor: Colors.grey[400], // ),
// disabledColor: Colors.grey[300], // hintColor: Colors.grey[400],
// errorColor: Color.fromRGBO(235, 80, 60, 1.0), // disabledColor: Colors.grey[300],
// scaffoldBackgroundColor: Color(0xffEEEEEE), // errorColor: Color.fromRGBO(235, 80, 60, 1.0),
// textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), // scaffoldBackgroundColor: Color(0xffEEEEEE),
// textSelectionHandleColor: Colors.grey, // textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
// canvasColor: Colors.white, // textSelectionHandleColor: Colors.grey,
// backgroundColor: Colors.white, // canvasColor: Colors.white,
// highlightColor: Colors.grey[100].withOpacity(0.4), // backgroundColor: Colors.white,
// splashColor: Colors.transparent, // highlightColor: Colors.grey[100].withOpacity(0.4),
// primaryColor: Color(0xff40ACC9), // splashColor: Colors.transparent,
// bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), // primaryColor: Color(0xff40ACC9),
// cursorColor: Colors.grey, // bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
// cardColor: Colors.white, // cursorColor: Colors.grey,
// iconTheme: IconThemeData(), // cardColor: Colors.white,
// appBarTheme: AppBarTheme( // iconTheme: IconThemeData(),
// color: Color(0xff40ACC9), // appBarTheme: AppBarTheme(
// brightness: Brightness.dark, // color: Color(0xff40ACC9),
// elevation: 10.0, // brightness: Brightness.dark,
// actionsIconTheme: IconThemeData( // elevation: 10.0,
// color: Color(0xff40ACC9), // actionsIconTheme: IconThemeData(
// ), // color: Color(0xff40ACC9),
// ), // ),
// ); // ),
// themeNotifier.setTheme(defaultTheme); // );
// themeNotifier.setTheme(defaultTheme);
} }
void checkUserStatus(token) async { void checkUserStatus(token) async {
authService authService
@ -524,8 +526,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
.then((res) => {print(res)}); .then((res) => {print(res)});
authService.getDashboard().then((value) => { authService.getDashboard().then((value) => {
setState(() { setState(() {
notificationCount = value['List_PatientDashboard'] notificationCount = value['List_PatientDashboard'][0]
[0]['UnreadPatientNotificationCount'].toString(); ['UnreadPatientNotificationCount']
.toString();
}) })
}); });
} }
@ -557,6 +560,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_changeCurrentTab(2); _changeCurrentTab(2);
} }
} }
login() async { login() async {
var data = await sharedPref.getObject(IMEI_USER_DATA); var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);

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

@ -221,6 +221,8 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
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(() {
// setState(() { // setState(() {

Loading…
Cancel
Save