From aa04e943efb13160898a1206f6ad31fc84cba4c8 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 31 Dec 2023 17:03:08 +0300 Subject: [PATCH] updates & fixes --- lib/config/config.dart | 2 +- .../service/appointment_rate_service.dart | 3 +- lib/core/service/client/base_app_client.dart | 4 +- .../appointment_rate_view_model.dart | 4 +- lib/pages/BookAppointment/QRCode.dart | 36 ++++----- lib/pages/MyAppointments/MyAppointments.dart | 5 +- lib/pages/MyAppointments/VisitTicket.dart | 7 +- .../widgets/AppointmentActions.dart | 6 +- lib/pages/ToDoList/ToDo.dart | 3 +- lib/pages/feedback/send_feedback_page.dart | 7 +- lib/pages/landing/landing_page.dart | 32 ++++---- lib/pages/livecare/widgets/clinic_card.dart | 4 +- lib/pages/livecare/widgets/clinic_list.dart | 2 +- lib/pages/login/confirm-login.dart | 56 ++++++++++---- lib/pages/login/login.dart | 75 +++++++++---------- .../rate_appointment_clinic.dart | 37 +++++---- .../rate_appointment_doctor.dart | 36 +++++---- .../appointment_services/GetDoctorsList.dart | 11 ++- .../livecare_services/livecare_provider.dart | 13 +++- lib/widgets/drawer/app_drawer_widget.dart | 1 + 20 files changed, 207 insertions(+), 137 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 6666141f..e7635e5b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -342,7 +342,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.6; +var VERSION_ID = 11.7; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/core/service/appointment_rate_service.dart b/lib/core/service/appointment_rate_service.dart index 848aeb48..446b5d6b 100644 --- a/lib/core/service/appointment_rate_service.dart +++ b/lib/core/service/appointment_rate_service.dart @@ -36,7 +36,7 @@ class AppointmentRateService extends BaseService { }, body: bodyData); } - Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async { + Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, int languageID) async { hasError = false; AppointmentRate appointmentRate = AppointmentRate(); appointmentRate.rate = rate; @@ -47,6 +47,7 @@ class AppointmentRateService extends BaseService { appointmentRate.note = note; appointmentRate.createdBy = 2; appointmentRate.editedBy = 2; + appointmentRate.languageID = languageID; await baseAppClient.post(NEW_RATE_APPOINTMENT_URL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 54235646..26bacebe 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -77,7 +77,7 @@ class BaseAppClient { if (body.containsKey('LanguageID')) { if(body['LanguageID'] != null) { //change this line because language issue happened on dental - body['LanguageID'] = body['LanguageID'] =='ar' ? "1" : body['LanguageID'] =='en' ? '2' : body['LanguageID']; + body['LanguageID'] = body['LanguageID'] =='ar' ? 1 : body['LanguageID'] =='en' ? 2 : body['LanguageID']; } else { body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; } @@ -170,7 +170,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 1231755; //3844083 + // body['PatientID'] = 1014144; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/core/viewModels/appointment_rate_view_model.dart b/lib/core/viewModels/appointment_rate_view_model.dart index 9396c2f5..1817c23d 100644 --- a/lib/core/viewModels/appointment_rate_view_model.dart +++ b/lib/core/viewModels/appointment_rate_view_model.dart @@ -35,9 +35,9 @@ class AppointmentRateViewModel extends BaseViewModel { } } - Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async { + Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, int languageID) async { setState(ViewState.Busy); - await _appointmentRateService.sendAppointmentRate(rate, appointmentNo, projectID, doctorID, clinicID, note); + await _appointmentRateService.sendAppointmentRate(rate, appointmentNo, projectID, doctorID, clinicID, note, languageID); if (_appointmentRateService.hasError) { error = _appointmentRateService.error; setState(ViewState.ErrorLocal); diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 3b7e6300..90e39767 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; @@ -63,7 +64,7 @@ class _QRCodeState extends State { widget.authUser = new AuthenticatedUser(); // WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - // startNFCScan(); + // startNFCScan(); // }); super.initState(); @@ -213,19 +214,17 @@ class _QRCodeState extends State { optionsList.add( InkWell( onTap: () { - if (projectViewModel.havePrivilege(80) && _supportsNFC) { - startNFCScan(); - } else { - Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported); + if (projectViewModel.havePrivilege(102)) { + startLocationCheckIn(); } }, child: MedicalProfileItem( - title: TranslationBase.of(context).scanNFC, - imagePath: 'contactless.svg', + title: TranslationBase.of(context).checkInViaLocation, + imagePath: 'location.svg', subTitle: "", - isEnable: projectViewModel.havePrivilege(80), - width: 80.0, - height: 80.0, + isEnable: projectViewModel.havePrivilege(102), + width: 70.0, + height: 70.0, ), ), ); @@ -251,17 +250,19 @@ class _QRCodeState extends State { optionsList.add( InkWell( onTap: () { - if (projectViewModel.havePrivilege(102)) { - startLocationCheckIn(); + if (projectViewModel.havePrivilege(80) && _supportsNFC) { + startNFCScan(); + } else { + Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported); } }, child: MedicalProfileItem( - title: TranslationBase.of(context).checkInViaLocation, - imagePath: 'location.svg', + title: TranslationBase.of(context).scanNFC, + imagePath: 'contactless.svg', subTitle: "", - isEnable: projectViewModel.havePrivilege(102), - width: 70.0, - height: 70.0, + isEnable: projectViewModel.havePrivilege(80), + width: 80.0, + height: 80.0, ), ), ); @@ -378,6 +379,7 @@ class _QRCodeState extends State { child: const Text('OK'), onPressed: () { Navigator.of(context).pop(); + Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route r) => false); }, ), ], diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 31b8f85b..a53b231f 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -55,6 +55,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid int _currentPage = 0; ToDoCountProviderModel toDoProvider; + ProjectViewModel projectViewModel; @override void initState() { @@ -76,6 +77,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); toDoProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).myAppointmentsList, @@ -135,6 +137,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid } getPatientAppointmentHistory() { + int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); widget.appoList.clear(); @@ -150,7 +153,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid widget._patientConfirmedAppointmentListClinic.clear(); widget._patientArrivedAppointmentListClinic.clear(); - service.getPatientAppointmentHistory(false, context).then((res) { + service.getPatientAppointmentHistory(false, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); setState(() { if (res['MessageStatus'] == 1) { diff --git a/lib/pages/MyAppointments/VisitTicket.dart b/lib/pages/MyAppointments/VisitTicket.dart index c2f5c6ed..a1b44b7a 100644 --- a/lib/pages/MyAppointments/VisitTicket.dart +++ b/lib/pages/MyAppointments/VisitTicket.dart @@ -1,3 +1,4 @@ +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/services/appointment_services/GetDoctorsList.dart'; @@ -7,6 +8,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class VisitTicket extends StatefulWidget { List appoList = []; @@ -17,6 +19,7 @@ class VisitTicket extends StatefulWidget { class _VisitTicketState extends State { bool isLoading = false; + ProjectViewModel projectViewModel; @override void initState() { @@ -26,6 +29,7 @@ class _VisitTicketState extends State { @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).todoList, body: isLoading == false @@ -48,9 +52,10 @@ class _VisitTicketState extends State { } getPatientAppointmentCurfewHistory(BuildContext context) { + int languageID = projectViewModel.isArabic ? 1 : 2; DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.getPatientAppointmentHistory(true, context).then((res) { + service.getPatientAppointmentHistory(true, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index b7083b7c..86a80be2 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -365,10 +365,11 @@ class _AppointmentActionsState extends State { // } openAppointmentLabResults() { + int languageID = widget.projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); PatientLabOrders patientLabOrders = new PatientLabOrders(); - service.getPatientLabOrdersByAppoNo(widget.appo.appointmentNo, widget.appo.projectID, widget.appo.clinicID, context).then((res) { + service.getPatientLabOrdersByAppoNo(widget.appo.appointmentNo, widget.appo.projectID, widget.appo.clinicID, languageID, context).then((res) { print(res['ListLabResultsByAppNo']); GifLoaderDialogUtils.hideDialog(context); if (res['ListLabResultsByAppNo'] != null) { @@ -400,10 +401,11 @@ class _AppointmentActionsState extends State { } openAppointmentRadiology() { + int languageID = widget.projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); FinalRadiology finalRadiology = new FinalRadiology(); - service.getPatientRadOrders(widget.appo.appointmentNo.toString(), context).then((res) { + service.getPatientRadOrders(widget.appo.appointmentNo.toString(), languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['FinalRadiologyList'] != null) { print(res['FinalRadiologyList']); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 30c043e5..9a2d73bc 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -823,9 +823,10 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } getPatientAppointmentHistory() { + int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getPatientAppointmentHistory(true, context).then((res) { + service.getPatientAppointmentHistory(true, languageID, context).then((res) { widget.appoList.clear(); GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 06e9560b..cc24d511 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -56,6 +56,8 @@ class _SendFeedbackPageState extends State { List appoList = []; + ProjectViewModel projectViewModel; + String getSelected(BuildContext context) { switch (messageType) { case MessageType.ComplaintOnAnAppointment: @@ -106,7 +108,7 @@ class _SendFeedbackPageState extends State { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return BaseView( allowAny: true, builder: (_, model, widget) => AppScaffold( @@ -466,6 +468,7 @@ class _SendFeedbackPageState extends State { listData: list, selectedIndex: selectedStatusIndex, onValueSelected: (index) { + int languageID = projectViewModel.isArabic ? 1 : 2; selectedStatusIndex = index; if (index == 1) { @@ -485,7 +488,7 @@ class _SendFeedbackPageState extends State { if (messageType == MessageType.ComplaintOnAnAppointment) { appoList.clear(); GifLoaderDialogUtils.showMyDialog(context); - service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) { + service.getPatientAppointmentHistory(false, languageID, context, isForCOC: true).then((res) { GifLoaderDialogUtils.hideDialog(context); setState(() { if (res['MessageStatus'] == 1) { diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 7e56896f..1cebe35d 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -655,22 +655,22 @@ class _LandingPageState extends State with WidgetsBindingObserver { FlutterAppIconBadge.updateBadge(num.parse(notificationCount)); } }); - if (await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN) == null || !await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN)) { - 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( - context, - FadePage( - page: RateAppointmentDoctor(), - ), - ); - } - }).catchError((err) { - print(err); - }); - } + // if (await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN) == null || !await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN)) { + // 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( + // context, + // FadePage( + // page: RateAppointmentDoctor(), + // ), + // ); + // } + // }).catchError((err) { + // print(err); + // }); + // } }); } projectViewModel.analytics.setUser(data); diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart index d6fb745a..e79037fe 100644 --- a/lib/pages/livecare/widgets/clinic_card.dart +++ b/lib/pages/livecare/widgets/clinic_card.dart @@ -163,10 +163,10 @@ class _State extends State { } getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) { - + int languageID = widget.languageID == 'ar' ? 1 : 2; LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); - service.getLivecareClinicTiming(patientERGetClinicsList.serviceID, context).then((res) { + service.getLivecareClinicTiming(patientERGetClinicsList.serviceID, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index bbf7a159..437e93c9 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -513,7 +513,7 @@ class _clinic_listState extends State { isDataLoaded = false; LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); - service.getLivecareClinics(context).then((res) { + service.getLivecareClinics(languageID == 'ar' ? 1: 2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); print(res['PatientER_GetClinicsList'].length); if (res['MessageStatus'] == 1) { diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index b99e7c07..d4c8b17f 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -663,11 +663,11 @@ class _ConfirmLogin extends State { } checkIfUserAgreedBefore(CheckActivationCode result) { - if (result.isNeedUserAgreement == true) { - //move to agreement page. - } else { - goToHome(); - } + // if (result.isNeedUserAgreement == true) { + //move to agreement page. + // } else { + goToHome(); + // } } insertIMEI() { @@ -695,17 +695,45 @@ class _ConfirmLogin extends State { projectViewModel.user = authenticatedUserObject.user; await authenticatedUserObject.getUser(getUser: true); - GifLoaderDialogUtils.hideDialog(context); - + // GifLoaderDialogUtils.hideDialog(context); getToDoCount(); + appointmentRateViewModel + .getIsLastAppointmentRatedList(projectViewModel.isArabic ? 1 : 2) + .then((value) => { + 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); + }); - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: LandingPage(), - ), - (r) => false); - insertIMEI(); + // getToDoCount(); + + // Navigator.pushAndRemoveUntil( + // context, + // FadePage( + // page: LandingPage(), + // ), + // (r) => false); + // insertIMEI(); } loading(flag) { diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 107db2c3..69ff8dbb 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -345,45 +345,44 @@ class _Login extends State { authenticatedUserObject.user = result.list; projectViewModel.user = authenticatedUserObject.user; - GifLoaderDialogUtils.hideDialog(context); - + // GifLoaderDialogUtils.hideDialog(context); + // + // getToDoCount(); + // + // Navigator.pushAndRemoveUntil( + // context, + // FadePage( + // page: LandingPage(), + // ), + // (r) => false); 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); - // }); + appointmentRateViewModel + .getIsLastAppointmentRatedList(projectViewModel.isArabic ? 1 : 2) + .then((value) => { + 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 09b083cc..eabe9528 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -32,10 +32,11 @@ class _RateAppointmentClinicState extends State { final formKey = GlobalKey(); String note = ""; int rating = 0; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, @@ -191,18 +192,27 @@ class _RateAppointmentClinicState extends State { child: DefaultButton( TranslationBase.of(context).later, () { - // Navigator.pushReplacement( - // context, - // FadePage( - // page: LandingPage(), - // ), - // ); - Navigator.pop( - context, - ); - Navigator.pop( + Navigator.pushReplacement( context, + FadePage( + page: LandingPage(), + ), ); + // if (projectViewModel.isLoginChild) { + // Navigator.pushReplacement( + // context, + // FadePage( + // page: LandingPage(), + // ), + // ); + // } else { + // Navigator.pop( + // context, + // // FadePage( + // // page: LandingPage(), + // // ), + // ); + // } }, color: CustomColors.accentColor, textColor: Colors.white, @@ -215,9 +225,10 @@ class _RateAppointmentClinicState extends State { rating <= 0 ? null : () { + int languageID = projectViewModel.isArabic ? 1 : 2; model - .sendAppointmentRate( - rating, widget.appointmentDetails.appointmentNo, widget.appointmentDetails.projectID, widget.appointmentDetails.doctorID, widget.appointmentDetails.clinicID, note) + .sendAppointmentRate(rating, widget.appointmentDetails.appointmentNo, widget.appointmentDetails.projectID, widget.appointmentDetails.doctorID, + widget.appointmentDetails.clinicID, note, languageID) .then( (value) => { model diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index aa49d15a..6aa627f8 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -193,21 +193,27 @@ class _RateAppointmentDoctorState extends State { }); dialog.showAlertDialog(context); } else { - if(projectViewModel.isLoginChild) { - Navigator.pushReplacement( - context, - FadePage( - page: LandingPage(), - ), - ); - } else { - Navigator.pop( - context, - // FadePage( - // page: LandingPage(), - // ), - ); - } + Navigator.pushReplacement( + 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/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 94766e3c..910c2680 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -604,7 +604,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context, {bool isForCOC = false}) async { + Future getPatientAppointmentHistory(bool isActiveAppointment, int languageID, BuildContext context, {bool isForCOC = false}) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -626,7 +626,8 @@ class DoctorsListService extends BaseService { "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, "IsComingFromCOC": isForCOC, - "PatientType": authUser.patientType + "PatientType": authUser.patientType, + "LanguageID": languageID }; dynamic localRes; @@ -1162,7 +1163,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientRadOrders(String appoNo, BuildContext context) async { + Future getPatientRadOrders(String appoNo, 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)); @@ -1182,6 +1183,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; @@ -1194,7 +1196,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, dynamic clinicID, BuildContext context) async { + Future getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, dynamic clinicID, 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)); @@ -1216,6 +1218,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; diff --git a/lib/services/livecare_services/livecare_provider.dart b/lib/services/livecare_services/livecare_provider.dart index 126f5a73..b0262ea5 100644 --- a/lib/services/livecare_services/livecare_provider.dart +++ b/lib/services/livecare_services/livecare_provider.dart @@ -17,7 +17,7 @@ class LiveCareService extends BaseService { AuthenticatedUser authUser = new AuthenticatedUser(); AuthProvider authProvider = new AuthProvider(); - Future getLivecareClinics(BuildContext context) async { + Future getLivecareClinics(int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -25,7 +25,12 @@ class LiveCareService extends BaseService { authUser = data; } - request = {"Age": authUser.age != null ? authUser.age : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0, "Gender": authUser.gender != null ? authUser.gender : 0}; + request = { + "Age": authUser.age != null ? authUser.age : 0, + "PatientID": authUser.patientID != null ? authUser.patientID : 0, + "Gender": authUser.gender != null ? authUser.gender : 0, + "LanguageID": languageID + }; dynamic localRes; @@ -122,7 +127,7 @@ class LiveCareService extends BaseService { return Future.value(localRes); } - Future getLivecareClinicTiming(int serviceID, BuildContext context) async { + Future getLivecareClinicTiming(int serviceID, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -132,6 +137,7 @@ class LiveCareService extends BaseService { request = { "ServiceID": serviceID, + "LanguageID": languageID, "Age": authUser.age != null ? authUser.age : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0, "Gender": authUser.gender != null ? authUser.gender : 0 @@ -354,5 +360,4 @@ class LiveCareService extends BaseService { }, body: request); return Future.value(localRes); } - } diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 408b0afc..28ff1833 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -42,6 +42,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; + // import 'package:flutter_amazonpaymentservices/environment_type.dart'; // import 'package:flutter_amazonpaymentservices/flutter_amazonpaymentservices.dart';