diff --git a/lib/config/config.dart b/lib/config/config.dart index 61fd3d74..7f95a826 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,6 +20,10 @@ 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 = 'http://10.50.100.198:4422/'; +//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/'; @@ -339,7 +343,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 cdab0def..0f14a038 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 a1d6000f..aca16728 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -81,8 +81,10 @@ class BaseAppClient { body['Channel'] = CHANNEL; if (body.containsKey('LanguageID')) { - if (body['LanguageID'] != null) { - body['LanguageID'] = body['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']; } else { body['LanguageID'] = Provider.of(AppGlobal.context, listen: false) @@ -186,7 +188,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/service/hospital_service.dart b/lib/core/service/hospital_service.dart index 270a1e15..e71e6116 100644 --- a/lib/core/service/hospital_service.dart +++ b/lib/core/service/hospital_service.dart @@ -50,13 +50,14 @@ class HospitalService extends BaseService { } } - Future getHospitals({bool isResBasedOnLoc = true, bool isAdvancePayment = false}) async { + Future getHospitals(int languageID, {bool isResBasedOnLoc = true, bool isAdvancePayment = false}) async { if (isResBasedOnLoc) await _getCurrentLocation(); Map body = Map(); body['Latitude'] = await this.sharedPref.getDouble(USER_LAT); body['Longitude'] = await this.sharedPref.getDouble(USER_LONG); body['IsOnlineCheckIn'] = isResBasedOnLoc; body['IsAdvancePayment'] = isAdvancePayment; + body['LanguageID'] = languageID; await baseAppClient.post(GET_PROJECT, onSuccess: (dynamic response, int statusCode) { _hospitals.clear(); diff --git a/lib/core/viewModels/appointment_rate_view_model.dart b/lib/core/viewModels/appointment_rate_view_model.dart index 5b52843d..b3cb666c 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/core/viewModels/er/EdOnlineViewModel.dart b/lib/core/viewModels/er/EdOnlineViewModel.dart index 10d4e932..015d97f4 100644 --- a/lib/core/viewModels/er/EdOnlineViewModel.dart +++ b/lib/core/viewModels/er/EdOnlineViewModel.dart @@ -19,15 +19,15 @@ class EdOnlineViewModel extends BaseViewModel { ErPatientShareModel? get erPatientShareModel => _edOnlineServices.erPatientShareModel; - Future getHospitals() async { - if (_hospitalService.hospitals.isEmpty) { - setState(ViewState.Busy); - await _hospitalService.getHospitals(); - if (_hospitalService.hasError) { - error = _hospitalService.error!; - setState(ViewState.Error); - } else - setState(ViewState.Idle); + Future getHospitals(int languageID) async { + if(_hospitalService.hospitals.isEmpty){ + setState(ViewState.Busy); + await _hospitalService.getHospitals(languageID); + if (_hospitalService.hasError) { + error = _hospitalService.error!; + setState(ViewState.Error); + } else + setState(ViewState.Idle); } } @@ -36,7 +36,7 @@ class EdOnlineViewModel extends BaseViewModel { setState(ViewState.Busy); await _edOnlineServices.getQuestions(); if (_edOnlineServices.hasError) { - error = _edOnlineServices.error!; + error = _edOnlineServices!.error!; setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/core/viewModels/er/am_request_view_model.dart b/lib/core/viewModels/er/am_request_view_model.dart index eeaab422..9d8e8705 100644 --- a/lib/core/viewModels/er/am_request_view_model.dart +++ b/lib/core/viewModels/er/am_request_view_model.dart @@ -46,19 +46,19 @@ class AmRequestViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getAmRequestOrders() async { + Future getAmRequestOrders(int languageID) async { setState(ViewState.Busy); await _amService.getAllTransportationOrders(); if (_amService.hasError) { error = _amService.error!; setState(ViewState.Error); } else - getHospitals(); + getHospitals(languageID); } - Future getHospitals() async { + Future getHospitals(int languageID) async { setState(ViewState.Busy); - await _hospitalService.getHospitals(isResBasedOnLoc: false); + await _hospitalService.getHospitals(languageID, isResBasedOnLoc: false); if (_hospitalService.hasError) { error = _hospitalService.error!; setState(ViewState.Error); diff --git a/lib/core/viewModels/hospital_view_model.dart b/lib/core/viewModels/hospital_view_model.dart index 74abe795..61957bbd 100644 --- a/lib/core/viewModels/hospital_view_model.dart +++ b/lib/core/viewModels/hospital_view_model.dart @@ -10,9 +10,9 @@ class HospitalViewModel extends BaseViewModel { List get hospitals => _hospitalService.hospitals; - Future getHospitals() async { + Future getHospitals(int languageID) async { setState(ViewState.Busy); - await _hospitalService.getHospitals(); + await _hospitalService.getHospitals(languageID); if (_hospitalService.hasError) { error = _hospitalService.error!; setState(ViewState.Error); diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index 2cc61db7..24e01d18 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -70,9 +70,9 @@ class MyBalanceViewModel extends BaseViewModel { } } - Future getHospitals({bool isAdvancePayment = false}) async { + Future getHospitals(int languageID, {bool isAdvancePayment = false}) async { setState(ViewState.Busy); - await _hospitalService.getHospitals(isAdvancePayment: isAdvancePayment); + await _hospitalService.getHospitals(languageID, isAdvancePayment: isAdvancePayment); if (_hospitalService.hasError) { error = _hospitalService.error!; setState(ViewState.Error); diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart index 98b01d2a..e4a060b5 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart @@ -44,6 +44,7 @@ class _NewCMCStepThreePageState extends State { HospitalsModel? selectedHospital; final GlobalKey projectDropdownKey = GlobalKey(); bool isLocationSelected = false; + ProjectViewModel projectViewModel; static CameraPosition _kGooglePlex = CameraPosition( target: LatLng(37.42796133580664, -122.085749655962), @@ -80,7 +81,7 @@ class _NewCMCStepThreePageState extends State { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return AppScaffold( isShowAppBar: true, description: TranslationBase.of(context).infoCMC, @@ -402,10 +403,11 @@ class _NewCMCStepThreePageState extends State { } getProjectsList() { + int languageID = projectViewModel.isArabic ? 1 : 2; ClinicListService service = new ClinicListService(); GifLoaderDialogUtils.showMyDialog(context); List projectsListLocal = []; - service.getProjectsList(context).then((res) { + service.getProjectsList(languageID, context).then((res) { if (res['MessageStatus'] == 1) { setState(() { res['ListProject'].forEach((v) { diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart index 9d08ec32..ec2a54d8 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart'; @@ -22,6 +23,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import '../dialogs/select_city_dialog.dart'; @@ -436,9 +438,10 @@ class _NewEReferralStepThreePageState extends State { } void getAllProjects() { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; ClinicListService service = new ClinicListService(); List projectsListLocal = []; - service.getProjectsList(context).then((res) { + service.getProjectsList(languageID, context).then((res) { if (res['MessageStatus'] == 1) { setState(() { res['ListProject'].forEach((v) { diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart index a402d6c7..8ac5be9b 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart @@ -66,7 +66,7 @@ class _BariatricsPageState extends State { title: Texts("${item.diseases}"), activeColor: Colors.blue.shade700, value: item.diseasesID, - groupValue: _selectedDisease != null ? _selectedDisease!.diseasesID : -1, + groupValue: _selectedDisease != null ? _selectedDisease!.diseasesID! : -1, selected: _selectedDisease != null ? item.diseasesID == _selectedDisease!.diseasesID : false, onChanged: (val) { setState(() { @@ -114,7 +114,7 @@ class _BariatricsPageState extends State { margin: EdgeInsets.only(bottom: 16.0, left: 16, right: 16), child: BorderedButton( TranslationBase.of(context).skip, - fontSize: SizeConfig.textMultiplier! * 2.1, + fontSize: SizeConfig!.textMultiplier! * 2.1, textColor: Colors.blue, vPadding: 8, hPadding: 8, @@ -139,6 +139,7 @@ class _BariatricsPageState extends State { } callDoctorsSearchAPI() { + int languageID = projectProvider.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; List arr = []; @@ -148,7 +149,7 @@ class _BariatricsPageState extends State { List _patientDoctorAppointmentListHospital =[]; DoctorsListService service = new DoctorsListService(); - service.getDoctorsList(108, 0, false, context).then((res) { + service.getDoctorsList(108, 0, false, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart index 0c3c399b..fb6e3081 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart @@ -1,8 +1,8 @@ import 'dart:collection'; import 'package:auto_size_text/auto_size_text.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; @@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:provider/provider.dart'; class ResultPage extends StatefulWidget { final double finalResult; @@ -137,6 +138,7 @@ class _ResultPageState extends State { } callDoctorsSearchAPI() { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; List arr = []; @@ -146,7 +148,7 @@ class _ResultPageState extends State { List _patientDoctorAppointmentListHospital =[]; DoctorsListService service = new DoctorsListService(); - service.getDoctorsList(108, 0, false, context).then((res) { + service.getDoctorsList(108, 0, false, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 7e89024b..a0c47aa9 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -137,7 +137,7 @@ class _DentalComplaintsState extends State { checkIfHasDentalPlan() { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.checkIfHasDentalPlan(widget.searchInfo.ProjectID!, context).then((res) { + service.checkIfHasDentalPlan(widget.searchInfo!.ProjectID!, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['List_IsPatientHasOnGoingEstimation'].length != 0) { @@ -183,7 +183,7 @@ class _DentalComplaintsState extends State { tableRow.add(TableRow(children: [ Container( margin: EdgeInsets.all(12.0), - child: Text(procedure.procedureName!, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46)), + child: Text(procedure!.procedureName!, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, letterSpacing: -0.46)), ), Container( margin: EdgeInsets.all(12.0), @@ -209,17 +209,18 @@ class _DentalComplaintsState extends State { } continueDentalPlan() { + int languageID = projectViewModel.isArabic ? 1 : 2; DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); int appoTime = 0; - service.getDoctorsList(int.parse("17"), widget.searchInfo.ProjectID!, false, context, isContinueDentalPlan: true).then((res) { + service.getDoctorsList(int.parse("17"), widget.searchInfo!.ProjectID, false, languageID, context, isContinueDentalPlan: true).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { dentalProceduresModel = DentalProceduresModel.fromJson(res as Map); //Changed by Aamir added Map into string dynamic dentalProceduresModel.listIsPatientHasOnGoingEstimation!.forEach((procedure) { - appoTime += procedure.neededTime!; + appoTime += procedure!.neededTime!; }); setState(() { hasDentalPlan = true; @@ -257,10 +258,11 @@ class _DentalComplaintsState extends State { } getChiefComplaintsList() { + int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); getLanguageID(); ClinicListService service = new ClinicListService(); - service.getChiefComplaintsList(widget.searchInfo.ClinicID!, widget.searchInfo.ProjectID!, context).then((res) { + service.getChiefComplaintsList(widget.searchInfo!.ClinicID!, widget.searchInfo!.ProjectID!, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 65ab728e..44f3bf6e 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(); @@ -242,19 +243,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, ), ), ); @@ -280,17 +279,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, ), ), ); @@ -415,6 +416,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/BookAppointment/components/LaserClinic.dart b/lib/pages/BookAppointment/components/LaserClinic.dart index ae4b7b91..b3aeb69c 100644 --- a/lib/pages/BookAppointment/components/LaserClinic.dart +++ b/lib/pages/BookAppointment/components/LaserClinic.dart @@ -204,6 +204,7 @@ class _LaserClinicState extends State with SingleTickerProviderStat } callDoctorsSearchAPI() { + int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; List arr = []; @@ -214,7 +215,7 @@ class _LaserClinicState extends State with SingleTickerProviderStat DoctorsListService service = new DoctorsListService(); projectViewModel.selectedBodyPartList = _selectedBodyPartList; - service.getDoctorsList(253, 0, false, context).then((res) { + service.getDoctorsList(253, 0, false, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index b69a746a..8896b19f 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -527,10 +527,11 @@ class _SearchByClinicState extends State { } getProjectsList() { + int languageID = projectViewModel.isArabic ? 1 : 2; ClinicListService service = new ClinicListService(); List projectsListLocal = []; service - .getProjectsList(context) + .getProjectsList(languageID, context) .then((res) { if (res['MessageStatus'] == 1) { setState(() { @@ -600,6 +601,7 @@ class _SearchByClinicState extends State { } callDoctorsSearchAPI(int clinicID) { + int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; List arr = []; @@ -609,7 +611,7 @@ class _SearchByClinicState extends State { List _patientDoctorAppointmentListHospital = []; DoctorsListService service = new DoctorsListService(); - service.getDoctorsList(clinicID, projectDropdownValue != "" ? int.parse(projectDropdownValue!) : 0, nearestAppo, context).then((res) { + service.getDoctorsList(clinicID, projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, nearestAppo, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 5c0cc81d..be4c8c81 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -90,13 +90,14 @@ class _SearchByDoctorState extends State { } getDoctorsList(BuildContext context) { + int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; DoctorsListService service = new DoctorsListService(); List _patientDoctorAppointmentListHospital =[]; - service.getDoctorsListByName(doctorNameController.text, context).then((res) { + service.getDoctorsListByName(doctorNameController.text, languageID, context).then((res) { // GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart index dbcdb5f7..0ce8c602 100644 --- a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart +++ b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; @@ -6,6 +7,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; // ignore: must_be_immutable class DentalComplaintCard extends StatefulWidget { @@ -43,7 +45,7 @@ class _DentalComplaintCardState extends State { children: [ Container( child: Text( - widget.listDentalChiefComplain.name!, + widget.listDentalChiefComplain!.name!, style: TextStyle( fontSize: 16.0, color: Colors.black, @@ -60,12 +62,13 @@ class _DentalComplaintCardState extends State { } getChiefComplaintsList() { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; List doctorsList = []; List _patientDoctorAppointmentListHospital =[]; GifLoaderDialogUtils.showMyDialog(context); ClinicListService service = new ClinicListService(); - service.getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD!, widget.listDentalChiefComplain.projectID!, context).then((res) { + service.getChiefComplaintDoctorList(widget.listDentalChiefComplain!.iD!, widget.listDentalChiefComplain.projectID, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { print(res['List_DentalDoctorChiefComplaintMapping']); diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index d13ed8da..89ee4cef 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -214,10 +214,11 @@ class DoctorView extends StatelessWidget { } getDoctorsProfile(context, DoctorList docObject, {isAppo}) { + int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List docProfileList = []; DoctorsListService service = new DoctorsListService(); - service.getDoctorsProfile(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, context).then((res) { + service.getDoctorsProfile(docObject.doctorID!, docObject.clinicID!, docObject!.projectID!, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['DoctorProfileList'].length != 0) { diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index d8a593f0..340158e7 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -562,9 +562,9 @@ class _MyFamily extends State with TickerProviderStateMixin { int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; familySharedRecords = await familyFileProvider.getSharedRecordByStatus(languageID); } + familySharedRecordsList =[]; sentRecordsList = []; - familySharedRecordsList = []; - familySharedRecords.getAllSharedRecordsByStatusList!.forEach((element) { + familySharedRecords.getAllSharedRecordsByStatusList.forEach((element) { if (element.status == 3) { familySharedRecordsList.add(element); } diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index 717b6349..129d404c 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -40,7 +40,7 @@ class _AmbulanceReqState extends State with SingleTickerProviderSt imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/Ambulance/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/Ambulance/ar/0.png')); return BaseView( - onModelReady: (model) => model.getAmRequestOrders(), + onModelReady: (model) => model.getAmRequestOrders(projectViewModel.isArabic ? 1 : 2), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, showNewAppBarTitle: true, diff --git a/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart b/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart index be28d40b..c41c2fc2 100644 --- a/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart +++ b/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart @@ -39,7 +39,7 @@ class _EdOnlineSelectedHospitalPageState Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getHospitals(), + onModelReady: (model) => model.getHospitals(projectViewModel.isArabic ? 1 : 2), builder: (_, model, w) => AppScaffold( baseViewModel: model, body: SingleChildScrollView( diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 8f9d1fc1..3fe1c6ba 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 89bad63d..330648df 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -372,10 +372,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) { @@ -407,10 +408,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 b2ee03e0..6be869cb 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -846,9 +846,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 7316b8c1..c223f5a8 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -58,6 +58,8 @@ class _SendFeedbackPageState extends State { List appoList = []; + ProjectViewModel projectViewModel; + String getSelected(BuildContext context) { switch (messageType) { case MessageType.ComplaintOnAnAppointment: @@ -109,7 +111,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( @@ -469,6 +471,7 @@ class _SendFeedbackPageState extends State { listData: list, selectedIndex: selectedStatusIndex, onValueSelected: (index) { + int languageID = projectViewModel.isArabic ? 1 : 2; selectedStatusIndex = index; if (index == 1) { @@ -488,7 +491,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 18005ca9..de6d1731 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -630,18 +630,32 @@ 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'].isNotEmpty ?? 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(int.parse(notificationCount.split("+").first)); - } - }), - }); + 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)) { + // 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); } else { diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart index 8aa0280a..4b6c5a83 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 176ec57f..adb098c7 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -514,7 +514,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 d81be3a1..592df61f 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -682,11 +682,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(); + // } } checkIfIsInPatient() { @@ -746,17 +746,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 1a4a02b5..ae25adc2 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -370,16 +370,22 @@ class _Login extends State { projectViewModel.isLogin = true; authenticatedUserObject.user = result.list; projectViewModel.user = authenticatedUserObject.user; - int languageID = - Provider.of(context, listen: false).isArabic - ? 1 - : 2; + + // GifLoaderDialogUtils.hideDialog(context); + // + // getToDoCount(); + // + // Navigator.pushAndRemoveUntil( + // context, + // FadePage( + // page: LandingPage(), + // ), + // (r) => false); + getToDoCount(); appointmentRateViewModel - .getIsLastAppointmentRatedList(languageID) + .getIsLastAppointmentRatedList(projectViewModel.isArabic ? 1 : 2) .then((value) => { - checkIfIsInPatient(), - getToDoCount(), - // GifLoaderDialogUtils.hideDialog(context), + GifLoaderDialogUtils.hideDialog(context), if (appointmentRateViewModel.isHaveAppointmentNotRate) { Navigator.pushAndRemoveUntil( diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index f203d879..2f4cccc3 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -67,7 +67,7 @@ class _AdvancePaymentPageState extends State { projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) { - model.getHospitals(isAdvancePayment: true); + model.getHospitals(projectViewModel.isArabic ? 1 : 2, isAdvancePayment: true); model.getFamilyFiles(); }, builder: (_, model, w) => AppScaffold( diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index d55c5073..3f61f3e9 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; + late 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 249b44da..fba43fbe 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -193,22 +193,27 @@ class _RateAppointmentDoctorState extends State { }); dialog.showAlertDialog(context); } else { - if(projectViewModel!.isLoginChild) { - Navigator.pushReplacement( - context, - FadePage( - page: LandingPage(), - ), - ); - } else { - //changed due to blank page coming before - Navigator.pushReplacement( - 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 ba909299..efe7f59f 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -33,7 +33,7 @@ class DoctorsListService extends BaseService { late String tokenID; List selectedBodyPartList = []; - Future getDoctorsList(int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async { + Future getDoctorsList(int clinicID, int projectID, bool isNearest, int languageID, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -73,6 +73,7 @@ class DoctorsListService extends BaseService { "Longitude": long != null ? long.toString() : 0, "isDentalAllowedBackend": clinicID == 17 ? true : isContinueDentalPlan, "IsGetNearAppointment": isNearest, + "LanguageID": languageID, if (isNearest) "SelectedDate": DateUtil.convertDateToString(DateTime.now()), "License": true }; @@ -87,7 +88,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorsListByName(String docName, BuildContext context) async { + Future getDoctorsListByName(String docName, int languageID, BuildContext context) async { Map request; late double lat; @@ -125,6 +126,7 @@ class DoctorsListService extends BaseService { "IsGetNearAppointment": false, "Latitude": lat == null ? 0.0 : lat, "Longitude": long == null ? 0.0 : long, + "LanguageID": languageID, "License": true }; @@ -138,7 +140,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorsProfile(int docID, int clinicID, int projectID, context) async { + Future getDoctorsProfile(int docID, int clinicID, int projectID, int languageID, context) async { Map request; Request req = appGlobal.getPublicRequest(); @@ -157,7 +159,8 @@ class DoctorsListService extends BaseService { "License": true, "IsRegistered": true, "ProjectID": projectID, - "isDentalAllowedBackend": false + "isDentalAllowedBackend": false, + "LanguageID": languageID, }; dynamic localRes; @@ -604,7 +607,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 +629,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 +1166,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 +1186,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; @@ -1194,7 +1199,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 +1221,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index e9a2319f..a9f8c47d 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -36,10 +36,7 @@ class ClinicListService extends BaseService { Future getActiveAppointmentNo(context) async { Map request = {}; - request = { - "IsActiveAppointment": true, - "LanguageID": 1 - }; + request = {"IsActiveAppointment": true, "LanguageID": 1}; dynamic localRes; @@ -51,6 +48,21 @@ class ClinicListService extends BaseService { return Future.value(localRes); } + Future getProjectsList(int languageID, context) async { + Map request = {}; + + request = {"LanguageID": languageID}; + + dynamic localRes; + + await baseAppClient.post(GET_PROJECTS_LIST, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + Future checkIfInPatientAPI(context) async { Map? request; request = { @@ -144,9 +156,7 @@ class ClinicListService extends BaseService { Future getProjectsList(context) async { Map request = {}; - request = { - "LanguageID": null - }; + request = {"LanguageID": languageID}; dynamic localRes; @@ -158,7 +168,7 @@ class ClinicListService extends BaseService { return Future.value(localRes); } - Future getChiefComplaintsList(int clinicID, int projectID, BuildContext context, {doctorId}) async { + Future getChiefComplaintsList(int clinicID, int projectID, int languageID, BuildContext context, {doctorId}) async { //Utils.showProgressDialog(context); Map request; @@ -177,7 +187,7 @@ class ClinicListService extends BaseService { "License": true, // "VersionID": 5.6, // "Channel": 3, - // "LanguageID": languageID == 'ar' ? 1 : 2, + "LanguageID": languageID, "IPAdress": "10.20.10.20", "generalid": "Cs2020@2016\$2958", "SessionID": null, @@ -199,7 +209,7 @@ class ClinicListService extends BaseService { return Future.value(localRes); } - Future getChiefComplaintDoctorList(int chiefComplaintID, int projectID, BuildContext context, {doctorId}) async { + Future getChiefComplaintDoctorList(int chiefComplaintID, int projectID, int languageID, BuildContext context, {doctorId}) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -219,7 +229,7 @@ class ClinicListService extends BaseService { "ProjectID": projectID, // "VersionID": 5.6, // "Channel": 3, - // "LanguageID": languageID == 'ar' ? 1 : 2, + "LanguageID": languageID, // "IPAdress": req.IPAdress, // "generalid": req.generalid, "SessionID": null, @@ -250,6 +260,13 @@ class ClinicListService extends BaseService { }, body: request); return Future.value(localRes); } + await baseAppClient.post(GET_NATIONALITY, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } Future insertInPatientOrder( GetAdmissionInfoResponseModel getAdmissionInfoResponseModel, int typeID, String patientName, String patientNameAR, String patientMobileNo, String comments, context) async { diff --git a/lib/services/livecare_services/livecare_provider.dart b/lib/services/livecare_services/livecare_provider.dart index 2d64d378..8a03e190 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 @@ -355,5 +361,4 @@ class LiveCareService extends BaseService { }, body: request); return Future.value(localRes); } - } diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 536ad111..b0d8f6e7 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -306,6 +306,19 @@ class PushNotificationHandler { // print("Push Notification getToken: " + token!); // onToken(token!); // }); + FirebaseMessaging.instance.getToken(vapidKey: 'BHRJG8sIzcysWxPw3B6xQjz_85nUuCfU6EAmpH18kyUTmB2cj35IdFwCyWSab80SA1v6oBSWVh-p6PcHPw_y00Y').then((String token) { + print("Push Notification getToken: " + token); + onToken(token); + }); + + + if(Platform.isIOS) { + FirebaseMessaging.instance.getAPNSToken().then((value) { + print("Push APNS getToken: " + value); + }); + } + + FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); } newMessage(RemoteMessage remoteMessage) async { diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 7fe974ff..bda62b24 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -2,6 +2,7 @@ import 'dart:collection'; import 'dart:math'; import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart'; @@ -33,6 +34,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; + // import 'package:speech_to_text/speech_recognition_error.dart'; // import 'package:speech_to_text/speech_recognition_result.dart'; // import 'package:speech_to_text/speech_to_text.dart'; @@ -44,9 +47,10 @@ class BottomBarSearch extends StatefulWidget { class _SearchBot extends State { SearchProvider searchProvider = new SearchProvider(); - RobotProvider Provider = RobotProvider(); + RobotProvider robotProvider = RobotProvider(); bool isLoading = false; bool isError = false; + // final SpeechToText speech = SpeechToText(); String error = ''; String _currentLocaleId = ""; @@ -64,6 +68,7 @@ class _SearchBot extends State { bool _isInit = true; TextEditingController searchController = TextEditingController(); + ProjectViewModel projectProvider; @override void initState() { @@ -74,40 +79,37 @@ class _SearchBot extends State { @override Widget build(BuildContext context) { + projectProvider = Provider.of(context); return BottomAppBar( - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Expanded( - child: SizedBox( - height: 64, - child: Material( - type: MaterialType.transparency, - child: TextField( - keyboardType: TextInputType.multiline, - maxLines: null, - controller: searchController, - decoration: InputDecoration( - hintText: TranslationBase.of(context).textToSpeech, - suffixIcon: IconButton( - icon: Icon(Icons.mic), - onPressed: () async { - setState(() { - searchController.text = ''; - }); - // await flutterTts.speak("Hello!"); - //Future.delayed(const Duration(seconds: 1), () { - initSpeechState() - .then((value) => startVoiceSearch()); - //}); - }, - )), - ), - ), + child: Row(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ + Expanded( + child: SizedBox( + height: 64, + child: Material( + type: MaterialType.transparency, + child: TextField( + keyboardType: TextInputType.multiline, + maxLines: null, + controller: searchController, + decoration: InputDecoration( + hintText: TranslationBase.of(context).textToSpeech, + suffixIcon: IconButton( + icon: Icon(Icons.mic), + onPressed: () async { + setState(() { + searchController.text = ''; + }); + // await flutterTts.speak("Hello!"); + //Future.delayed(const Duration(seconds: 1), () { + initSpeechState().then((value) => startVoiceSearch()); + //}); + }, + )), ), ), - ]), + ), + ), + ]), ); } @@ -164,10 +166,7 @@ class _SearchBot extends State { Future initSpeechState() async { // await speech.initialize(onError: errorListener, onStatus: statusListener); - _currentLocaleId = - TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' - ? 'en-GB' - : 'ar-SA'; // systemLocale.localeId; + _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId; flutterTts.setLanguage(_currentLocaleId); // if (!mounted) return; @@ -187,16 +186,9 @@ class _SearchBot extends State { } getPages(text) { - var request = { - 'VoiceMessage': text, - 'Lang': TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' - ? 'En' - : 'Ar' - }; - - searchProvider - .getBotPages(request) - .then((value) => {getCommands(value['Understand'])}); + var request = {'VoiceMessage': text, 'Lang': TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' ? 'En' : 'Ar'}; + + searchProvider.getBotPages(request).then((value) => {getCommands(value['Understand'])}); } getCommands(result) async { @@ -207,9 +199,7 @@ class _SearchBot extends State { case '100': { List clnicID = unique(result['ClinicId']); - if (result['ProjectId'] != 0 && - clnicID.length > 0 && - result['DoctorId'].length > 0) { + if (result['ProjectId'] != 0 && clnicID.length > 0 && result['DoctorId'].length > 0) { if (clnicID.length == 1) { getDoctorsList( result['ProjectId'], @@ -221,9 +211,7 @@ class _SearchBot extends State { } else { goToClinic(clnicID); } - } else if (result['ProjectId'] != 0 && - clnicID.length > 0 && - result['DoctorId'].length == 0) { + } else if (result['ProjectId'] != 0 && clnicID.length > 0 && result['DoctorId'].length == 0) { if (clnicID.length == 1) { getDoctorsList( result['ProjectId'], @@ -233,9 +221,7 @@ class _SearchBot extends State { } else { goToClinic(clnicID); } - } else if (result['ProjectId'] == 0 && - clnicID.length > 0 && - result['DoctorId'].length == 0) { + } else if (result['ProjectId'] == 0 && clnicID.length > 0 && result['DoctorId'].length == 0) { if (clnicID.length == 1) { getDoctorsList( result['ProjectId'], @@ -245,9 +231,7 @@ class _SearchBot extends State { } else { goToClinic(clnicID); } - } else if (result['ProjectId'] == 0 && - clnicID.length > 0 && - result['DoctorId'].length > 0) { + } else if (result['ProjectId'] == 0 && clnicID.length > 0 && result['DoctorId'].length > 0) { if (clnicID.length == 1) { getDoctorsList( result['ProjectId'], @@ -394,12 +378,11 @@ class _SearchBot extends State { } getDoctorProfile(projectId, clinicId, doctorId, context, doctorData) { + int languageID = projectProvider.isArabic ? 1 : 2; List docProfileList = []; DoctorsListService service = new DoctorsListService(); - service - .getDoctorsProfile(doctorId, clinicId, projectId, context) - .then((res) { + service.getDoctorsProfile(doctorId, clinicId, projectId, languageID, context).then((res) { if (res['MessageStatus'] == 1) { if (res['DoctorProfileList'].length != 0) { res['DoctorProfileList'].forEach((v) { @@ -407,8 +390,7 @@ class _SearchBot extends State { }); } - navigateToDoctorProfile(context, doctorData[0], docProfileList[0], - isAppo: true); + navigateToDoctorProfile(context, doctorData[0], docProfileList[0], isAppo: true); //speak(); } }).catchError((err) { @@ -417,33 +399,29 @@ class _SearchBot extends State { } getDoctorsList(projectId, clinicId, context, {doctorId, doctorName}) { + int languageID = projectProvider.isArabic ? 1 : 2; List doctorsList = []; List arr = []; List arrDistance = []; DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service - .getDoctorsList(clinicId, projectId, false, context, - doctorId: doctorId, doctorName: doctorName) - .then((res) { + service.getDoctorsList(clinicId, projectId, false, languageID, context, doctorId: doctorId, doctorName: doctorName).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { - if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null && - res['SearchDoctorsByTime_IsVoiceCommandList'].length != 0) { + if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null && res['SearchDoctorsByTime_IsVoiceCommandList'].length != 0) { doctorsList.clear(); res['SearchDoctorsByTime_IsVoiceCommandList'].forEach((v1) { v1['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); - arr.add(new DoctorList.fromJson(v).projectName!); + arr.add(new DoctorList.fromJson(v).projectName!); arrDistance.add(new DoctorList.fromJson(v) .projectDistanceInKiloMeters .toString()); }); }); if (doctorsList.length == 1) { - getDoctorProfile( - projectId, clinicId, doctorId[0], context, doctorsList); + getDoctorProfile(projectId, clinicId, doctorId[0], context, doctorsList); //speak(); } else { @@ -454,15 +432,14 @@ class _SearchBot extends State { res['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); - arr.add(new DoctorList.fromJson(v).projectName!); + arr.add(new DoctorList.fromJson(v).projectName!); arrDistance.add(new DoctorList.fromJson(v) .projectDistanceInKiloMeters .toString()); }); if (doctorsList.length == 1) { - getDoctorProfile( - projectId, clinicId, doctorId[0], context, doctorsList); + getDoctorProfile(projectId, clinicId, doctorId[0], context, doctorsList); //speak(); } else { @@ -479,8 +456,7 @@ class _SearchBot extends State { }); } - Future navigateToDoctorProfile(context, docObject, docProfile, - {isAppo}) async { + Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async { Navigator.push( context, FadePage( @@ -497,11 +473,7 @@ class _SearchBot extends State { Navigator.push( context, FadePage( - page: BranchView( - doctorsList: docList, - result: result, - num: numAll, - resultDistance: arrDistance), + page: BranchView(doctorsList: docList, result: result, num: numAll, resultDistance: arrDistance), ), ); } diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index c3e9e884..d7600bed 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -731,10 +731,11 @@ class _FloatingSearchButton extends State with TickerProvi } getDoctorProfile(projectId, clinicId, doctorId, context, doctorData) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; List docProfileList = []; DoctorsListService service = new DoctorsListService(); - service.getDoctorsProfile(doctorId, clinicId, projectId, context).then((res) { + service.getDoctorsProfile(doctorId, clinicId, projectId, languageID, context).then((res) { if (res['MessageStatus'] == 1) { if (res['DoctorProfileList'].length != 0) { res['DoctorProfileList'].forEach((v) { @@ -751,12 +752,13 @@ class _FloatingSearchButton extends State with TickerProvi } getDoctorsList(projectId, clinicId, context, {doctorId, doctorName, isNearest = false}) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; List doctorsList = []; List arr = []; List arrDistance = []; DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.getDoctorsList(clinicId, projectId, isNearest, context, doctorId: doctorId, doctorName: doctorName).then((res) { + service.getDoctorsList(clinicId, projectId, isNearest, languageID, context, doctorId: doctorId, doctorName: doctorName).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() {