diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 7216da7b..61b453a4 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -19,6 +19,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_datetime_picker_plus/flutter_datetime_picker_plus.dart'; bool isAppArabic = false; + class ProjectViewModel extends BaseViewModel { GAnalytics get analytics => locator(); @@ -38,6 +39,7 @@ class ProjectViewModel extends BaseViewModel { dynamic searchvalue; bool isLogin = false; bool _isAllAppointmentsLoaded = false; + bool get isAllAppointmentsLoaded => _isAllAppointmentsLoaded; bool isPatientAdmitted = false; bool patientHasAdmissionRequest = false; @@ -45,15 +47,17 @@ class ProjectViewModel extends BaseViewModel { GetAdmissionInfoResponseModel getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel(); GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel(); + bool isIndoorNavigationEnabled = false; + void setIsAllAppointmentsLoaded(bool value) { _isAllAppointmentsLoaded = value; notifyListeners(); } - RegisterInfoResponse _registerInfo = RegisterInfoResponse(); RegisterInfoResponse get registerInfo => _registerInfo; + dynamic get searchValue => searchvalue; Locale get appLocal => _appLocale; @@ -70,7 +74,9 @@ class ProjectViewModel extends BaseViewModel { List _projectDetailListModel = []; List get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser; + List get vidaPlusProjectList => _vidaPlusProjectListModel; + List get hMCProjectListModel => _hMCProjectListModel; List get projectDetailListModel => _projectDetailListModel; @@ -137,6 +143,11 @@ class ProjectViewModel extends BaseViewModel { notifyListeners(); } + setIsIndoorNavigationEnabled(bool isEnabled) { + this.isIndoorNavigationEnabled = isEnabled; + notifyListeners(); + } + setPatientHasAdmissionRequest(bool hasAdmissionRequest) { this.patientHasAdmissionRequest = hasAdmissionRequest; notifyListeners(); @@ -200,8 +211,6 @@ class ProjectViewModel extends BaseViewModel { notifyListeners(); } - - bool havePrivilege(int id) { bool isHavePrivilege = false; try { @@ -222,7 +231,7 @@ class ProjectViewModel extends BaseViewModel { @override void dispose() { - if (subscription != null) subscription.cancel(); + if (subscription != null) subscription.cancel(); super.dispose(); } diff --git a/lib/pages/MyAppointments/models/BookedButtons.dart b/lib/pages/MyAppointments/models/BookedButtons.dart index 664f5581..39aed7cc 100644 --- a/lib/pages/MyAppointments/models/BookedButtons.dart +++ b/lib/pages/MyAppointments/models/BookedButtons.dart @@ -40,6 +40,6 @@ class BookedButtons { "caller": "navigateToProject", }, {"title": TranslationBase.of(AppGlobal.context).online, "subtitle": TranslationBase.of(AppGlobal.context).payment, "icon": "online_payment.svg", "caller": "goToTodoList"}, - {"title": TranslationBase.of(AppGlobal.context).clinic, "subtitle": TranslationBase.of(AppGlobal.context).locationa, "icon": "hosp_location.svg", "caller": "goToNavigation"} + // {"title": TranslationBase.of(AppGlobal.context).clinic, "subtitle": TranslationBase.of(AppGlobal.context).locationa, "icon": "hosp_location.svg", "caller": "goToNavigation"} ]; } diff --git a/lib/pages/MyAppointments/models/ConfirmedButtons.dart b/lib/pages/MyAppointments/models/ConfirmedButtons.dart index e810a6da..d49723e9 100644 --- a/lib/pages/MyAppointments/models/ConfirmedButtons.dart +++ b/lib/pages/MyAppointments/models/ConfirmedButtons.dart @@ -20,6 +20,6 @@ class ConfirmedButtons { // "caller": "visitTicket" // }, {"title": TranslationBase.of(AppGlobal.context).online, "subtitle": TranslationBase.of(AppGlobal.context).payment, "icon": "online_payment.svg", "caller": "goToTodoList"}, - {"title": TranslationBase.of(AppGlobal.context).clinic, "subtitle": TranslationBase.of(AppGlobal.context).locationa, "icon": "hosp_location.svg", "caller": "goToNavigation"} + // {"title": TranslationBase.of(AppGlobal.context).clinic, "subtitle": TranslationBase.of(AppGlobal.context).locationa, "icon": "hosp_location.svg", "caller": "goToNavigation"} ]; } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 0d6b8101..9af0c976 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -378,31 +378,32 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { ), ), ), - InkWell( - onTap: () { - NavigationClinicDetails data = NavigationClinicDetails(); - // data.clinicId = appoList[index].clinicID.toString(); - data.clinicId = "46"; - data.patientId = appoList[index].patientID.toString(); - data.projectId = appoList[index].projectID.toString(); - initPenguinSDK(data); - }, - child: Column( - children: [ - Icon(Icons.directions_walk), - Text( - TranslationBase.of(context).clinicLocation, - style: TextStyle( - fontSize: 10, - fontWeight: FontWeight.w600, - color: CustomColors.accentColor, - letterSpacing: -0.48, - height: 25 / 16, - decoration: TextDecoration.underline), - ), - ], + if (projectViewModel.isIndoorNavigationEnabled) + InkWell( + onTap: () { + NavigationClinicDetails data = NavigationClinicDetails(); + // data.clinicId = appoList[index].clinicID.toString(); + data.clinicId = "46"; + data.patientId = appoList[index].patientID.toString(); + data.projectId = appoList[index].projectID.toString(); + initPenguinSDK(data); + }, + child: Column( + children: [ + Icon(Icons.directions_walk), + Text( + TranslationBase.of(context).clinicLocation, + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.w600, + color: CustomColors.accentColor, + letterSpacing: -0.48, + height: 25 / 16, + decoration: TextDecoration.underline), + ), + ], + ), ), - ), ], ), ], diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index a2cf936a..9b22a119 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -52,8 +52,11 @@ class _HomePageFragment2State extends State { hmgServices.add(HmgServices(0, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); hmgServices.add(HmgServices(1, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); - // hmgServices.add(HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); - hmgServices.add(HmgServices(2, "Hospital", "Navigation", "assets/images/new/emergency.svg", isLogin)); + + projectViewModel.isIndoorNavigationEnabled + ? hmgServices.add(HmgServices(2, "Hospital", "Navigation", "assets/images/new/emergency.svg", isLogin)) + : hmgServices.add(HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); + hmgServices.add(HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); hmgServices.add(HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); hmgServices.add(HmgServices(5, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart index 79e93279..c69f772c 100644 --- a/lib/pages/landing/widgets/services_view.dart +++ b/lib/pages/landing/widgets/services_view.dart @@ -228,9 +228,12 @@ class ServicesView extends StatelessWidget { openLiveCare(context); } else if (hmgServices.action == 2) { // initPenguinSDK(); - if (!isLocked) openNavigationProjectSelection(context); - // Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); - // locator().hmgServices.logServiceName('emergency service'); + if (projectViewModel.isIndoorNavigationEnabled) { + if (!isLocked) openNavigationProjectSelection(context); + } else { + Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); + locator().hmgServices.logServiceName('emergency service'); + } } else if (hmgServices.action == 3) { Navigator.push(context, FadePage(page: HomeHealthCarePage())); locator().hmgServices.logServiceName('home health care'); diff --git a/lib/widgets/dialogs/location_selection_dialog.dart b/lib/widgets/dialogs/location_selection_dialog.dart index e0894496..9181615f 100644 --- a/lib/widgets/dialogs/location_selection_dialog.dart +++ b/lib/widgets/dialogs/location_selection_dialog.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:flutter/material.dart'; @@ -250,7 +251,7 @@ class LocationListWrapBody extends StatelessWidget { Navigator.pop(context); onConfirmClicked?.call(); }, - color: Colors.red, + color: CustomColors.accentColor, ), ), ],