From ded6e02663f4efdde3812318b6f25a51df919f3b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 26 Nov 2023 15:05:45 +0300 Subject: [PATCH 01/19] CheckIn By Param added --- lib/pages/BookAppointment/QRCode.dart | 10 +++++----- lib/services/appointment_services/GetDoctorsList.dart | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index a6d55dce..2c2cc83d 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -77,7 +77,7 @@ class _QRCodeState extends State { Future.delayed(const Duration(milliseconds: 500), () { showNfcReader(context, onNcfScan: (String nfcId) { Future.delayed(const Duration(milliseconds: 100), () { - sendNfcCheckInRequest(nfcId); + sendNfcCheckInRequest(nfcId, 1); locator().todoList.to_do_list_nfc(widget.appointment); }); }, onCancel: () { @@ -90,7 +90,7 @@ class _QRCodeState extends State { startQRCodeScan() async { String onlineCheckInQRCode = (await BarcodeScanner.scan())?.rawContent; if (onlineCheckInQRCode != "") { - sendNfcCheckInRequest(onlineCheckInQRCode); + sendNfcCheckInRequest(onlineCheckInQRCode, 2); locator().todoList.to_do_list_nfc(widget.appointment); } else {} } @@ -102,7 +102,7 @@ class _QRCodeState extends State { double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude), double.parse(projectDetailListModel.longitude)).ceilToDouble() * 1000; print(dist); if (dist <= projectDetailListModel.geofenceRadius) { - sendNfcCheckInRequest(projectDetailListModel.checkInQrCode); + sendNfcCheckInRequest(projectDetailListModel.checkInQrCode, 3); } else { AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError); } @@ -341,12 +341,12 @@ class _QRCodeState extends State { return docSpeciality; } - sendNfcCheckInRequest(String nfcId) { + sendNfcCheckInRequest(String nfcId, int checkInBy) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, context).then((res) { + service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, checkInBy, context).then((res) { print(res); GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 052078bf..a7482eaa 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1553,13 +1553,14 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, BuildContext context) async { + Future sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, int checkInBy, BuildContext context) async { Map request; request = { "AppointmentNo": appointmentNo, "NFC_Code": nfcCode, "ProjectID": projectId, + "CheckinBy": checkInBy }; dynamic localRes; await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async { From beb3453ff5e57842c0ba0ee52929f50ee261eb40 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 27 Nov 2023 14:09:54 +0300 Subject: [PATCH 02/19] updates --- lib/core/model/rate/appoitment_rated.dart | 4 ++-- lib/uitl/push-notification-handler.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/core/model/rate/appoitment_rated.dart b/lib/core/model/rate/appoitment_rated.dart index 95358b23..2f0d0dae 100644 --- a/lib/core/model/rate/appoitment_rated.dart +++ b/lib/core/model/rate/appoitment_rated.dart @@ -26,12 +26,12 @@ class AppoitmentRated { String arrivedOn; int editedBy; String editedOn; - Null doctorName; + String doctorName; String doctorNameN; String statusDesc; String statusDescN; bool vitalStatus; - Null vitalSignAppointmentNo; + dynamic vitalSignAppointmentNo; int episodeID; String doctorTitle; bool isAppoitmentLiveCare; diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 3e765c17..03e6ec29 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -336,7 +336,7 @@ class PushNotificationHandler { onToken(String token) async { print("Push Notification Token: " + token); - AppSharedPreferences().setString(PUSH_TOKEN, token); + await AppSharedPreferences().setString(PUSH_TOKEN, token); DEVICE_TOKEN = token; } From 8b468fe4b541738c4ab434335dfff3691b8416a9 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 28 Nov 2023 11:18:37 +0300 Subject: [PATCH 03/19] Updates & fixes --- lib/config/config.dart | 4 +- lib/pages/BookAppointment/BookSuccess.dart | 60 ++++++++++++----- .../models/BookedButtonsAllowCheckIn.dart | 6 +- .../widgets/AppointmentActions.dart | 1 + lib/pages/landing/landing_page.dart | 23 +++++++ lib/pages/login/confirm-login.dart | 53 +++++---------- lib/pages/login/login.dart | 67 +++++++++++-------- .../rate_appointment_clinic.dart | 14 ++-- .../rate_appointment_doctor.dart | 8 +-- lib/splashPage.dart | 8 +-- 10 files changed, 147 insertions(+), 97 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0eeacbad..3b774575 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:2018/'; - // var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 62708472..ea0f186b 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -159,26 +159,54 @@ class _BookSuccessState extends State { Widget _getQRButtons() { return Container( alignment: Alignment.bottomCenter, + margin: EdgeInsets.all(14), height: MediaQuery.of(context).size.height * 0.18, child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: CustomTextButton( - backgroundColor: Color(0xFF60686b), - elevation: 0, - onPressed: () { -// navigateToQR(context); - GifLoaderDialogUtils.showMyDialog(context); - getAppoQR(context); - }, - child: Text(TranslationBase.of(context).viewQR.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)), - ), + Row( + children: [ + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: CustomTextButton( + backgroundColor: CustomColors.green, + elevation: 0, + onPressed: () { + GifLoaderDialogUtils.showMyDialog(context); + getAppoQR(context); + }, + child: Text(TranslationBase.of(context).checkinOptions, style: TextStyle(fontSize: 18.0, color: Colors.white)), + ), + ), + ), + mWidth(7), + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: CustomTextButton( + backgroundColor: Color(0xffc5272d), + elevation: 0, + onPressed: () { + navigateToHome(context); + // GifLoaderDialogUtils.showMyDialog(context); + // getAppoQR(context); + }, + child: Text(TranslationBase.of(context).done, style: TextStyle(fontSize: 18.0, color: Colors.white)), + ), + ), + ), + ], ), ], ), diff --git a/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart b/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart index 96174828..1062eaf3 100644 --- a/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart +++ b/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart @@ -30,19 +30,19 @@ class BookedButtonsAllowCheckIn { { "title": TranslationBase.of(AppGlobal.context).add, "subtitle": TranslationBase.of(AppGlobal.context).reminder, - "icon": "reminder_icon.png", + "icon": "assets/images/new-design/reminder_icon.png", "caller": "addReminder", }, { "title": TranslationBase.of(AppGlobal.context).hospital, "subtitle": TranslationBase.of(AppGlobal.context).location, - "icon": "location_icon.png", + "icon": "assets/images/new-design/location_icon.png", "caller": "navigateToProject", }, { "title": TranslationBase.of(AppGlobal.context).online, "subtitle": TranslationBase.of(AppGlobal.context).payment, - "icon": "check-in.png", + "icon": "assets/images/new-design/check-in.png", "caller": "goToTodoList", } ]; diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index deee5a5e..76d89f82 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -92,6 +92,7 @@ class _AppointmentActionsState extends State { hasBadge: true, isEnable: !shouldEnable, imgColor: Color(0xff28323A), + isPngImage: appoButtonsList[index].icon.contains(".png") ? true : false, ), ); }, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 0c044e6b..eef268ab 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; @@ -17,6 +18,7 @@ import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page_2.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart'; +import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; @@ -36,6 +38,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -71,6 +74,7 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State with WidgetsBindingObserver { var authProvider = new AuthProvider(); + AppointmentRateViewModel appointmentRateViewModel = locator(); int currentTab = 0; PageController pageController; @@ -648,6 +652,25 @@ class _LandingPageState extends State with WidgetsBindingObserver { model.setState(model.count, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); FlutterAppIconBadge.updateBadge(num.parse(notificationCount)); + + appointmentRateViewModel + .getIsLastAppointmentRatedList() + .then((value) => { + // getToDoCount(), + // GifLoaderDialogUtils.hideDialog(AppGlobal.context), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.push( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + ), + } + }) + .catchError((err) { + print(err); + }); } }), }); diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 73012bd5..12ee9ecb 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -42,8 +42,9 @@ import 'package:provider/provider.dart'; class ConfirmLogin extends StatefulWidget { final Function changePageViewIndex; final fromRegistration; - final bool isDubai; - const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai =false}) : super(key: key); + final bool isDubai; + + const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai = false}) : super(key: key); @override _ConfirmLogin createState() => _ConfirmLogin(); @@ -386,9 +387,9 @@ class _ConfirmLogin extends State { request.sMSSignature = await SMSOTP.getSignature(); GifLoaderDialogUtils.showMyDialog(context); if (healthId != null || widget.isDubai) { - if(!widget.isDubai){ - request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); - } + if (!widget.isDubai) { + request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); + } request.healthId = healthId; request.isHijri = isHijri; await this.authService.sendActivationCodeRegister(request).then((result) { @@ -568,7 +569,7 @@ class _ConfirmLogin extends State { var request = this.getCommonRequest().toJson(); dynamic res; if (healthId != null || widget.isDubai) { - if(!widget.isDubai) { + if (!widget.isDubai) { request['DOB'] = dob; } request['HealthId'] = healthId; @@ -583,7 +584,7 @@ class _ConfirmLogin extends State { result = CheckActivationCode.fromJson(result), if (this.registerd_data != null && this.registerd_data.isRegister == true) { - // if(widget.isDubai ==false){ + // if(widget.isDubai ==false){ widget.changePageViewIndex(1), Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)), } @@ -694,36 +695,16 @@ class _ConfirmLogin extends State { projectViewModel.user = authenticatedUserObject.user; await authenticatedUserObject.getUser(getUser: true); - // getToDoCount(); + GifLoaderDialogUtils.hideDialog(context); - appointmentRateViewModel - .getIsLastAppointmentRatedList() - .then((value) => { - getToDoCount(), - GifLoaderDialogUtils.hideDialog(AppGlobal.context), - if (appointmentRateViewModel.isHaveAppointmentNotRate) - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: RateAppointmentDoctor(), - ), - (r) => false) - } - else - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: LandingPage(), - ), - (r) => false) - }, - insertIMEI() - }) - .catchError((err) { - print(err); - }); + getToDoCount(); + + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false); } loading(flag) { diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index adcc4820..107db2c3 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -345,34 +345,45 @@ class _Login extends State { authenticatedUserObject.user = result.list; projectViewModel.user = authenticatedUserObject.user; - appointmentRateViewModel - .getIsLastAppointmentRatedList() - .then((value) => { - getToDoCount(), - GifLoaderDialogUtils.hideDialog(context), - if (appointmentRateViewModel.isHaveAppointmentNotRate) - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: RateAppointmentDoctor(), - ), - (r) => false) - } - else - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: LandingPage(), - ), - (r) => false) - } - }) - .catchError((err) { - print(err); - GifLoaderDialogUtils.hideDialog(context); - }); + GifLoaderDialogUtils.hideDialog(context); + + getToDoCount(); + + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false); + + // appointmentRateViewModel + // .getIsLastAppointmentRatedList() + // .then((value) => { + // getToDoCount(), + // GifLoaderDialogUtils.hideDialog(context), + // if (appointmentRateViewModel.isHaveAppointmentNotRate) + // { + // Navigator.pushAndRemoveUntil( + // context, + // FadePage( + // page: RateAppointmentDoctor(), + // ), + // (r) => false) + // } + // else + // { + // Navigator.pushAndRemoveUntil( + // context, + // FadePage( + // page: LandingPage(), + // ), + // (r) => false) + // } + // }) + // .catchError((err) { + // print(err); + // GifLoaderDialogUtils.hideDialog(context); + // }); }); } diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index aac0a4d6..09b083cc 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -191,11 +191,17 @@ class _RateAppointmentClinicState extends State { child: DefaultButton( TranslationBase.of(context).later, () { - Navigator.pushReplacement( + // Navigator.pushReplacement( + // context, + // FadePage( + // page: LandingPage(), + // ), + // ); + Navigator.pop( + context, + ); + Navigator.pop( context, - FadePage( - page: LandingPage(), - ), ); }, color: CustomColors.accentColor, diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 08a597ab..5127dfa6 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -189,11 +189,11 @@ class _RateAppointmentDoctorState extends State { }); dialog.showAlertDialog(context); } else { - Navigator.pushReplacement( + Navigator.pop( context, - FadePage( - page: LandingPage(), - ), + // FadePage( + // page: LandingPage(), + // ), ); } }, diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 2c74a963..b8293e0f 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -44,10 +44,10 @@ class _SplashScreenState extends State { }, ); - AppSharedPreferences().getAll().then((value) { - debugPrint("ALL SHARED PREFERENCES!!!!!"); - debugPrint(jsonEncode(value)); - }); + // AppSharedPreferences().getAll().then((value) { + // debugPrint("ALL SHARED PREFERENCES!!!!!"); + // debugPrint(jsonEncode(value)); + // }); } /// load the Privilege from service From 421bae2037d6a5f1754a83b6ec4316a115972930 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 5 Dec 2023 11:36:14 +0300 Subject: [PATCH 04/19] updates --- lib/config/config.dart | 4 +- lib/config/shared_pref_kay.dart | 1 + lib/core/model/rate/appoitment_rated.dart | 2 +- lib/core/service/client/base_app_client.dart | 2 +- lib/pages/landing/landing_page.dart | 52 +++++++++----------- 5 files changed, 29 insertions(+), 32 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 3b774575..0eeacbad 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:2018/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; + // var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index ec82db11..f92841e3 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -43,3 +43,4 @@ const CLINICS_LIST = 'CLINICS_LIST'; const COVID_QA_LIST = 'COVID_QA_LIST'; const IS_COVID_CONSENT_SHOWN = 'IS_COVID_CONSENT_SHOWN'; const REGISTER_INFO_DUBAI ='register-info-dubai'; +const IS_LAST_APPOINTMENT_RATE_SHOWN ='is-last-appointment-rate-shown'; diff --git a/lib/core/model/rate/appoitment_rated.dart b/lib/core/model/rate/appoitment_rated.dart index 2f0d0dae..820e36a5 100644 --- a/lib/core/model/rate/appoitment_rated.dart +++ b/lib/core/model/rate/appoitment_rated.dart @@ -26,7 +26,7 @@ class AppoitmentRated { String arrivedOn; int editedBy; String editedOn; - String doctorName; + dynamic doctorName; String doctorNameN; String statusDesc; String statusDescN; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 8c9118c8..81fc2d6a 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,7 +150,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 1048710; //3844083 + // body['PatientID'] = 3183712; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index eef268ab..0ecdc0d4 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -645,35 +645,31 @@ class _LandingPageState extends State with WidgetsBindingObserver { var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {}); - authService.getDashboard().then((value) => { - setState(() { - if (value != null) { - notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); - model.setState(model.count, true, notificationCount); - sharedPref.setString(NOTIFICATION_COUNT, notificationCount); - FlutterAppIconBadge.updateBadge(num.parse(notificationCount)); - - appointmentRateViewModel - .getIsLastAppointmentRatedList() - .then((value) => { - // getToDoCount(), - // GifLoaderDialogUtils.hideDialog(AppGlobal.context), - if (appointmentRateViewModel.isHaveAppointmentNotRate) - { - Navigator.push( - context, - FadePage( - page: RateAppointmentDoctor(), - ), - ), - } - }) - .catchError((err) { - print(err); - }); - } - }), + authService.getDashboard().then((value) async { + setState(() { + if (value != null) { + notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); + model.setState(model.count, true, notificationCount); + sharedPref.setString(NOTIFICATION_COUNT, notificationCount); + FlutterAppIconBadge.updateBadge(num.parse(notificationCount)); + } + }); + if (await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN) == null || !await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN)) { + appointmentRateViewModel.getIsLastAppointmentRatedList().then((value) async { + if (appointmentRateViewModel.isHaveAppointmentNotRate) { + await AppSharedPreferences().setBool(IS_LAST_APPOINTMENT_RATE_SHOWN, true); + Navigator.push( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + ); + } + }).catchError((err) { + print(err); }); + } + }); } projectViewModel.analytics.setUser(data); } else { From 0a9aee0246c5af174ea41a93f3ba95e3fc85fe76 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 5 Dec 2023 14:47:56 +0300 Subject: [PATCH 05/19] updates --- lib/pages/landing/landing_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 0ecdc0d4..47dab9ba 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -640,7 +640,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { void checkUserStatus(token) async { await PushNotificationHandler.getInstance().isAndroidPermissionGranted(); - authService.selectDeviceImei(token).then((SelectDeviceIMEIRES value) => setUserValues(value)); + // authService.selectDeviceImei(token).then((SelectDeviceIMEIRES value) => setUserValues(value)); if (authenticatedUserObject.isLogin) { var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { From c6c4f933b2c43ced4c964a11875cab70572fcd14 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 6 Dec 2023 09:56:57 +0300 Subject: [PATCH 06/19] Invoice Type param added in Labs & Rad --- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 2 +- lib/core/model/labs/patient_lab_orders.dart | 16 +++++--- .../request_patient_lab_special_result.dart | 38 ++++++++++--------- .../labs/request_send_lab_report_email.dart | 4 ++ lib/core/model/radiology/final_radiology.dart | 18 +++++---- .../request_send_rad_report_email.dart | 4 ++ lib/core/service/client/base_app_client.dart | 2 +- lib/core/service/medical/labs_service.dart | 6 ++- .../service/medical/radiology_service.dart | 4 +- .../viewModels/medical/labs_view_model.dart | 3 +- .../medical/radiology_view_model.dart | 4 +- .../notification_details_page.dart | 28 +++++++++----- .../medical/labs/laboratory_result_page.dart | 1 + .../radiology/radiology_details_page.dart | 1 + 15 files changed, 86 insertions(+), 47 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0eeacbad..4ae8f64d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -339,7 +339,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 11.3; +var VERSION_ID = 11.4; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3f3074d3..ba17f2ec 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -791,7 +791,7 @@ const Map localizedValues = { "Upon activation of this service, the system will send a monthly report automatically to the registered email which lists the vital signs and the results for the last visits made in AlHabib Medical Group.", "ar": "خدمة التقارير الشهرية: عند تفعيل هذه الخدمة سيقوم النظام بارسال تقرير شهري بشكل آلي على الايميل المسجل والذي يسرد المؤشرات الحيوية ونتائج التحاليل لآخر زيارات تمت بمجموعة الحبيب الطبية." }, - "language-setting": {"en": "SMS and Confirmation Calls Language", "ar": "لغة الرسائل القصيرة و الاتصال الآلي"}, + "language-setting": {"en": "SMS, WhatsApp and Confirmation Calls Language", "ar": "لغة الرسائل القصيرة والواتس اب وتأكيد المكالمات"}, "alert": {"en": "Alerts", "ar": "التنبيهات"}, "email-alert": {"en": "Alert by Email", "ar": "استلام التنبيهات بالبريد الالكتروني"}, "sms-alert": {"en": "Alert by SMS", "ar": "استلام التنبيهات بالرسائل القصيرة"}, diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index c2908023..c58222e3 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -17,6 +17,7 @@ class PatientLabOrders { String genderDescription; String invoiceNo; String invoiceNo_VP; + String invoiceType; bool isActiveDoctorProfile; bool isDoctorAllowVedioCall; bool isExecludeDoctor; @@ -36,6 +37,7 @@ class PatientLabOrders { String setupID; List speciality; bool isLiveCareAppointment; + PatientLabOrders( {this.actualDoctorRate, this.clinicDescription, @@ -69,8 +71,10 @@ class PatientLabOrders { this.projectNameN, this.qR, this.setupID, - this.invoiceNo_VP, - this.speciality,this.isLiveCareAppointment}); + this.invoiceNo_VP, + this.invoiceType, + this.speciality, + this.isLiveCareAppointment}); PatientLabOrders.fromJson(Map json) { actualDoctorRate = json['ActualDoctorRate']; @@ -106,8 +110,9 @@ class PatientLabOrders { qR = json['QR']; setupID = json['SetupID']; invoiceNo_VP = json['invoiceNo_VP']; + invoiceType = json['InvoiceType']; isLiveCareAppointment = json['IsLiveCareAppointment']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); } Map toJson() { @@ -146,7 +151,7 @@ class PatientLabOrders { data['SetupID'] = this.setupID; data['Speciality'] = this.speciality; data['IsLiveCareAppointment'] = this.isLiveCareAppointment; - data['invoiceNo_VP'] =this.invoiceNo_VP; + data['invoiceNo_VP'] = this.invoiceNo_VP; return data; } } @@ -155,8 +160,7 @@ class PatientLabOrdersList { String filterName = ""; List patientLabOrdersList = List(); - PatientLabOrdersList( - {this.filterName, PatientLabOrders patientDoctorAppointment}) { + PatientLabOrdersList({this.filterName, PatientLabOrders patientDoctorAppointment}) { patientLabOrdersList.add(patientDoctorAppointment); } } diff --git a/lib/core/model/labs/request_patient_lab_special_result.dart b/lib/core/model/labs/request_patient_lab_special_result.dart index b3794e3c..795fa025 100644 --- a/lib/core/model/labs/request_patient_lab_special_result.dart +++ b/lib/core/model/labs/request_patient_lab_special_result.dart @@ -1,6 +1,7 @@ class RequestPatientLabSpecialResult { String invoiceNo; String invoiceNoVP; + String invoiceType; String orderNo; String setupID; String projectID; @@ -22,27 +23,29 @@ class RequestPatientLabSpecialResult { RequestPatientLabSpecialResult( {this.invoiceNo, this.invoiceNoVP, - this.orderNo, - this.setupID, - this.projectID, - this.clinicID, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType}); + this.invoiceType, + this.orderNo, + this.setupID, + this.projectID, + this.clinicID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); RequestPatientLabSpecialResult.fromJson(Map json) { invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo_VP']; + invoiceType = json['InvoiceType']; orderNo = json['OrderNo']; setupID = json['SetupID']; projectID = json['ProjectID']; @@ -66,6 +69,7 @@ class RequestPatientLabSpecialResult { final Map data = new Map(); data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo_VP'] = this.invoiceNoVP; + data['InvoiceType'] = this.invoiceType; data['OrderNo'] = this.orderNo; data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart index 2188c500..41fa30f9 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -24,6 +24,7 @@ class RequestSendLabReportEmail { String projectID; String invoiceNo; String invoiceNoVP; + String invoiceType; String orderDate; String orderNo; bool isDownload; @@ -55,6 +56,7 @@ class RequestSendLabReportEmail { this.projectID, this.invoiceNo, this.invoiceNoVP, + this.invoiceType, this.orderDate, this.orderNo, this.isDownload, @@ -86,6 +88,7 @@ class RequestSendLabReportEmail { projectID = json['ProjectID']; invoiceNo = json['InvoiceNo']; invoiceNoVP = json['InvoiceNo_VP']; + invoiceType = json['InvoiceType']; orderDate = json['OrderDate']; orderNo = json['OrderNo']; isDownload = json['IsDownload']; @@ -119,6 +122,7 @@ class RequestSendLabReportEmail { data['ProjectID'] = this.projectID; data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo_VP'] = this.invoiceNoVP; + data['InvoiceType'] = this.invoiceType; data['OrderDate'] = this.orderDate; data['OrderNo'] = this.orderNo; data['IsDownload'] = this.isDownload; diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index d92ffead..a600d0be 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -7,6 +7,7 @@ class FinalRadiology { int invoiceLineItemNo; int invoiceNo; dynamic invoiceNo_VP; + String invoiceType; int doctorID; int clinicID; DateTime orderDate; @@ -50,7 +51,8 @@ class FinalRadiology { this.patientID, this.invoiceLineItemNo, this.invoiceNo, - this.invoiceNo_VP, + this.invoiceNo_VP, + this.invoiceType, this.doctorID, this.clinicID, this.orderDate, @@ -85,7 +87,8 @@ class FinalRadiology { this.reportDataTextString, this.speciality, this.isCVI, - this.isRadMedicalReport,this.isLiveCareAppointment}); + this.isRadMedicalReport, + this.isLiveCareAppointment}); FinalRadiology.fromJson(Map json) { try { @@ -95,6 +98,7 @@ class FinalRadiology { invoiceLineItemNo = json['InvoiceLineItemNo']; invoiceNo = json['InvoiceNo']; invoiceNo_VP = json['InvoiceNo_VP']; + invoiceType = json['InvoiceType']; doctorID = json['DoctorID']; clinicID = json['ClinicID']; orderDate = DateUtil.convertStringToDate(json['OrderDate']); @@ -128,10 +132,9 @@ class FinalRadiology { isLiveCareAppointment = json['IsLiveCareAppointment']; reportDataHTML = json['ReportDataHTML']; reportDataTextString = json['ReportDataTextString']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); isCVI = json['isCVI']; isRadMedicalReport = json['isRadMedicalReport']; - } catch (e) { print(e); } @@ -145,6 +148,7 @@ class FinalRadiology { data['InvoiceLineItemNo'] = this.invoiceLineItemNo; data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo_VP'] = this.invoiceNo_VP; + data['InvoiceType'] = this.invoiceType; data['DoctorID'] = this.doctorID; data['ClinicID'] = this.clinicID; data['OrderDate'] = this.orderDate; @@ -189,7 +193,7 @@ class FinalRadiologyList { List finalRadiologyList = List(); FinalRadiologyList({this.filterName, this.finalRadiologyList}); - // { - // finalRadiologyList.add(finalRadiology); - // } +// { +// finalRadiologyList.add(finalRadiology); +// } } diff --git a/lib/core/model/radiology/request_send_rad_report_email.dart b/lib/core/model/radiology/request_send_rad_report_email.dart index 6819de0d..1f3b7117 100644 --- a/lib/core/model/radiology/request_send_rad_report_email.dart +++ b/lib/core/model/radiology/request_send_rad_report_email.dart @@ -7,6 +7,7 @@ class RequestSendRadReportEmail { String generalid; int invoiceNo; int invoiceNo_VP; + String invoiceType; String iPAdress; bool isDentalAllowedBackend; int languageID; @@ -37,6 +38,7 @@ class RequestSendRadReportEmail { this.generalid, this.invoiceNo, this.invoiceNo_VP, + this.invoiceType, this.iPAdress, this.isDentalAllowedBackend, this.languageID, @@ -66,6 +68,7 @@ class RequestSendRadReportEmail { generalid = json['generalid']; invoiceNo = json['InvoiceNo']; invoiceNo_VP = json['InvoiceNo_VP']; + invoiceType = json['InvoiceType']; iPAdress = json['IPAdress']; isDentalAllowedBackend = json['isDentalAllowedBackend']; languageID = json['LanguageID']; @@ -98,6 +101,7 @@ class RequestSendRadReportEmail { data['generalid'] = this.generalid; data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo_VP'] = this.invoiceNo_VP; + data['InvoiceType'] = this.invoiceType; data['IPAdress'] = this.iPAdress; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['LanguageID'] = this.languageID; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 81fc2d6a..34a0a753 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,7 +150,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 3183712; //3844083 + // body['PatientID'] = 2941698; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index bee65b87..1d635c69 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -34,7 +34,7 @@ class LabsService extends BaseService { List labResultList = List(); List labOrdersResultsList = List(); - Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID, bool isVidaPlus}) async { + Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String invoiceType, String orderNo, String setupID, bool isVidaPlus}) async { hasError = false; _requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.clinicID = clinicID; @@ -42,6 +42,8 @@ class LabsService extends BaseService { _requestPatientLabSpecialResult.invoiceNo = isVidaPlus ? "0" : invoiceNo; _requestPatientLabSpecialResult.invoiceNoVP = isVidaPlus ? invoiceNo : "0"; + _requestPatientLabSpecialResult.invoiceType = invoiceType; + _requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.setupID = setupID; @@ -61,6 +63,7 @@ class LabsService extends BaseService { Map body = Map(); body['InvoiceNo_VP'] = isVidaPlus ? patientLabOrder.invoiceNo : "0"; body['InvoiceNo'] = isVidaPlus ? "0" : patientLabOrder.invoiceNo; + body['InvoiceType'] = patientLabOrder.invoiceType; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; @@ -205,6 +208,7 @@ class LabsService extends BaseService { _requestSendLabReportEmail.projectID = patientLabOrder.projectID; _requestSendLabReportEmail.invoiceNo = isVidaPlus ? "0" : patientLabOrder.invoiceNo; _requestSendLabReportEmail.invoiceNoVP = isVidaPlus ? patientLabOrder.invoiceNo : "0"; + _requestSendLabReportEmail.invoiceType = patientLabOrder.invoiceType; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; _requestSendLabReportEmail.patientName = userObj.firstName + " " + userObj.lastName; diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index f2a54c0c..68822085 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -10,13 +10,14 @@ class RadiologyService extends BaseService { bool isRadiologyVIDAPlus = false; - Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus}) async { + Future getRadImageURL({int invoiceNo, String invoiceType, int lineItem, int projectId, bool isVidaPlus}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo; body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0"; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; + body['InvoiceType'] = invoiceType; await baseAppClient.post(GET_RAD_IMAGE_URL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) { url = response['Data']; @@ -79,6 +80,7 @@ class RadiologyService extends BaseService { _requestSendRadReportEmail.radResult = finalRadiology.reportData; _requestSendRadReportEmail.to = userObj.emailAddress; _requestSendRadReportEmail.dateofBirth = userObj.dateofBirth; + _requestSendRadReportEmail.invoiceType = finalRadiology.invoiceType; hasError = false; await baseAppClient.post(SEND_RAD_REPORT_EMAIL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index ca577ac6..b75dafad 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -74,9 +74,10 @@ class LabsViewModel extends BaseViewModel { List labResultLists = List(); - getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID, bool isVidaPlus}) async { + getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String invoiceType, String orderNo, String setupID, bool isVidaPlus}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, + invoiceType: invoiceType, orderNo: orderNo, projectID: projectID, clinicID: clinicID, diff --git a/lib/core/viewModels/medical/radiology_view_model.dart b/lib/core/viewModels/medical/radiology_view_model.dart index 3ee6fedf..ddffd50b 100644 --- a/lib/core/viewModels/medical/radiology_view_model.dart +++ b/lib/core/viewModels/medical/radiology_view_model.dart @@ -48,9 +48,9 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus}) async { + getRadImageURL({int invoiceNo, String invoiceType, int lineItem, int projectId, bool isVidaPlus}) async { setState(ViewState.Busy); - await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus); + await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, invoiceType: invoiceType, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/pages/DrawerPages/notifications/notification_details_page.dart b/lib/pages/DrawerPages/notifications/notification_details_page.dart index 65547b39..e32a234c 100644 --- a/lib/pages/DrawerPages/notifications/notification_details_page.dart +++ b/lib/pages/DrawerPages/notifications/notification_details_page.dart @@ -79,6 +79,16 @@ class _NotificationsDetailsPageState extends State { letterSpacing: -0.64, ), ), + SizedBox(height: 18), + Text( + widget.notification.message.trim(), + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xff575757), + letterSpacing: -0.48, + ), + ), if (widget.notification.notificationType == "2") Padding( padding: const EdgeInsets.only(top: 18), @@ -103,15 +113,15 @@ class _NotificationsDetailsPageState extends State { }, fit: BoxFit.fill), ), SizedBox(height: 18), - Text( - widget.notification.message.trim(), - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - color: Color(0xff575757), - letterSpacing: -0.48, - ), - ), + // Text( + // widget.notification.message.trim(), + // style: TextStyle( + // fontSize: 12, + // fontWeight: FontWeight.w600, + // color: Color(0xff575757), + // letterSpacing: -0.48, + // ), + // ), ], ), ); diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index d5bb9035..43254265 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -35,6 +35,7 @@ class _LaboratoryResultPageState extends State { return BaseView( onModelReady: (model) => model.getLaboratoryResult( invoiceNo: widget.patientLabOrders.invoiceNo, + invoiceType: widget.patientLabOrders.invoiceType, clinicID: widget.patientLabOrders.clinicID, projectID: widget.patientLabOrders.projectID, orderNo: widget.patientLabOrders.orderNo, diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 7e609370..55f156cb 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -28,6 +28,7 @@ class RadiologyDetailsPage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getRadImageURL( + invoiceType: finalRadiology.invoiceType, projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo, From eef6f78fd6681c5588ad15334d4b2130f8d84423 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 6 Dec 2023 11:03:59 +0300 Subject: [PATCH 07/19] Updates --- lib/pages/MyAppointments/MyAppointments.dart | 22 +++++++++++++++++++- lib/pages/ToDoList/ToDo.dart | 15 ++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 533bd6e6..31b8f85b 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -5,8 +5,10 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -52,6 +54,8 @@ class _MyAppointmentsState extends State with SingleTickerProvid int _currentPage = 0; + ToDoCountProviderModel toDoProvider; + @override void initState() { filterType = FilterType.Clinic; @@ -72,6 +76,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid @override Widget build(BuildContext context) { + toDoProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).myAppointmentsList, isShowAppBar: true, @@ -168,6 +173,19 @@ class _MyAppointmentsState extends State with SingleTickerProvid print(err); AppToast.showErrorToast(message: err); }); + getToDoCount(); + } + + getToDoCount() { + toDoProvider.setState(0, true, "0"); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); + } else {} + }).catchError((err) { + print(err); + }); } bool isConfirmed(AppoitmentAllHistoryResultList appo) { @@ -379,7 +397,9 @@ class _MyAppointmentsState extends State with SingleTickerProvid date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate), isSortByClinic: _isSortByClinic, rating: _appointmentResult.actualDoctorRate + 0.0, - appointmentTime: _appointmentResult.isLiveCareAppointment ? DateUtil.convertStringToDate(_appointmentResult.appointmentDate).toString().split(" ")[1].substring(0, 5) : _appointmentResult.startTime.substring(0, 5), + appointmentTime: _appointmentResult.isLiveCareAppointment + ? DateUtil.convertStringToDate(_appointmentResult.appointmentDate).toString().split(" ")[1].substring(0, 5) + : _appointmentResult.startTime.substring(0, 5), // appointmentTime: _appointmentResult.startTime.substring(0, 5), remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED) ? _appointmentResult.remaniningHoursTocanPay diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index c4e4bcb9..4253fcd8 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -20,6 +20,7 @@ import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -854,7 +855,19 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { GifLoaderDialogUtils.hideDialog(context); err != null ?? AppToast.showErrorToast(message: err); }); - // getAncillaryOrders(); + getToDoCount(); + } + + getToDoCount() { + toDoProvider.setState(0, true, "0"); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); + } else {} + }).catchError((err) { + print(err); + }); } checkPatientNphiesEligibility(context, AppoitmentAllHistoryResultList appo) { From 80167378d9f3fecd81f9061105731885bdeb4fc2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 6 Dec 2023 15:42:21 +0300 Subject: [PATCH 08/19] lat long fixes --- lib/core/service/client/base_app_client.dart | 13 ++++++++++--- lib/splashPage.dart | 9 ++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 34a0a753..a397a928 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -79,8 +79,11 @@ class BaseAppClient { body['generalid'] = GENERAL_ID; // body['isVidaPlus'] = true; - body['Latitude'] = await AppSharedPreferences().getDouble(USER_LAT); - body['Longitude'] = await AppSharedPreferences().getDouble(USER_LONG); + double lat = await AppSharedPreferences().getDouble(USER_LAT); + double long = await AppSharedPreferences().getDouble(USER_LONG); + + body['Latitude'] = lat == null ? 0.0 : lat; + body['Longitude'] = long == null ? 0.0 : long; if (body.containsKey('isDentalAllowedBackend')) { body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') @@ -90,7 +93,11 @@ class BaseAppClient { : IS_DENTAL_ALLOWED_BACKEND; } - body['DeviceTypeID'] = Platform.isIOS ? 1 : await Utils.isGoogleServicesAvailable() ? 2 : 3; + body['DeviceTypeID'] = Platform.isIOS + ? 1 + : await Utils.isGoogleServicesAvailable() + ? 2 + : 3; if (!body.containsKey('IsPublicRequest')) { // if (!body.containsKey('PatientType')) { diff --git a/lib/splashPage.dart b/lib/splashPage.dart index b8293e0f..290bbac0 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -43,11 +43,6 @@ class _SplashScreenState extends State { }); }, ); - - // AppSharedPreferences().getAll().then((value) { - // debugPrint("ALL SHARED PREFERENCES!!!!!"); - // debugPrint(jsonEncode(value)); - // }); } /// load the Privilege from service @@ -63,6 +58,10 @@ class _SplashScreenState extends State { var themeNotifier = Provider.of(context, listen: false); themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins')); PushNotificationHandler(context).init(); // Asyncronously + AppSharedPreferences().getAll().then((value) { + // debugPrint("ALL SHARED PREFERENCES!!!!!"); + // debugPrint(jsonEncode(value)); + }); } @override From 01db5408c945449152fad23951d232b4f1fa2b44 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 10 Dec 2023 11:48:40 +0300 Subject: [PATCH 09/19] fixes --- lib/config/config.dart | 4 ++-- lib/pages/ToDoList/ToDo.dart | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 4ae8f64d..e604cdfd 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:2018/'; - // var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 4253fcd8..7e647fab 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -52,7 +52,6 @@ class ToDo extends StatefulWidget { List ancillaryLists = []; List obGyneAppoList = []; var languageID; - MyInAppBrowser browser; bool isShowAppBar = true; Function onBackClick; @@ -85,6 +84,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { bool isInsured = false; bool isEligible = false; bool isCash = false; + MyInAppBrowser browser; @override void initState() { @@ -1051,9 +1051,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } openPayment(List paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) { - widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); + browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); - widget.browser.openPaymentBrowser( + browser.openPaymentBrowser( amount, "Appointment check in", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), @@ -1064,7 +1064,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, - widget.browser, + browser, appo.isLiveCareAppointment, "2", appo.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "", @@ -1095,7 +1095,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { // if(selectedPaymentMethod != "TAMARA") { MyInAppBrowser.successURLS.forEach((element) { if (url.contains(element)) { - if (widget.browser.isOpened()) widget.browser.close(); + browser.close(); MyInAppBrowser.isPaymentDone = true; return; } @@ -1105,7 +1105,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { // if(selectedPaymentMethod != "TAMARA") { MyInAppBrowser.errorURLS.forEach((element) { if (url.contains(element)) { - if (widget.browser.isOpened()) widget.browser.close(); + browser.close(); MyInAppBrowser.isPaymentDone = false; return; } From 47779f6fa72c16d4ddb064d1a909157df3b57027 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 14 Dec 2023 10:47:43 +0300 Subject: [PATCH 10/19] last appointment rating fixed --- .../medical/ask_doctor/request_type.dart | 3 ++- .../rate_appointment_doctor.dart | 25 ++++++++++++++----- lib/uitl/push-notification-handler.dart | 8 +++--- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/lib/pages/medical/ask_doctor/request_type.dart b/lib/pages/medical/ask_doctor/request_type.dart index 4c21e826..bb868e7b 100644 --- a/lib/pages/medical/ask_doctor/request_type.dart +++ b/lib/pages/medical/ask_doctor/request_type.dart @@ -27,7 +27,8 @@ class _RequestTypePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getQuestionTypes(), + // onModelReady: (model) => model.getQuestionTypes(), + onModelReady: (model) => model.getCallRequestTypeLOVs(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).requestType, diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 5127dfa6..aa49d15a 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -15,6 +16,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class RateAppointmentDoctor extends StatefulWidget { @@ -30,9 +32,11 @@ class _RateAppointmentDoctorState extends State { final formKey = GlobalKey(); String note = ""; int rating = 0; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, @@ -189,12 +193,21 @@ class _RateAppointmentDoctorState extends State { }); dialog.showAlertDialog(context); } else { - Navigator.pop( - context, - // FadePage( - // page: LandingPage(), - // ), - ); + if(projectViewModel.isLoginChild) { + Navigator.pushReplacement( + context, + FadePage( + page: LandingPage(), + ), + ); + } else { + Navigator.pop( + context, + // FadePage( + // page: LandingPage(), + // ), + ); + } } }, color: CustomColors.accentColor, diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 03e6ec29..c66a8215 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -303,9 +303,11 @@ class PushNotificationHandler { onToken(token); }); - FirebaseMessaging.instance.getAPNSToken().then((value) { - print("Push APNS getToken: " + value); - }); + if(Platform.isIOS) { + FirebaseMessaging.instance.getAPNSToken().then((value) { + print("Push APNS getToken: " + value); + }); + } FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); } From 165f3fb9f6bc2fae740db650ba728fd27ec4731b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Fri, 15 Dec 2023 15:36:21 +0300 Subject: [PATCH 11/19] NFC Check removed for appo checkin --- lib/pages/ToDoList/ToDo.dart | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 7e647fab..30c043e5 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -989,23 +989,23 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { patientShareResponse.projectID = appo.projectID; patientShareResponse.isFollowup = appo.isFollowup; - FlutterNfcKit.nfcAvailability.then((value) { - if (value == NFCAvailability.available) { - PatientShareResponse patientShareResponse = new PatientShareResponse(); - patientShareResponse.doctorNameObj = appo.doctorNameObj; - patientShareResponse.doctorSpeciality = appo.doctorSpeciality; - patientShareResponse.projectName = appo.projectName; - patientShareResponse.appointmentDate = appo.appointmentDate; - patientShareResponse.appointmentNo = appo.appointmentNo; - patientShareResponse.clinicID = appo.clinicID; - patientShareResponse.projectID = appo.projectID; - patientShareResponse.isFollowup = appo.isFollowup; - navigateToQR(context, "", patientShareResponse, appo); - projectViewModel.analytics.todoList.to_do_list_check_in(appo); - } else { - Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported); - } - }); + // FlutterNfcKit.nfcAvailability.then((value) { + // if (value == NFCAvailability.available) { + // PatientShareResponse patientShareResponse = new PatientShareResponse(); + patientShareResponse.doctorNameObj = appo.doctorNameObj; + patientShareResponse.doctorSpeciality = appo.doctorSpeciality; + patientShareResponse.projectName = appo.projectName; + patientShareResponse.appointmentDate = appo.appointmentDate; + patientShareResponse.appointmentNo = appo.appointmentNo; + patientShareResponse.clinicID = appo.clinicID; + patientShareResponse.projectID = appo.projectID; + patientShareResponse.isFollowup = appo.isFollowup; + navigateToQR(context, "", patientShareResponse, appo); + projectViewModel.analytics.todoList.to_do_list_check_in(appo); + // } else { + // Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported); + // } + // }); projectViewModel.analytics.todoList.to_do_list_check_in(appo); DoctorsListService service = new DoctorsListService(); From 264aed70a05f85346a6f986b1f92c5ef5bc11c67 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 17 Dec 2023 13:48:00 +0300 Subject: [PATCH 12/19] NFC Check added --- lib/pages/BookAppointment/QRCode.dart | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 2c2cc83d..3b7e6300 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -62,13 +62,9 @@ class _QRCodeState extends State { // _bytes = base64.decode(widget.appoQR.split(',').last); widget.authUser = new AuthenticatedUser(); - FlutterNfcKit.nfcAvailability.then((value) { - _supportsNFC = (value == NFCAvailability.available); - }); - - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + // WidgetsBinding.instance.addPostFrameCallback((timeStamp) { // startNFCScan(); - }); + // }); super.initState(); } @@ -113,6 +109,9 @@ class _QRCodeState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); _context = context; + FlutterNfcKit.nfcAvailability.then((value) { + _supportsNFC = (value == NFCAvailability.available); + }); List checkInOptionsList = getCheckInOptionsList(context); return AppScaffold( appBarTitle: TranslationBase.of(context).onlineCheckIn, @@ -214,8 +213,10 @@ class _QRCodeState extends State { optionsList.add( InkWell( onTap: () { - if (projectViewModel.havePrivilege(80)) { + if (projectViewModel.havePrivilege(80) && _supportsNFC) { startNFCScan(); + } else { + Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported); } }, child: MedicalProfileItem( From cfd8b5e8a5f9cb57b4e6219583034ffca490e02e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 18 Dec 2023 09:26:40 +0300 Subject: [PATCH 13/19] Language ID Changes --- lib/core/service/client/base_app_client.dart | 10 +++++++++- lib/core/service/privilege_service.dart | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index a397a928..3f1ce94c 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -73,7 +73,15 @@ class BaseAppClient { body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; - body['LanguageID'] = (languageID == 'ar' ? 1 : 2); + + if (body.containsKey('LanguageID')) { + body['LanguageID'] = body['LanguageID']; + } else { + // body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2); + body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; + } + + // body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; body['IPAdress'] = IP_ADDRESS; body['generalid'] = GENERAL_ID; diff --git a/lib/core/service/privilege_service.dart b/lib/core/service/privilege_service.dart index ab0cee97..799764f6 100644 --- a/lib/core/service/privilege_service.dart +++ b/lib/core/service/privilege_service.dart @@ -14,6 +14,7 @@ class PrivilegeService extends BaseService { Future getPrivilege() async { Map body = Map(); body['PatientType'] = 4; + body['LanguageID'] = 1; await baseAppClient.post(GET_PRIVILEGE, onSuccess: (dynamic response, int statusCode) { response['ServicePrivilegeList'].forEach((item) { privilegeModelList.add(PrivilegeModel.fromJson(item)); From bcfeff2661ea7ef58ec9ee39b7b1be861bc641fa Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 18 Dec 2023 09:51:51 +0300 Subject: [PATCH 14/19] updates --- lib/services/authentication/auth_provider.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index d61e8ef7..a629df89 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -155,6 +155,7 @@ class AuthProvider with ChangeNotifier { dynamic localRes; Map request = {}; request['IMEI'] = imei; + request['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; await new BaseAppClient().post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { localRes = SelectDeviceIMEIRES.fromJson(response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); }, onFailure: (String error, int statusCode) { From a9d4cb2fd8c2d8c4796d3c26ff1c9ace0dc8ea97 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 18 Dec 2023 10:47:08 +0300 Subject: [PATCH 15/19] InApp Browser Update --- lib/widgets/in_app_browser/InAppBrowser.dart | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f38ad57c..f3a277fe 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -27,7 +27,12 @@ var _InAppBrowserOptions = InAppBrowserClassOptions( ios: IOSInAppWebViewOptions(applePayAPIEnabled: true, isFraudulentWebsiteWarningEnabled: false)), crossPlatform: InAppBrowserOptions(hideUrlBar: true, toolbarTopBackgroundColor: Colors.black), android: AndroidInAppBrowserOptions(), - ios: IOSInAppBrowserOptions(hideToolbarBottom: true, toolbarBottomBackgroundColor: Colors.white, closeButtonColor: Colors.white, presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN)); + ios: IOSInAppBrowserOptions( + hideToolbarBottom: true, + toolbarBottomBackgroundColor: Colors.white, + closeButtonColor: Colors.white, + closeButtonCaption: "Close", + presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN)); class MyInAppBrowser extends InAppBrowser { _PAYMENT_TYPE paymentType; @@ -176,8 +181,8 @@ class MyInAppBrowser extends InAppBrowser { service.applePayInsertRequest(applePayInsertRequest, context).then((res) { if (context != null) GifLoaderDialogUtils.hideDialog(context); - String url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // Prod - // String url = "https://uat.hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // UAT + // String url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // Prod + String url = "https://uat.hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // UAT // safariBrowser.open(url: Uri.parse(url)); this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(url)), options: _InAppBrowserOptions); }).catchError((err) { From 724a26ca682e90fe6b05186305ad3e4ac280cacd Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 18 Dec 2023 12:29:09 +0300 Subject: [PATCH 16/19] Updates --- lib/config/config.dart | 6 +++--- lib/core/service/client/base_app_client.dart | 8 ++++++-- .../Authentication/check_activation_code_request.dart | 8 ++++---- lib/services/appointment_services/GetDoctorsList.dart | 1 + lib/widgets/in_app_browser/InAppBrowser.dart | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index e604cdfd..b399fa00 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -19,9 +19,9 @@ var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; - // var BASE_URL = 'http://10.50.100.198:2018/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; + // var BASE_URL = 'http://10.20.200.111:1010/'; + // var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 3f1ce94c..8921d5f9 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -75,7 +75,11 @@ class BaseAppClient { body['Channel'] = CHANNEL; if (body.containsKey('LanguageID')) { - body['LanguageID'] = body['LanguageID']; + if(body['LanguageID'] != null) { + body['LanguageID'] = body['LanguageID']; + } else { + body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; + } } else { // body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2); body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; @@ -165,7 +169,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 2941698; //3844083 + // body['PatientID'] = 1231755; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/models/Authentication/check_activation_code_request.dart b/lib/models/Authentication/check_activation_code_request.dart index f6509f3b..7113dd6d 100644 --- a/lib/models/Authentication/check_activation_code_request.dart +++ b/lib/models/Authentication/check_activation_code_request.dart @@ -15,7 +15,7 @@ class CheckActivationCodeReq { bool isSilentLogin; double versionID; int channel; - int languageID; + // int languageID; String iPAdress; String generalid; int patientOutSA; @@ -41,7 +41,7 @@ class CheckActivationCodeReq { this.isSilentLogin, this.versionID, this.channel, - this.languageID, + // this.languageID, this.iPAdress, this.generalid, this.patientOutSA, @@ -68,7 +68,7 @@ class CheckActivationCodeReq { isSilentLogin = json['IsSilentLogin']; versionID = json['VersionID']; channel = json['Channel']; - languageID = json['LanguageID']; + // languageID = json['LanguageID']; iPAdress = json['IPAdress']; generalid = json['generalid']; patientOutSA = json['PatientOutSA']; @@ -96,7 +96,7 @@ class CheckActivationCodeReq { data['IsSilentLogin'] = this.isSilentLogin; data['VersionID'] = this.versionID; data['Channel'] = this.channel; - data['LanguageID'] = this.languageID; + // data['LanguageID'] = this.languageID; data['IPAdress'] = this.iPAdress; data['generalid'] = this.generalid; data['PatientOutSA'] = this.patientOutSA; diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index a7482eaa..224f36f2 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1165,6 +1165,7 @@ class DoctorsListService extends BaseService { "ProjectID": appo.projectID, "SetupID": appo.setupID, "DoctorID": appo.doctorID, + "ClinicID": appo.clinicID, "RequestType": requestType, "RequestTypeID": requestType, "PatientMobileNumber": authUser.mobileNumber, diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f3a277fe..f6b54dac 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -284,7 +284,7 @@ class MyInAppBrowser extends InAppBrowser { Platform.isIOS ? form = form.replaceFirst('DEVICE_TOKEN', await AppSharedPreferences().getString(PUSH_TOKEN) + "," + await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN)) - : form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN)); + : form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN) ?? ""); // form = form.replaceFirst('DEVICE_TOKEN', await AppSharedPreferences().getString(PUSH_TOKEN) + "," + await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN)); // form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN)); From f7dffea2ebf4db277116a3ffe8c67694d5712fe8 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 18 Dec 2023 13:59:52 +0300 Subject: [PATCH 17/19] Language ID fixes --- lib/config/config.dart | 2 +- .../GetAllSharedRecordsByStatusReq.dart | 8 ++++---- lib/pages/MyAppointments/AppointmentDetails.dart | 14 +++++++++----- .../clinic_services/get_clinic_service.dart | 5 +++++ lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index b399fa00..f0dd61b1 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -339,7 +339,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 11.4; +var VERSION_ID = 11.5; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart b/lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart index ac0adc34..5313a7c7 100644 --- a/lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart +++ b/lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart @@ -1,7 +1,7 @@ class GetAllSharedRecordsByStatusReq { double versionID; int channel; - int languageID; + // int languageID; String iPAdress; String generalid; int patientOutSA; @@ -17,7 +17,7 @@ class GetAllSharedRecordsByStatusReq { GetAllSharedRecordsByStatusReq( {this.versionID, this.channel, - this.languageID, + // this.languageID, this.iPAdress, this.generalid, this.patientOutSA, @@ -33,7 +33,7 @@ class GetAllSharedRecordsByStatusReq { GetAllSharedRecordsByStatusReq.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; - languageID = json['LanguageID']; + // languageID = json['LanguageID']; iPAdress = json['IPAdress']; generalid = json['generalid']; patientOutSA = json['PatientOutSA']; @@ -51,7 +51,7 @@ class GetAllSharedRecordsByStatusReq { final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; - data['LanguageID'] = this.languageID; + // data['LanguageID'] = this.languageID; data['IPAdress'] = this.iPAdress; data['generalid'] = this.generalid; data['PatientOutSA'] = this.patientOutSA; diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 2a4c9386..ceee266b 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -592,12 +592,16 @@ class _AppointmentDetailsState extends State with SingleTick RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate); - await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id, params).then((value) { - Result> events = value; - events.data.forEach((element) { - if (element.title.contains(widget.appo.doctorNameObj)) calendarUtils.deleteEvent(calendarUtils.calendars[0], element); + try { + await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id, params).then((value) { + Result> events = value; + events.data.forEach((element) { + if (element.title.contains(widget.appo.doctorNameObj)) calendarUtils.deleteEvent(calendarUtils.calendars[0], element); + }); }); - }); + } catch (ex) { + print(ex); + } } cancelAppointment() { diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index ce9d511f..469ac404 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -36,6 +36,7 @@ class ClinicListService extends BaseService { request = { "IsActiveAppointment": true, + "LanguageID": 1 }; dynamic localRes; @@ -51,6 +52,10 @@ class ClinicListService extends BaseService { Future getProjectsList(context) async { Map request = {}; + request = { + "LanguageID": null + }; + dynamic localRes; await baseAppClient.post(GET_PROJECTS_LIST, onSuccess: (response, statusCode) async { diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f6b54dac..c9fecbf9 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -181,8 +181,8 @@ class MyInAppBrowser extends InAppBrowser { service.applePayInsertRequest(applePayInsertRequest, context).then((res) { if (context != null) GifLoaderDialogUtils.hideDialog(context); - // String url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // Prod - String url = "https://uat.hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // UAT + String url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // Prod + // String url = "https://uat.hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // UAT // safariBrowser.open(url: Uri.parse(url)); this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(url)), options: _InAppBrowserOptions); }).catchError((err) { From 2008ccf92c836681ce82b3fc7a3e75363b79a23b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 19 Dec 2023 10:41:19 +0300 Subject: [PATCH 18/19] updates --- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 02d0d9b7..c3e46b58 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -540,7 +540,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.63; + MARKETING_VERSION = 4.5.75; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -684,7 +684,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.63; + MARKETING_VERSION = 4.5.75; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -722,7 +722,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.63; + MARKETING_VERSION = 4.5.75; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/pubspec.yaml b/pubspec.yaml index 2494a580..2b657883 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.73+1 +version: 4.5.75+1 environment: sdk: ">=2.7.0 <3.0.0" From 512db615befb1dba89a104f2bb56df3518c745ab Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 20 Dec 2023 09:39:52 +0300 Subject: [PATCH 19/19] Language ID fixes & app update to stores, VersionID 11.5 --- .../service/appointment_rate_service.dart | 6 +- .../appointment_rate_view_model.dart | 4 +- .../components/DocAvailableAppointments.dart | 9 +- lib/pages/DrawerPages/family/my-family.dart | 30 ++--- .../widgets/AppointmentActions.dart | 15 ++- lib/pages/landing/landing_page.dart | 6 +- lib/pages/livecare/widgets/clinic_list.dart | 15 ++- lib/pages/login/confirm-login.dart | 1 + lib/pages/login/register-info.dart | 3 +- .../appointment_services/GetDoctorsList.dart | 123 +++++------------- .../authentication/auth_provider.dart | 8 +- .../family_files/family_files_provider.dart | 12 +- .../livecare_services/livecare_provider.dart | 15 ++- .../my_invoice_services.dart | 38 ++---- .../SmartWatchIntegrationService.dart | 2 - lib/widgets/drawer/app_drawer_widget.dart | 12 +- pubspec.yaml | 2 +- 17 files changed, 127 insertions(+), 174 deletions(-) diff --git a/lib/core/service/appointment_rate_service.dart b/lib/core/service/appointment_rate_service.dart index 16355e9a..848aeb48 100644 --- a/lib/core/service/appointment_rate_service.dart +++ b/lib/core/service/appointment_rate_service.dart @@ -8,8 +8,10 @@ class AppointmentRateService extends BaseService { List appointmentRatedList = List(); AppointmentDetails appointmentDetails; - Future getIsLastAppointmentRatedList() async { + Future getIsLastAppointmentRatedList(int languageID) async { hasError = false; + Map bodyData = Map(); + bodyData['LanguageID'] = languageID; await baseAppClient.post(IS_LAST_APPOITMENT_RATED, onSuccess: (dynamic response, int statusCode) { appointmentRatedList.clear(); response['IsLastAppoitmentRatedList'].forEach((appoint) { @@ -18,7 +20,7 @@ class AppointmentRateService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: Map()); + }, body: bodyData); } Future getAppointmentDetails() async { diff --git a/lib/core/viewModels/appointment_rate_view_model.dart b/lib/core/viewModels/appointment_rate_view_model.dart index 9e0d338b..9396c2f5 100644 --- a/lib/core/viewModels/appointment_rate_view_model.dart +++ b/lib/core/viewModels/appointment_rate_view_model.dart @@ -12,10 +12,10 @@ class AppointmentRateViewModel extends BaseViewModel { AppointmentDetails get appointmentDetails => _appointmentRateService.appointmentDetails; - Future getIsLastAppointmentRatedList() async { + Future getIsLastAppointmentRatedList(int languageID) async { isHaveAppointmentNotRate = false; setState(ViewState.Busy); - await _appointmentRateService.getIsLastAppointmentRatedList(); + await _appointmentRateService.getIsLastAppointmentRatedList(languageID); if (_appointmentRateService.hasError) { error = _appointmentRateService.error; setState(ViewState.Error); diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 04f6d1b0..61e697f4 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -376,10 +376,11 @@ class _DocAvailableAppointmentsState extends State wit } getCurrentLanguage() async { - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - setState(() { - this.language = languageID; - }); + this.language = projectViewModel.isArabic ? "ar" : "en"; + // var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + // setState(() { + // this.language = languageID; + // }); } } diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index fa7d4a6a..d88c86e3 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -447,20 +447,20 @@ class _MyFamily extends State with TickerProviderStateMixin { } refreshFamily(context) async { - - await sharedPref.remove(FAMILY_FILE); - await checkUserData(); + await sharedPref.remove(FAMILY_FILE); + await checkUserData(); } switchUser(user, context) { GifLoaderDialogUtils.showMyDialog(context); + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; // this // .familyFileProvider // .silentLoggin(user) // .then((value) => loginAfter(value, context)); // Utils.showProgressDialog(context); - this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, mainUser: user is AuthenticatedUser).then((value) => loginAfter(value, context)).catchError((err) { + this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, languageID, mainUser: user is AuthenticatedUser).then((value) => loginAfter(value, context)).catchError((err) { print("err:$err"); AppToast.showErrorToast(message: err.toString()); Navigator.of(context).pop(); @@ -524,9 +524,8 @@ class _MyFamily extends State with TickerProviderStateMixin { Map request = {}; request["ID"] = ID; request["Status"] = status; - this.familyFileProvider.acceptRejectFamily(request).then((value) async{ - - await refreshFamily(context); + this.familyFileProvider.acceptRejectFamily(request).then((value) async { + await refreshFamily(context); GifLoaderDialogUtils.hideDialog(context); }); } @@ -537,10 +536,8 @@ class _MyFamily extends State with TickerProviderStateMixin { // var data2 = AuthenticatedUser.fromJson(await this.sharedPref.getObject(MAIN_USER)); await getFamilyFiles(); - this.user = data; - setState(() { - - }); + this.user = data; + setState(() {}); } } @@ -557,18 +554,18 @@ class _MyFamily extends State with TickerProviderStateMixin { GifLoaderDialogUtils.showMyDialog(context); try { if (familySharedRecords == null) { - - familySharedRecords = await familyFileProvider.getSharedRecordByStatus(); + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + familySharedRecords = await familyFileProvider.getSharedRecordByStatus(languageID); } - sentRecordsList =[]; + sentRecordsList = []; familySharedRecords.getAllSharedRecordsByStatusList.forEach((element) { if (element.status == 3) { familySharedRecordsList.add(element); } sentRecordsList.add(element); }); - approvedRecordsList =[]; - pendingRecordsList =[]; + approvedRecordsList = []; + pendingRecordsList = []; GetAllSharedRecordsByStatusResponse pendingAndApprovedRecords = await getUserViewRequest(); pendingAndApprovedRecords.getAllSharedRecordsByStatusList.forEach((element) { @@ -580,7 +577,6 @@ class _MyFamily extends State with TickerProviderStateMixin { } }); } catch (ex) { - familySharedRecords = GetAllSharedRecordsByStatusResponse(getAllSharedRecordsByStatusList: []); } GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 76d89f82..b7083b7c 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -467,7 +467,8 @@ class _AppointmentActionsState extends State { askYourDoc() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.isAllowedToAskDoctor(widget.appo.doctorID, context).then((res) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + service.isAllowedToAskDoctor(widget.appo.doctorID, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); print(res['PatientDoctorAppointmentResultList']); if (res['PatientDoctorAppointmentResultList'].length != 0) { @@ -483,9 +484,10 @@ class _AppointmentActionsState extends State { } getCallRequestType() { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getCallRequestType(context).then((res) { + service.getCallRequestType(languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); List requestData = new List(); res['ListReqTypes'].forEach((element) { @@ -528,9 +530,11 @@ class _AppointmentActionsState extends State { } sendAskDocRequest(int requestType) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.sendAskDocCallRequest(widget.appo, requestType.toString(), context).then((res) { + + service.sendAskDocCallRequest(widget.appo, requestType.toString(), languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: "Request Sent Successfully"); @@ -589,7 +593,7 @@ class _AppointmentActionsState extends State { navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) { if (widget.projectViewModel.isLogin) { // if (model.count != 0) { - getPatientAppointmentHistoryWithAppo(); + getPatientAppointmentHistoryWithAppo(); // } else { // AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty); // } @@ -608,7 +612,8 @@ class _AppointmentActionsState extends State { getPatientAppointmentHistoryWithAppo() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getPatientAppointmentHistoryWithAppoNo(widget.appo.appointmentNo).then((res) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + service.getPatientAppointmentHistoryWithAppoNo(widget.appo.appointmentNo, languageID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList.fromJson(res['AppoimentAllHistoryResultList'][0]); diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 47dab9ba..7e56896f 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -298,7 +298,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { WidgetsBinding.instance.addPostFrameCallback((_) { if (projectViewModel.isLogin && !projectViewModel.isLoginChild) { - familyFileProvider.getSharedRecordByStatus(); + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + familyFileProvider.getSharedRecordByStatus(languageID); } }); @@ -655,7 +656,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { } }); if (await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN) == null || !await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN)) { - appointmentRateViewModel.getIsLastAppointmentRatedList().then((value) async { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + appointmentRateViewModel.getIsLastAppointmentRatedList(languageID).then((value) async { if (appointmentRateViewModel.isHaveAppointmentNotRate) { await AppSharedPreferences().setBool(IS_LAST_APPOINTMENT_RATE_SHOWN, true); Navigator.push( diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 361d2381..bbf7a159 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -102,25 +102,25 @@ class _clinic_listState extends State { }); } }); - - getLanguageID(); super.initState(); } @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); + getLanguageID(); return Container( child: currentSelectedLiveCareType == "immediate" ? getLiveCareImmediateClinicList() : getLiveCareScheduleClinicList(), ); } void startLiveCare() { + int languageID = projectViewModel.isArabic ? 1 : 2; bool isError = false; LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); ERAppointmentFeesResponse erAppointmentFeesResponse = new ERAppointmentFeesResponse(); - service.getERAppointmentFees(selectedClinicID, widget.isPharmacyLiveCare, context).then((res) { + service.getERAppointmentFees(selectedClinicID, widget.isPharmacyLiveCare, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['HasAppointment'] == true) { isError = true; @@ -183,9 +183,10 @@ class _clinic_listState extends State { } getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) { + int languageID = projectViewModel.isArabic ? 1 : 2; LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); - service.getERAppointmentTime(selectedClinicID, widget.isPharmacyLiveCare, context).then((res) { + service.getERAppointmentTime(selectedClinicID, widget.isPharmacyLiveCare, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); }).catchError((err) { @@ -504,7 +505,8 @@ class _clinic_listState extends State { } getLanguageID() async { - languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + languageID = projectViewModel.isArabic ? "ar" : "en"; + // languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); } getLiveCareClinicsList() { @@ -757,11 +759,12 @@ class _clinic_listState extends State { } void startScheduleLiveCare() { + int languageID = projectViewModel.isArabic ? 1 : 2; List doctorsList = []; LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); List _patientDoctorAppointmentListHospital = List(); - service.getLiveCareScheduledDoctorList(context, selectedClinicID).then((res) { + service.getLiveCareScheduledDoctorList(context, selectedClinicID, languageID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 12ee9ecb..b99e7c07 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -705,6 +705,7 @@ class _ConfirmLogin extends State { page: LandingPage(), ), (r) => false); + insertIMEI(); } loading(flag) { diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 0f8e031f..e004663e 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -705,7 +705,8 @@ class _RegisterInfo extends State { projectViewModel.isLogin = true; projectViewModel.user = authenticatedUserObject.user; await authenticatedUserObject.getUser(getUser: true); - appointmentRateViewModel.getIsLastAppointmentRatedList().then((value) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + appointmentRateViewModel.getIsLastAppointmentRatedList(languageID).then((value) { getToDoCount(); GifLoaderDialogUtils.hideDialog(AppGlobal.context); if (appointmentRateViewModel.isHaveAppointmentNotRate) { diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 224f36f2..f3b7670c 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -47,10 +47,9 @@ class DoctorsListService extends BaseService { long = await this.sharedPref.getDouble(USER_LONG); } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); // Request req = appGlobal.getPublicRequest(); request = { - // "LanguageID": languageID == 'ar' ? 1 : 2, + // // "IPAdress": "10.20.10.20", // "VersionID": req.VersionID, // "Channel": req.Channel, @@ -105,10 +104,8 @@ class DoctorsListService extends BaseService { long = await this.sharedPref.getDouble(USER_LONG); } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, @@ -144,10 +141,9 @@ class DoctorsListService extends BaseService { Future getDoctorsProfile(int docID, int clinicID, int projectID, context) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, @@ -177,10 +173,9 @@ class DoctorsListService extends BaseService { Future getDoctorsRating(int docID, context) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, @@ -228,10 +223,9 @@ class DoctorsListService extends BaseService { Future getDoctorsRatingDetails(int docID, context) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, @@ -259,7 +253,7 @@ class DoctorsListService extends BaseService { Future getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context, [ProjectViewModel projectViewModel]) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "DoctorID": docID, @@ -271,7 +265,6 @@ class DoctorsListService extends BaseService { "isReschadual": false, "VersionID": req.VersionID, "Channel": 3, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "generalid": "Cs2020@2016\$2958", "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, @@ -302,7 +295,7 @@ class DoctorsListService extends BaseService { Future getDoctorScheduledFreeSlots(int docID, int clinicID, int projectID, int serviceID, BuildContext context) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "DoctorID": docID, @@ -315,7 +308,6 @@ class DoctorsListService extends BaseService { "isReschadual": false, "VersionID": req.VersionID, "Channel": 3, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "generalid": "Cs2020@2016\$2958", "PatientOutSA": authUser.outSA, @@ -343,7 +335,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "IsForLiveCare": false, @@ -367,7 +358,6 @@ class DoctorsListService extends BaseService { "Age": authUser.age != null ? authUser.age : 0, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -407,7 +397,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "IsForLiveCare": true, @@ -430,7 +419,6 @@ class DoctorsListService extends BaseService { "GenderID": authUser.gender, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -460,7 +448,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -470,7 +457,6 @@ class DoctorsListService extends BaseService { "IsActiveAppointment": true, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -519,7 +505,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -530,7 +515,6 @@ class DoctorsListService extends BaseService { "IsForLiveCare": true, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -560,17 +544,9 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); - request = { - "LanguageID": languageID == 'ar' ? 1 : 2, - "ProjectID": 15, - "DeviceTypeID": req.DeviceTypeID, - "PatientID": authUser.patientID, - "PatientTypeID": authUser.patientType, - "PatientType": authUser.patientType - }; + request = {"ProjectID": 15, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType}; dynamic localRes; @@ -590,11 +566,9 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "ProjectID": projectID, "SetupID": setupID, "isDentalAllowedBackend": false, @@ -614,9 +588,9 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientAppointmentHistoryWithAppoNo(int appoNo) async { + Future getPatientAppointmentHistoryWithAppoNo(int appoNo, int languageID) async { Map request; - request = {"IsActiveAppointment": true, "AppointmentNo": appoNo, "IsComingFromCOC": false}; + request = {"IsActiveAppointment": true, "AppointmentNo": appoNo, "IsComingFromCOC": false, "LanguageID": languageID}; dynamic localRes; await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async { localRes = response; @@ -635,14 +609,12 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "IsActiveAppointment": isActiveAppointment, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "SessionID": "YckwoXhUmWBsnHKEKig", @@ -666,14 +638,13 @@ class DoctorsListService extends BaseService { Future getPatientAppointmentCurfewHistory(bool isActiveAppointment) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "IsActiveAppointment": isActiveAppointment, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "SessionID": "YckwoXhUmWBsnHKEKig", @@ -702,7 +673,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -713,7 +683,6 @@ class DoctorsListService extends BaseService { "ConfirmationBy": 102, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "SessionID": "YckwoXhUmWBsnHKEKig", @@ -749,7 +718,6 @@ class DoctorsListService extends BaseService { long = await this.sharedPref.getDouble(USER_LONG); } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -767,7 +735,6 @@ class DoctorsListService extends BaseService { "DeviceType": req.DeviceType, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -798,7 +765,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -815,7 +781,6 @@ class DoctorsListService extends BaseService { "StrAppointmentDate": DateUtil.getDateFormatted(appo.appointmentDate), "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -845,7 +810,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -855,7 +819,6 @@ class DoctorsListService extends BaseService { "IsFollowup": patientShareResponse.isFollowup, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -885,7 +848,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -898,7 +860,6 @@ class DoctorsListService extends BaseService { "To": to, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -926,14 +887,13 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "ClientRequestID": transactionID, "IsPharmacy": isPharma, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -971,7 +931,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "AdvanceNumber": advanceNumber, @@ -980,7 +940,6 @@ class DoctorsListService extends BaseService { "AppointmentID": appointmentID, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1006,7 +965,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "AdvanceNumber": advanceNumber, @@ -1021,7 +980,6 @@ class DoctorsListService extends BaseService { "DeviceType": Platform.isIOS ? "iOS" : "Android", "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1083,13 +1041,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future isAllowedToAskDoctor(int docID, BuildContext context) async { + Future isAllowedToAskDoctor(int docID, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "IsForAskYourDoctor": true, @@ -1097,9 +1055,9 @@ class DoctorsListService extends BaseService { "Top": 25, "beforeDays": 15, "exludType": 4, + "LanguageID": languageID, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1120,18 +1078,17 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getCallRequestType(BuildContext context) async { + Future getCallRequestType(int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1140,6 +1097,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; @@ -1152,13 +1110,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future sendAskDocCallRequest(AppoitmentAllHistoryResultList appo, String requestType, BuildContext context) async { + Future sendAskDocCallRequest(AppoitmentAllHistoryResultList appo, String requestType, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { @@ -1180,7 +1138,6 @@ class DoctorsListService extends BaseService { "EditedOn": DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()).split(" ")[0], "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1189,6 +1146,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; @@ -1207,13 +1165,12 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "AppointmentNo": appoNo, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1240,7 +1197,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "AppointmentNo": appoNo, @@ -1248,7 +1205,6 @@ class DoctorsListService extends BaseService { "ClinicID": clinicID, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1275,7 +1231,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "AppointmentNo": appo.appointmentNo, @@ -1285,7 +1241,6 @@ class DoctorsListService extends BaseService { "VersionID": req.VersionID, "SetupID": appo.setupID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1312,7 +1267,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "AppointmentDate": appoDate, @@ -1325,7 +1280,6 @@ class DoctorsListService extends BaseService { "SetupID": setupId, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1352,7 +1306,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "ProjectID": projectID, @@ -1370,7 +1324,6 @@ class DoctorsListService extends BaseService { }, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1397,7 +1350,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { @@ -1416,7 +1369,7 @@ class DoctorsListService extends BaseService { "PaymentMethod": paymentMethodName, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1442,13 +1395,12 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1483,13 +1435,12 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1527,14 +1478,13 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "MedCategoryID": medCategoryId, "MedGetStsID": medCategoryStsId, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1557,12 +1507,7 @@ class DoctorsListService extends BaseService { Future sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, int checkInBy, BuildContext context) async { Map request; - request = { - "AppointmentNo": appointmentNo, - "NFC_Code": nfcCode, - "ProjectID": projectId, - "CheckinBy": checkInBy - }; + request = {"AppointmentNo": appointmentNo, "NFC_Code": nfcCode, "ProjectID": projectId, "CheckinBy": checkInBy}; dynamic localRes; await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async { localRes = response; @@ -1827,7 +1772,6 @@ class DoctorsListService extends BaseService { Map requestFreeSlots; Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); requestFreeSlots = { "DoctorID": docID, @@ -1839,7 +1783,6 @@ class DoctorsListService extends BaseService { "isReschadual": false, "VersionID": req.VersionID, "Channel": 3, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "generalid": "Cs2020@2016\$2958", "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index a629df89..ff8abbdc 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -248,7 +248,7 @@ class AuthProvider with ChangeNotifier { return Future.value(localRes); } - Future checkActivationCode(request, [value]) async { + Future checkActivationCode(request, [value]) async { var neRequest = CheckActivationCodeReq.fromJson(request); neRequest.activationCode = value ?? "0000"; @@ -377,16 +377,14 @@ class AuthProvider with ChangeNotifier { requestN.patientOutSA = requestN.patientobject.patientOutSA; final DateFormat dateFormat = DateFormat('MM/dd/yyyy'); final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); - if(nhic !=null) { - requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format( - dateFormat.parse(nhic['DateOfBirth'])); + if (nhic != null) { + requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth'])); requestN.isHijri = nhic['IsHijri'] ? 1 : 0; requestN.healthId = requestN.patientobject.eHealthIDField; } requestN.zipCode = requestN.patientOutSA == 1 ? '971' : '966'; - await sharedPref.remove(USER_PROFILE); dynamic localRes; diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index 7a41f6b9..7d07e2e5 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -1,7 +1,9 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart'; import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; @@ -9,6 +11,7 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsBySta import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:flutter/cupertino.dart'; +import 'package:provider/provider.dart'; // SharedPreferences sharedPref = new SharedPreferences(); enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } @@ -36,7 +39,7 @@ class FamilyFilesProvider with ChangeNotifier { dynamic authenticatedUser; GetAllSharedRecordsByStatusResponse allSharedRecordsByStatusResponse; - Future getSharedRecordByStatus() async { + Future getSharedRecordByStatus(int languageID) async { dynamic localRes; try { var request = GetAllSharedRecordsByStatusReq(); @@ -233,7 +236,7 @@ class FamilyFilesProvider with ChangeNotifier { } } - Future silentLoggin(GetAllSharedRecordsByStatusList switchUser, {onSuccess, mainUser}) async { + Future silentLoggin(GetAllSharedRecordsByStatusList switchUser, int languageID, {onSuccess, mainUser}) async { Map request = {}; if (mainUser == true) { var currentUser = AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER)); @@ -251,6 +254,7 @@ class FamilyFilesProvider with ChangeNotifier { request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966"; request['activationCode'] = '0000'; request['isRegister'] = false; + request['LanguageID'] = languageID; } else { var currentUser = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); //const request = new SwitchUserRequest(); @@ -268,6 +272,7 @@ class FamilyFilesProvider with ChangeNotifier { // request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966"; request['activationCode'] = '0000'; request['isRegister'] = false; + request['LanguageID'] = languageID; } try { dynamic localRes; @@ -280,7 +285,8 @@ class FamilyFilesProvider with ChangeNotifier { }, body: request); sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType']); return Future.value(localRes); - } catch (error) { + } + catch (error) { print(error); throw error; } diff --git a/lib/services/livecare_services/livecare_provider.dart b/lib/services/livecare_services/livecare_provider.dart index 2a18c79c..126f5a73 100644 --- a/lib/services/livecare_services/livecare_provider.dart +++ b/lib/services/livecare_services/livecare_provider.dart @@ -57,7 +57,7 @@ class LiveCareService extends BaseService { return Future.value(localRes); } - Future getLiveCareScheduledDoctorList(BuildContext context, int serviceID) async { + Future getLiveCareScheduledDoctorList(BuildContext context, int serviceID, int languageID) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -69,7 +69,8 @@ class LiveCareService extends BaseService { "ServiceID": serviceID, "Age": authUser.age != null ? authUser.age : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0, - "Gender": authUser.gender != null ? authUser.gender : 0 + "Gender": authUser.gender != null ? authUser.gender : 0, + "LanguageID": languageID }; dynamic localRes; @@ -146,7 +147,7 @@ class LiveCareService extends BaseService { return Future.value(localRes); } - Future getERAppointmentFees(int serviceID, bool isPharmaLiveCare, BuildContext context) async { + Future getERAppointmentFees(int serviceID, bool isPharmaLiveCare, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -160,7 +161,8 @@ class LiveCareService extends BaseService { "ProjectID": 12, "PatientID": authUser.patientID != null ? authUser.patientID : 0, "Age": authUser.age != null ? authUser.age : 0, - "Gender": authUser.gender != null ? authUser.gender : 0 + "Gender": authUser.gender != null ? authUser.gender : 0, + "LanguageID": languageID }; dynamic localRes; @@ -173,7 +175,7 @@ class LiveCareService extends BaseService { return Future.value(localRes); } - Future getERAppointmentTime(int serviceID, bool isPharmaLiveCare, BuildContext context) async { + Future getERAppointmentTime(int serviceID, bool isPharmaLiveCare, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -187,7 +189,8 @@ class LiveCareService extends BaseService { "ProjectID": 12, "Age": authUser.age != null ? authUser.age : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0, - "Gender": authUser.gender != null ? authUser.gender : 0 + "Gender": authUser.gender != null ? authUser.gender : 0, + "LanguageID": languageID }; dynamic localRes; diff --git a/lib/services/my_invoice_service/my_invoice_services.dart b/lib/services/my_invoice_service/my_invoice_services.dart index 561f0da1..75807506 100644 --- a/lib/services/my_invoice_service/my_invoice_services.dart +++ b/lib/services/my_invoice_service/my_invoice_services.dart @@ -15,11 +15,9 @@ class MyInvoicesService extends BaseService { Future getAllDentalAppointments(int projectID, context) async { Map request; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, @@ -38,8 +36,7 @@ class MyInvoicesService extends BaseService { dynamic localRes; - await baseAppClient.post(GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -49,11 +46,9 @@ class MyInvoicesService extends BaseService { Future getDentalAppointmentInvoice(int projectID, int appoNo, int invoiceNo, context) async { Map request; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, @@ -74,22 +69,19 @@ class MyInvoicesService extends BaseService { dynamic localRes; - await baseAppClient.post(GET_DENTAL_APPOINTMENT_INVOICE, - onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + await baseAppClient.post(GET_DENTAL_APPOINTMENT_INVOICE, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } Future sendDentalAppointmentInvoiceEmail(int projectID, int appoNo, context) async { Map request; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, @@ -110,13 +102,11 @@ class MyInvoicesService extends BaseService { dynamic localRes; - await baseAppClient.post(SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL, - onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + await baseAppClient.post(SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } - } diff --git a/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart b/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart index 459c0e83..6c316f7f 100644 --- a/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart +++ b/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart @@ -23,11 +23,9 @@ class SmartWatchIntegrationService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index e71a4266..408b0afc 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -650,15 +650,17 @@ class _AppDrawerState extends State { // print(await sharedPref.getObject(FAMILY_FILE)); return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(await sharedPref.getObject(FAMILY_FILE))); } else { - return familyFileProvider.getSharedRecordByStatus(); + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + return familyFileProvider.getSharedRecordByStatus(languageID); } } } switchUser(user, context) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); sharedPref.remove(BLOOD_TYPE); - this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, mainUser: user is AuthenticatedUser).then((value) { + this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, languageID, mainUser: user is AuthenticatedUser).then((value) { // GifLoaderDialogUtils.hideDialog(context); // Navigator.of(context).pop(); loginAfter(value, context, user is AuthenticatedUser); @@ -666,7 +668,7 @@ class _AppDrawerState extends State { }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); - AppToast.showErrorToast(message: err); + AppToast.showErrorToast(message: err.toString()); Navigator.of(context).pop(); }); } @@ -705,8 +707,10 @@ class _AppDrawerState extends State { if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser(); + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + appointmentRateViewModel - .getIsLastAppointmentRatedList() + .getIsLastAppointmentRatedList(languageID) .then((value) => { getToDoCount(), //Utils.hideProgressDialog(), diff --git a/pubspec.yaml b/pubspec.yaml index 2b657883..4e49ef9d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.75+1 +version: 4.5.035+4050035 environment: sdk: ">=2.7.0 <3.0.0"