From 936682ff95bd5bc0ded1ac60b15caabc6771303b Mon Sep 17 00:00:00 2001 From: "taha.alam" Date: Tue, 15 Oct 2024 17:40:24 +0300 Subject: [PATCH 01/11] WD: clinic by hospital --- android/app/build.gradle | 2 +- lib/config/config.dart | 1 + lib/config/localized_values.dart | 2 + lib/pages/BookAppointment/Search.dart | 53 +- .../components/search_by_hospital_name.dart | 513 ++++++++++++++++++ .../dialog/clinic_list_dialog.dart | 2 +- .../appointment_services/GetDoctorsList.dart | 2 +- .../clinic_services/get_clinic_service.dart | 13 + lib/uitl/translations_delegate_base.dart | 3 + 9 files changed, 578 insertions(+), 13 deletions(-) create mode 100644 lib/pages/BookAppointment/components/search_by_hospital_name.dart diff --git a/android/app/build.gradle b/android/app/build.gradle index b5f2d00f..a75b8ca5 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -199,7 +199,7 @@ dependencies { implementation files('libs/Penguin.aar') implementation files('libs/PenguinRenderer.aar') - implementation "org.jetbrains.anko:anko-commons:0.10.4" +// implementation "org.jetbrains.anko:anko-commons:0.10.4" implementation 'com.github.kittinunf.fuel:fuel:2.3.0' //for JVM implementation 'com.github.kittinunf.fuel:fuel-android:2.3.0' implementation 'com.google.android.gms:play-services-location:17.1.0'//for Android diff --git a/lib/config/config.dart b/lib/config/config.dart index 16a900ec..a574c111 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -215,6 +215,7 @@ var GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; //URL to get clinic list var GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; +var GET_CLINICS_LIST_WRT_HOSPITAL_URL = "Services/Lists.svc/REST/GetClinicFromDoctorSchedule"; //URL to get active appointment list var GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7107d357..8ac98ce0 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -45,6 +45,8 @@ const Map localizedValues = { 'name': {'en': 'Name', 'ar': 'الإسم'}, 'doctor': {'en': 'Doctor', 'ar': 'الطبيب'}, 'clinicName': {'en': 'Clinic Name', 'ar': 'اسم العيادة'}, + 'hospitalName': {'en': 'Hospital Name', 'ar': 'اسم المستشفى'}, + 'NoClinicFound': {'en': 'No Clinic Found', 'ar': 'لم يتم العثور على عيادة'}, 'doctorName': {'en': 'Doctor Name', 'ar': 'إسم الطبيب'}, 'nearestAppo': {'en': 'Nearest Appointment', 'ar': 'أقرب موعد'}, 'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'}, diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index b5680c1c..0cd0da0f 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/components/search_by_hospital_name.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -28,15 +29,20 @@ class _SearchState extends State with TickerProviderStateMixin { @override void initState() { - _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type, ); + _tabController = new TabController( + length: 3, + vsync: this, + initialIndex: widget.type, + ); super.initState(); } @override Widget build(BuildContext context) { AppGlobal.context = context; - // ProjectViewModel projectViewModel = Provider.of(context); - GAnalytics.TREATMENT_TYPE = null; // reset treatment type on start new booking + // ProjectViewModel projectViewModel = Provider.of(context); + GAnalytics.TREATMENT_TYPE = + null; // reset treatment type on start new booking return AppScaffold( isShowAppBar: false, @@ -54,33 +60,60 @@ class _SearchState extends State with TickerProviderStateMixin { indicatorSize: TabBarIndicatorSize.tab, labelColor: Color(0xff2B353E), unselectedLabelColor: Color(0xff575757), - labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelPadding: + EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), labelStyle: TextStyle( - fontFamily: context.read().isArabic ? 'Cairo' : 'Poppins', + fontFamily: context.read().isArabic + ? 'Cairo' + : 'Poppins', fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.48, ), unselectedLabelStyle: TextStyle( - fontFamily: context.read().isArabic ? 'Cairo' : 'Poppins', + fontFamily: context.read().isArabic + ? 'Cairo' + : 'Poppins', fontSize: 16, fontWeight: FontWeight.w600, letterSpacing: -0.48, ), - tabs: [Text(TranslationBase.of(context).clinicName), Text(TranslationBase.of(context).doctorName)], + tabs: [ + + Text( + TranslationBase.of(context).clinicName, + style: TextStyle(fontSize: 12), + ), + Text( + TranslationBase.of(context).hospitalName, + style: TextStyle(fontSize: 12), + ), + Text( + TranslationBase.of(context).doctorName, + style: TextStyle(fontSize: 12), + ) + ], onTap: (idx) { if (idx == 0) - context.read().analytics.appointment.book_appointment_by_clinic(); + context + .read() + .analytics + .appointment + .book_appointment_by_clinic(); else - context.read().analytics.appointment.book_appointment_by_doctor(); + context + .read() + .analytics + .appointment + .book_appointment_by_doctor(); }, ), Expanded( child: TabBarView( - physics: NeverScrollableScrollPhysics(), children: [ SearchByClinic(clnicIds: widget.clnicIds), + SearchByHospital(), SearchByDoctor(), ], controller: _tabController, diff --git a/lib/pages/BookAppointment/components/search_by_hospital_name.dart b/lib/pages/BookAppointment/components/search_by_hospital_name.dart new file mode 100644 index 00000000..2813391b --- /dev/null +++ b/lib/pages/BookAppointment/components/search_by_hospital_name.dart @@ -0,0 +1,513 @@ +import 'dart:collection'; + +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../../config/shared_pref_kay.dart'; +import '../../../config/size_config.dart'; +import '../../../core/model/hospitals/hospitals_model.dart'; +import '../../../core/viewModels/project_view_model.dart'; +import '../../../models/Appointments/DoctorListResponse.dart'; +import '../../../models/Appointments/SearchInfoModel.dart'; +import '../../../models/Clinics/ClinicListResponse.dart'; +import '../../../services/appointment_services/GetDoctorsList.dart'; +import '../../../services/authentication/auth_provider.dart'; +import '../../../services/clinic_services/get_clinic_service.dart'; +import '../../../uitl/app_toast.dart'; +import '../../../uitl/gif_loader_dialog_utils.dart'; +import '../../../uitl/translations_delegate_base.dart'; +import '../../../widgets/transitions/fade_page.dart'; +import '../../livecare/livecare_home.dart'; +import '../DentalComplaints.dart'; +import '../LaserBooking.dart'; +import '../SearchResults.dart'; +import '../dialog/clinic_list_dialog.dart'; +import 'LiveCareBookAppointment.dart'; + +class SearchByHospital extends StatefulWidget { + @override + State createState() => _SearchByHospitalState(); +} + +class _SearchByHospitalState extends State { + HospitalsModel? selectedHospital; + bool nearestAppo = false; + + String? selectedClinicName; + List projectsList = []; + List? clinicIds = List.empty(); + + final GlobalKey projectDropdownKey = GlobalKey(); + + List clinicsList = []; + bool isMobileAppDentalAllow = false; + ListClinicCentralized? selectedClinic; + + String? dropdownValue; + String dropdownTitle = ""; + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((_) => getProjectsList()); + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Padding( + padding: const EdgeInsets.only(left: 6, right: 6, top: 16), + child: Row( + children: [ + Checkbox( + activeColor: CustomColors.accentColor, + value: nearestAppo, + onChanged: (bool? value) { + nearestAppo = value?? false; + setState(() { + + }); + }, + ), + AutoSizeText( + TranslationBase.of(context).nearestAppo.trim(), + maxLines: 1, + minFontSize: 10, + style: TextStyle( + fontSize: SizeConfig.textMultiplier! * 1.4, + fontWeight: FontWeight.w600, + letterSpacing: -0.39, + height: 0.8, + ), + ), + // Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)), + ], + ), + ), + + mHeight(8), + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + margin: EdgeInsets.only(left: 20, right: 20), + padding: + EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), + child: Row( + children: [ + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).selectHospital, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + height: 18, + width: double.infinity, + child: DropdownButtonHideUnderline( + child: DropdownButton( + hint: Text( + TranslationBase.of(context).selectHospital), + value: selectedHospital, + iconSize: 0, + isExpanded: true, + style: TextStyle( + fontSize: 14, + letterSpacing: -0.56, + color: Colors.black), + items: projectsList.map((HospitalsModel item) { + return DropdownMenuItem( + value: item, + child: AutoSizeText( + item.name!, + maxLines: 1, + minFontSize: 10, + style: TextStyle( + fontSize: + SizeConfig.textMultiplier! * 1.6, + fontWeight: FontWeight.w600, + letterSpacing: -0.39, + height: 0.8, + ), + ), + // Text('${item.name!}'), + ); + }).toList(), + onChanged: (HospitalsModel? newValue) async { + getClinicWrtHospital(newValue); + // setState(() { + // selectedHospital = newValue; + // }); + }, + ), + ), + ), + ], + ), + ), + Icon(Icons.keyboard_arrow_down), + ], + )), + if (clinicIds?.isNotEmpty == true) ...[ + mHeight(8), + InkWell( + onTap: () { + showClickListDialog(context, clinicIds ?? List.empty(), + onSelection: (ListClinicCentralized clincs) { + selectedClinic = clincs; + Navigator.pop(context); + setState(() { + dropdownTitle = clincs.clinicDescription!; + dropdownValue = clincs.clinicID.toString() + + "-" + + clincs.isLiveCareClinicAndOnline.toString() + + "-" + + clincs.liveCareClinicID.toString() + + "-" + + clincs.liveCareServiceID.toString(); + }); + getDoctorsList(context); + + context + .read() + .analytics + .appointment + .book_appointment_select_clinic( + appointment_type: 'regular', + clinic: clincs.clinicDescription); + }); + }, + child: Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + margin: EdgeInsets.only(left: 20, right: 20), + padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 8), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).selectClinic, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Padding( + padding: const EdgeInsets.only(top: 4, bottom: 2), + child: Text( + dropdownTitle, + style: TextStyle( + fontSize: 13, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + ), + ], + ), + ), + Icon(Icons.keyboard_arrow_down), + ], + ), + ), + ) + ] + ], + ); + } + + void openDropdown(GlobalKey key) { + GestureDetector? detector; + detector = searchForGestureDetector(key.currentContext!); + assert(detector != null); + detector!.onTap!(); + } + + GestureDetector? searchForGestureDetector(BuildContext element) { + GestureDetector? detector; + element.visitChildElements((element) { + if (element.widget != null && element.widget is GestureDetector) { + detector = element.widget as GestureDetector?; + //return false; + } else { + searchForGestureDetector(element); + } + }); + return detector; + } + + getProjectsList() { + GifLoaderDialogUtils.showMyDialog(context); + + int languageID = context.read().isArabic ? 1 : 2; + ClinicListService service = new ClinicListService(); + List projectsListLocal = []; + service.getProjectsList(languageID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + + if (res['MessageStatus'] == 1) { + setState(() { + res['ListProject'].forEach((v) { + projectsListLocal.add(new HospitalsModel.fromJson(v)); + }); + projectsList = projectsListLocal; + }); + } else {} + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + + print(err); + }); + } + + + + void getClinicWrtHospital(HospitalsModel? newValue) { + GifLoaderDialogUtils.showMyDialog(context); + ClinicListService service = new ClinicListService(); + List projectsListLocal = []; + setState(() { + clinicIds = List.empty(); + }); + List clinicId = []; + service + .getClinicByHospital( + projectID: newValue?.mainProjectID.toString() ?? "") + .then((res) { + print("the result is obtained"); + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + List list = res['ListClinic']; + + if(list.isEmpty){ + AppToast.showErrorToast(message: + TranslationBase.of(context).NoClinicFound, + ); + + } + res['ListClinic'].forEach((v) { + clinicId?.add(ListClinicCentralized.fromJson(v)); + }); + clinicIds = clinicId; + setState(() { + + }); + } else { + AppToast.showErrorToast(message: + TranslationBase.of(context).NoClinicFound, + ); + } + }).catchError((err) { + print('the error is $err'); + AppToast.showErrorToast(message: + TranslationBase.of(context).NoClinicFound, + ); + GifLoaderDialogUtils.hideDialog(context); + }).catchError((err) { + AppToast.showErrorToast(message: + TranslationBase.of(context).NoClinicFound, + ); + GifLoaderDialogUtils.hideDialog(context); + + print(err); + }); + } + + Future navigateToDentalComplaints( + BuildContext context, SearchInfo searchInfo) async { + Navigator.push( + context, + FadePage( + page: DentalComplaints(searchInfo: searchInfo), + ), + ).then((value) { + setState(() { + dropdownValue = null; + selectedHospital = null; + clinicIds = List.empty(); + }); + }); + } + + callDoctorsSearchAPI(int clinicID) { + int languageID = context.read().isArabic ? 1 : 2; + GifLoaderDialogUtils.showMyDialog(context); + List doctorsList = []; + List arr = []; + List arrDistance = []; + List result; + int numAll; + List _patientDoctorAppointmentListHospital = + []; + + DoctorsListService service = new DoctorsListService(); + service + .getDoctorsList( + clinicID, + selectedHospital?.mainProjectID.toString() != "" + ? int.parse(selectedHospital?.mainProjectID.toString() ?? "-1") + : 0, + nearestAppo, + languageID, + null) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + setState(() { + if (res['DoctorList'].length != 0) { + doctorsList.clear(); + res['DoctorList'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); + }); + doctorsList.forEach((element) { + List doctorByHospital = + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + _patientDoctorAppointmentListHospital[ + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] + .patientDoctorAppointmentList! + .add(element); + } else { + _patientDoctorAppointmentListHospital.add( + PatientDoctorAppointmentList( + filterName: element.projectName, + distanceInKMs: + element.projectDistanceInKiloMeters.toString(), + patientDoctorAppointment: element)); + } + }); + } else {} + }); + + result = LinkedHashSet.from(arr).toList(); + numAll = result.length; + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err, localContext: context); + }); + } + + Future navigateToSearchResults( + context, + List docList, + List + patientDoctorAppointmentListHospital) async { + Navigator.push( + context, + FadePage( + page: SearchResults( + isLiveCareAppointment: false, + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))) + .then((value) { + + print("navigation return "); + dropdownValue = null; + dropdownTitle = ""; + selectedHospital = null; + clinicIds = List.empty(); + setState(() { + + }); + // getProjectsList(); + }); + } + + Future navigateToLaserClinic(BuildContext context) async { + Navigator.push( + context, + FadePage( + page: LaserBooking(), + ), + ).then((value) { + print("LaserBooking navigation return "); + setState(() { + dropdownValue = null; + selectedHospital = null; + clinicIds = List.empty(); + }); + }); + } + + getDoctorsList(BuildContext context) { + SearchInfo searchInfo = new SearchInfo(); + if (dropdownValue != null) if (dropdownValue!.split("-")[0] == "17") { + searchInfo.ProjectID = int.parse(selectedHospital?.mainProjectID ?? ""); + searchInfo.ClinicID = int.parse(dropdownValue!.split("-")[0]); + searchInfo.hospital = selectedHospital; + searchInfo.clinic = selectedClinic; + searchInfo.date = DateTime.now(); + + if (context.read().isLogin) { + if (context.read().user.age! > 12) { + navigateToDentalComplaints(context, searchInfo); + } else { + callDoctorsSearchAPI(17); + } + } else { + navigateToDentalComplaints(context, searchInfo); + } + } else if (dropdownValue!.split("-")[0] == "253") { + navigateToLaserClinic(context); + // callDoctorsSearchAPI(); + } else if (dropdownValue!.split("-")[1] == "true" + // && authProvider.isLogin && + // authUser.patientType == 1 + ) { + Navigator.push( + context, + FadePage( + page: LiveCareBookAppointment( + clinicName: dropdownTitle, + liveCareClinicID: dropdownValue!.split("-")[2], + liveCareServiceID: dropdownValue!.split("-")[3]), + ), + ).then((value) { + print("navigation return "); + if (value == "false") dropdownValue = null; + + // setState(() { + // }); + if (value == "livecare") { + Navigator.push(context, FadePage(page: LiveCareHome())); + } + if (value == "schedule") { + callDoctorsSearchAPI(int.parse(dropdownValue!.split("-")[0])); + } + }); + setState(() { + + }); + } else { + callDoctorsSearchAPI(int.parse(dropdownValue!.split("-")[0])); + } + } +} diff --git a/lib/pages/BookAppointment/dialog/clinic_list_dialog.dart b/lib/pages/BookAppointment/dialog/clinic_list_dialog.dart index ecbe1003..c3d82c74 100644 --- a/lib/pages/BookAppointment/dialog/clinic_list_dialog.dart +++ b/lib/pages/BookAppointment/dialog/clinic_list_dialog.dart @@ -115,7 +115,7 @@ class _ClickListDialogState extends State { ), ), ), - tempClinicsList[index].isLiveCareClinicAndOnline! + tempClinicsList[index].isLiveCareClinicAndOnline == true ? SvgPicture.asset( 'assets/images/new-design/video_icon_green_right.svg', height: 12, diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index aaf30b97..841fe6c6 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -34,7 +34,7 @@ class DoctorsListService extends BaseService { String? tokenID; List selectedBodyPartList = []; - Future getDoctorsList(int clinicID, int projectID, bool isNearest, int languageID, 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) { diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index dc494a61..fb7ae8c1 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -34,6 +34,19 @@ class ClinicListService extends BaseService { return Future.value(localRes); } + Future getClinicByHospital({required String projectID}) async { + Map request = {"ProjectID": projectID}; + + dynamic localRes; + + await baseAppClient.post(GET_CLINICS_LIST_WRT_HOSPITAL_URL, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + Future getActiveAppointmentNo(context) async { Map request = {}; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 01e737a8..366def26 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -59,7 +59,10 @@ class TranslationBase { String get clinicName => localizedValues['clinicName'][locale.languageCode]; + String get hospitalName => localizedValues['hospitalName'][locale.languageCode]; + String get doctorName => localizedValues['doctorName'][locale.languageCode]; + String get NoClinicFound => localizedValues['NoClinicFound'][locale.languageCode]; String get nearestAppo => localizedValues['nearestAppo'][locale.languageCode]; From fe9d259cbdb6c6a6ad82309b3a83cf6440c92094 Mon Sep 17 00:00:00 2001 From: "taha.alam" Date: Wed, 16 Oct 2024 10:16:59 +0300 Subject: [PATCH 02/11] build context handled --- .../components/search_by_hospital_name.dart | 239 +++++++++++------- 1 file changed, 150 insertions(+), 89 deletions(-) diff --git a/lib/pages/BookAppointment/components/search_by_hospital_name.dart b/lib/pages/BookAppointment/components/search_by_hospital_name.dart index 2813391b..3de28dff 100644 --- a/lib/pages/BookAppointment/components/search_by_hospital_name.dart +++ b/lib/pages/BookAppointment/components/search_by_hospital_name.dart @@ -1,6 +1,7 @@ import 'dart:collection'; import 'package:auto_size_text/auto_size_text.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:flutter/material.dart'; @@ -56,6 +57,8 @@ class _SearchByHospitalState extends State { @override Widget build(BuildContext context) { + AppGlobal.context = context; + return Column( children: [ Padding( @@ -66,14 +69,17 @@ class _SearchByHospitalState extends State { activeColor: CustomColors.accentColor, value: nearestAppo, onChanged: (bool? value) { - nearestAppo = value?? false; + nearestAppo = value ?? false; setState(() { }); }, ), AutoSizeText( - TranslationBase.of(context).nearestAppo.trim(), + TranslationBase + .of(context) + .nearestAppo + .trim(), maxLines: 1, minFontSize: 10, style: TextStyle( @@ -94,7 +100,7 @@ class _SearchByHospitalState extends State { decoration: containerRadius(Colors.white, 12), margin: EdgeInsets.only(left: 20, right: 20), padding: - EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), + EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), child: Row( children: [ Flexible( @@ -102,7 +108,9 @@ class _SearchByHospitalState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - TranslationBase.of(context).selectHospital, + TranslationBase + .of(context) + .selectHospital, style: TextStyle( fontSize: 11, letterSpacing: -0.44, @@ -115,7 +123,9 @@ class _SearchByHospitalState extends State { child: DropdownButtonHideUnderline( child: DropdownButton( hint: Text( - TranslationBase.of(context).selectHospital), + TranslationBase + .of(context) + .selectHospital), value: selectedHospital, iconSize: 0, isExpanded: true, @@ -132,7 +142,7 @@ class _SearchByHospitalState extends State { minFontSize: 10, style: TextStyle( fontSize: - SizeConfig.textMultiplier! * 1.6, + SizeConfig.textMultiplier! * 1.6, fontWeight: FontWeight.w600, letterSpacing: -0.39, height: 0.8, @@ -141,11 +151,11 @@ class _SearchByHospitalState extends State { // Text('${item.name!}'), ); }).toList(), - onChanged: (HospitalsModel? newValue) async { + onChanged: (HospitalsModel? newValue){ getClinicWrtHospital(newValue); - // setState(() { - // selectedHospital = newValue; - // }); + setState(() { + selectedHospital = newValue; + }); }, ), ), @@ -162,28 +172,29 @@ class _SearchByHospitalState extends State { onTap: () { showClickListDialog(context, clinicIds ?? List.empty(), onSelection: (ListClinicCentralized clincs) { - selectedClinic = clincs; - Navigator.pop(context); - setState(() { - dropdownTitle = clincs.clinicDescription!; - dropdownValue = clincs.clinicID.toString() + + selectedClinic = clincs; + Navigator.pop(context); + setState(() { + dropdownTitle = clincs.clinicDescription!; + dropdownValue = clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + - clincs.liveCareServiceID.toString(); - }); - getDoctorsList(context); - - context - .read() - .analytics - .appointment - .book_appointment_select_clinic( + clincs.liveCareServiceID.toString( + ); + }); + getDoctorsList(context); + + context + .read() + .analytics + .appointment + .book_appointment_select_clinic( appointment_type: 'regular', clinic: clincs.clinicDescription); - }); + }); }, child: Container( width: double.infinity, @@ -197,7 +208,9 @@ class _SearchByHospitalState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - TranslationBase.of(context).selectClinic, + TranslationBase + .of(context) + .selectClinic, style: TextStyle( fontSize: 11, letterSpacing: -0.44, @@ -230,7 +243,7 @@ class _SearchByHospitalState extends State { void openDropdown(GlobalKey key) { GestureDetector? detector; - detector = searchForGestureDetector(key.currentContext!); + detector = searchForGestureDetector(key.currentContext!); assert(detector != null); detector!.onTap!(); } @@ -251,7 +264,9 @@ class _SearchByHospitalState extends State { getProjectsList() { GifLoaderDialogUtils.showMyDialog(context); - int languageID = context.read().isArabic ? 1 : 2; + int languageID = context + .read() + .isArabic ? 1 : 2; ClinicListService service = new ClinicListService(); List projectsListLocal = []; service.getProjectsList(languageID, context).then((res) { @@ -275,8 +290,7 @@ class _SearchByHospitalState extends State { } - - void getClinicWrtHospital(HospitalsModel? newValue) { + void getClinicWrtHospital(HospitalsModel? newValue) async { GifLoaderDialogUtils.showMyDialog(context); ClinicListService service = new ClinicListService(); List projectsListLocal = []; @@ -284,23 +298,25 @@ class _SearchByHospitalState extends State { clinicIds = List.empty(); }); List clinicId = []; - service - .getClinicByHospital( - projectID: newValue?.mainProjectID.toString() ?? "") - .then((res) { - print("the result is obtained"); + try { + Map res = await service + .getClinicB + + yHospital( + projectID: newValue?.mainProjectID.toString() ?? ""); GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { List list = res['ListClinic']; - if(list.isEmpty){ + if (list.isEmpty) { AppToast.showErrorToast(message: - TranslationBase.of(context).NoClinicFound, + TranslationBase + .of(context) + .NoClinicFound, ); - } res['ListClinic'].forEach((v) { - clinicId?.add(ListClinicCentralized.fromJson(v)); + clinicId.add(ListClinicCentralized.fromJson(v)); }); clinicIds = clinicId; setState(() { @@ -308,27 +324,67 @@ class _SearchByHospitalState extends State { }); } else { AppToast.showErrorToast(message: - TranslationBase.of(context).NoClinicFound, + TranslationBase + .of(context) + .NoClinicFound, ); } - }).catchError((err) { - print('the error is $err'); - AppToast.showErrorToast(message: - TranslationBase.of(context).NoClinicFound, - ); - GifLoaderDialogUtils.hideDialog(context); - }).catchError((err) { + } catch (e) { + print("the error is $e"); AppToast.showErrorToast(message: - TranslationBase.of(context).NoClinicFound, - ); - GifLoaderDialogUtils.hideDialog(context); + TranslationBase.of(context).NoClinicFound, + ); + GifLoaderDialogUtils.hideDialog(context); - print(err); - }); + } + + // .then((res) { + // print("the result is obtained"); + // GifLoaderDialogUtils.hideDialog(context); + // if (res['MessageStatus'] == 1) { + // List list = res['ListClinic']; + // + // if(list.isEmpty){ + // AppToast.showErrorToast(message: + // TranslationBase.of(context).NoClinicFound, + // ); + // + // } + // res['ListClinic'].forEach((v) { + // clinicId?.add(ListClinicCentralized.fromJson(v)); + // }); + // clinicIds = clinicId; + // setState(() { + // + // }); + // } else { + // AppToast.showErrorToast(message: + // TranslationBase.of(context).NoClinicFound, + // ); + // } + // }).catchError((err) { + // print('the error is $err'); + // AppToast.showErrorToast(message: + // TranslationBase.of(context).NoClinicFound, + // ); + // GifLoaderDialogUtils.hideDialog(context); + // }).catchError((err) { + // AppToast.showErrorToast(message: + // TranslationBase.of(context).NoClinicFound, + // ); + // GifLoaderDialogUtils.hideDialog(context); + // + // print(err); + // }); } - Future navigateToDentalComplaints( - BuildContext context, SearchInfo searchInfo) async { + @override + void dispose() { + super.dispose(); + } + + Future navigateToDentalComplaints(BuildContext context, + SearchInfo searchInfo) async { Navigator.push( context, FadePage( @@ -344,7 +400,9 @@ class _SearchByHospitalState extends State { } callDoctorsSearchAPI(int clinicID) { - int languageID = context.read().isArabic ? 1 : 2; + int languageID = context + .read() + .isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; List arr = []; @@ -352,18 +410,18 @@ class _SearchByHospitalState extends State { List result; int numAll; List _patientDoctorAppointmentListHospital = - []; + []; DoctorsListService service = new DoctorsListService(); service .getDoctorsList( - clinicID, - selectedHospital?.mainProjectID.toString() != "" - ? int.parse(selectedHospital?.mainProjectID.toString() ?? "-1") - : 0, - nearestAppo, - languageID, - null) + clinicID, + selectedHospital?.mainProjectID.toString() != "" + ? int.parse(selectedHospital?.mainProjectID.toString() ?? "-1") + : 0, + nearestAppo, + languageID, + null) .then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { @@ -371,21 +429,21 @@ class _SearchByHospitalState extends State { if (res['DoctorList'].length != 0) { doctorsList.clear(); res['DoctorList'].forEach((v) { - doctorsList.add(new DoctorList.fromJson(v)); + doctorsList.add( DoctorList.fromJson(v)); }); doctorsList.forEach((element) { List doctorByHospital = - _patientDoctorAppointmentListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); if (doctorByHospital.length != 0) { _patientDoctorAppointmentListHospital[ - _patientDoctorAppointmentListHospital - .indexOf(doctorByHospital[0])] + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] .patientDoctorAppointmentList! .add(element); } else { @@ -393,7 +451,7 @@ class _SearchByHospitalState extends State { PatientDoctorAppointmentList( filterName: element.projectName, distanceInKMs: - element.projectDistanceInKiloMeters.toString(), + element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); } }); @@ -414,21 +472,19 @@ class _SearchByHospitalState extends State { }); } - Future navigateToSearchResults( - context, + Future navigateToSearchResults(context, List docList, List - patientDoctorAppointmentListHospital) async { + patientDoctorAppointmentListHospital) async { Navigator.push( - context, - FadePage( - page: SearchResults( - isLiveCareAppointment: false, - doctorsList: docList, - patientDoctorAppointmentListHospital: - patientDoctorAppointmentListHospital))) + context, + FadePage( + page: SearchResults( + isLiveCareAppointment: false, + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))) .then((value) { - print("navigation return "); dropdownValue = null; dropdownTitle = ""; @@ -466,8 +522,13 @@ class _SearchByHospitalState extends State { searchInfo.clinic = selectedClinic; searchInfo.date = DateTime.now(); - if (context.read().isLogin) { - if (context.read().user.age! > 12) { + if (context + .read() + .isLogin) { + if (context + .read() + .user + .age! > 12) { navigateToDentalComplaints(context, searchInfo); } else { callDoctorsSearchAPI(17); @@ -479,9 +540,9 @@ class _SearchByHospitalState extends State { navigateToLaserClinic(context); // callDoctorsSearchAPI(); } else if (dropdownValue!.split("-")[1] == "true" - // && authProvider.isLogin && - // authUser.patientType == 1 - ) { + // && authProvider.isLogin && + // authUser.patientType == 1 + ) { Navigator.push( context, FadePage( From 81b94814ce4f0a1e4626fe07a9b7933246d71336 Mon Sep 17 00:00:00 2001 From: "taha.alam" Date: Thu, 17 Oct 2024 11:10:21 +0300 Subject: [PATCH 03/11] WD: hospital top and bottom name added --- .../Appointments/DoctorListResponse.dart | 12 +- lib/pages/BookAppointment/Search.dart | 7 +- .../components/SearchByClinic.dart | 2 +- .../components/SearchByDoctor.dart | 2 +- .../components/search_by_hospital_name.dart | 184 +++++++----------- 5 files changed, 89 insertions(+), 118 deletions(-) diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 205909c9..93cb81e5 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -44,6 +44,8 @@ class DoctorList { List? specialityN; dynamic workingHours; dynamic decimalDoctorRate; + String? projectBottomName; + String? projectTopName; DoctorList( {this.clinicID, @@ -90,7 +92,9 @@ class DoctorList { this.speciality, this.specialityN, this.workingHours, - this.decimalDoctorRate}); + this.decimalDoctorRate, + this.projectBottomName, + this.projectTopName}); DoctorList.fromJson(Map json) { clinicID = json['ClinicID']; @@ -138,6 +142,8 @@ class DoctorList { if (json.containsKey('SpecialityN') && json['SpecialityN'] != null) specialityN = json['SpecialityN'].cast(); workingHours = json['WorkingHours']; decimalDoctorRate = json['DecimalDoctorRate']; + projectBottomName = json['ProjectNameBottom']; + projectTopName = json['ProjectNameTop']; } Map toJson() { @@ -188,6 +194,10 @@ class DoctorList { data['DecimalDoctorRate'] = this.decimalDoctorRate; return data; } + + String getProjectCompleteName(){ + return "${this.projectTopName} ${this.projectBottomName}"; + } } class PatientDoctorAppointmentList { diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index 0cd0da0f..c7989cbf 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -79,13 +79,12 @@ class _SearchState extends State with TickerProviderStateMixin { letterSpacing: -0.48, ), tabs: [ - Text( - TranslationBase.of(context).clinicName, + TranslationBase.of(context).hospitalName, style: TextStyle(fontSize: 12), ), Text( - TranslationBase.of(context).hospitalName, + TranslationBase.of(context).clinicName, style: TextStyle(fontSize: 12), ), Text( @@ -112,8 +111,8 @@ class _SearchState extends State with TickerProviderStateMixin { child: TabBarView( physics: NeverScrollableScrollPhysics(), children: [ - SearchByClinic(clnicIds: widget.clnicIds), SearchByHospital(), + SearchByClinic(clnicIds: widget.clnicIds), SearchByDoctor(), ], controller: _tabController, diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 849a0afc..f89b6349 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -656,7 +656,7 @@ class _SearchByClinicState extends State { _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element); } else { _patientDoctorAppointmentListHospital - .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); + .add(PatientDoctorAppointmentList(filterName: element.getProjectCompleteName(), distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); } }); } else {} diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index f5c98d87..55f1a31d 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -111,7 +111,7 @@ class _SearchByDoctorState extends State { _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element); } else { _patientDoctorAppointmentListHospital - .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); + .add(PatientDoctorAppointmentList(filterName: element.getProjectCompleteName(), distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); } }); } else { diff --git a/lib/pages/BookAppointment/components/search_by_hospital_name.dart b/lib/pages/BookAppointment/components/search_by_hospital_name.dart index 3de28dff..d6315e35 100644 --- a/lib/pages/BookAppointment/components/search_by_hospital_name.dart +++ b/lib/pages/BookAppointment/components/search_by_hospital_name.dart @@ -70,16 +70,11 @@ class _SearchByHospitalState extends State { value: nearestAppo, onChanged: (bool? value) { nearestAppo = value ?? false; - setState(() { - - }); + setState(() {}); }, ), AutoSizeText( - TranslationBase - .of(context) - .nearestAppo - .trim(), + TranslationBase.of(context).nearestAppo.trim(), maxLines: 1, minFontSize: 10, style: TextStyle( @@ -93,14 +88,12 @@ class _SearchByHospitalState extends State { ], ), ), - mHeight(8), Container( width: double.infinity, decoration: containerRadius(Colors.white, 12), margin: EdgeInsets.only(left: 20, right: 20), - padding: - EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), + padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), child: Row( children: [ Flexible( @@ -108,9 +101,7 @@ class _SearchByHospitalState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - TranslationBase - .of(context) - .selectHospital, + TranslationBase.of(context).selectHospital, style: TextStyle( fontSize: 11, letterSpacing: -0.44, @@ -123,9 +114,7 @@ class _SearchByHospitalState extends State { child: DropdownButtonHideUnderline( child: DropdownButton( hint: Text( - TranslationBase - .of(context) - .selectHospital), + TranslationBase.of(context).selectHospital), value: selectedHospital, iconSize: 0, isExpanded: true, @@ -141,8 +130,7 @@ class _SearchByHospitalState extends State { maxLines: 1, minFontSize: 10, style: TextStyle( - fontSize: - SizeConfig.textMultiplier! * 1.6, + fontSize: SizeConfig.textMultiplier! * 1.6, fontWeight: FontWeight.w600, letterSpacing: -0.39, height: 0.8, @@ -151,7 +139,7 @@ class _SearchByHospitalState extends State { // Text('${item.name!}'), ); }).toList(), - onChanged: (HospitalsModel? newValue){ + onChanged: (HospitalsModel? newValue) { getClinicWrtHospital(newValue); setState(() { selectedHospital = newValue; @@ -172,29 +160,28 @@ class _SearchByHospitalState extends State { onTap: () { showClickListDialog(context, clinicIds ?? List.empty(), onSelection: (ListClinicCentralized clincs) { - selectedClinic = clincs; - Navigator.pop(context); - setState(() { - dropdownTitle = clincs.clinicDescription!; - dropdownValue = clincs.clinicID.toString() + + selectedClinic = clincs; + Navigator.pop(context); + setState(() { + dropdownTitle = clincs.clinicDescription!; + dropdownValue = clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + - clincs.liveCareServiceID.toString( - ); - }); - getDoctorsList(context); - - context - .read() - .analytics - .appointment - .book_appointment_select_clinic( + clincs.liveCareServiceID.toString(); + }); + getDoctorsList(context); + + context + .read() + .analytics + .appointment + .book_appointment_select_clinic( appointment_type: 'regular', clinic: clincs.clinicDescription); - }); + }); }, child: Container( width: double.infinity, @@ -208,9 +195,7 @@ class _SearchByHospitalState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - TranslationBase - .of(context) - .selectClinic, + TranslationBase.of(context).selectClinic, style: TextStyle( fontSize: 11, letterSpacing: -0.44, @@ -264,9 +249,7 @@ class _SearchByHospitalState extends State { getProjectsList() { GifLoaderDialogUtils.showMyDialog(context); - int languageID = context - .read() - .isArabic ? 1 : 2; + int languageID = context.read().isArabic ? 1 : 2; ClinicListService service = new ClinicListService(); List projectsListLocal = []; service.getProjectsList(languageID, context).then((res) { @@ -289,7 +272,6 @@ class _SearchByHospitalState extends State { }); } - void getClinicWrtHospital(HospitalsModel? newValue) async { GifLoaderDialogUtils.showMyDialog(context); ClinicListService service = new ClinicListService(); @@ -299,43 +281,33 @@ class _SearchByHospitalState extends State { }); List clinicId = []; try { - Map res = await service - .getClinicB - - yHospital( + Map res = await service.getClinicByHospital( projectID: newValue?.mainProjectID.toString() ?? ""); GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { List list = res['ListClinic']; if (list.isEmpty) { - AppToast.showErrorToast(message: - TranslationBase - .of(context) - .NoClinicFound, + AppToast.showErrorToast( + message: TranslationBase.of(context).NoClinicFound, ); } res['ListClinic'].forEach((v) { clinicId.add(ListClinicCentralized.fromJson(v)); }); clinicIds = clinicId; - setState(() { - - }); + setState(() {}); } else { - AppToast.showErrorToast(message: - TranslationBase - .of(context) - .NoClinicFound, + AppToast.showErrorToast( + message: TranslationBase.of(context).NoClinicFound, ); } } catch (e) { print("the error is $e"); - AppToast.showErrorToast(message: - TranslationBase.of(context).NoClinicFound, - ); - GifLoaderDialogUtils.hideDialog(context); - + AppToast.showErrorToast( + message: TranslationBase.of(context).NoClinicFound, + ); + GifLoaderDialogUtils.hideDialog(context); } // .then((res) { @@ -383,8 +355,8 @@ class _SearchByHospitalState extends State { super.dispose(); } - Future navigateToDentalComplaints(BuildContext context, - SearchInfo searchInfo) async { + Future navigateToDentalComplaints( + BuildContext context, SearchInfo searchInfo) async { Navigator.push( context, FadePage( @@ -400,9 +372,7 @@ class _SearchByHospitalState extends State { } callDoctorsSearchAPI(int clinicID) { - int languageID = context - .read() - .isArabic ? 1 : 2; + int languageID = context.read().isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; List arr = []; @@ -410,18 +380,18 @@ class _SearchByHospitalState extends State { List result; int numAll; List _patientDoctorAppointmentListHospital = - []; + []; DoctorsListService service = new DoctorsListService(); service .getDoctorsList( - clinicID, - selectedHospital?.mainProjectID.toString() != "" - ? int.parse(selectedHospital?.mainProjectID.toString() ?? "-1") - : 0, - nearestAppo, - languageID, - null) + clinicID, + selectedHospital?.mainProjectID.toString() != "" + ? int.parse(selectedHospital?.mainProjectID.toString() ?? "-1") + : 0, + nearestAppo, + languageID, + null) .then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { @@ -429,29 +399,29 @@ class _SearchByHospitalState extends State { if (res['DoctorList'].length != 0) { doctorsList.clear(); res['DoctorList'].forEach((v) { - doctorsList.add( DoctorList.fromJson(v)); + doctorsList.add(DoctorList.fromJson(v)); }); doctorsList.forEach((element) { List doctorByHospital = - _patientDoctorAppointmentListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); + _patientDoctorAppointmentListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); if (doctorByHospital.length != 0) { _patientDoctorAppointmentListHospital[ - _patientDoctorAppointmentListHospital - .indexOf(doctorByHospital[0])] + _patientDoctorAppointmentListHospital + .indexOf(doctorByHospital[0])] .patientDoctorAppointmentList! .add(element); } else { _patientDoctorAppointmentListHospital.add( PatientDoctorAppointmentList( - filterName: element.projectName, + filterName: element.getProjectCompleteName(), distanceInKMs: - element.projectDistanceInKiloMeters.toString(), + element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); } }); @@ -472,27 +442,26 @@ class _SearchByHospitalState extends State { }); } - Future navigateToSearchResults(context, + Future navigateToSearchResults( + context, List docList, List - patientDoctorAppointmentListHospital) async { + patientDoctorAppointmentListHospital) async { Navigator.push( - context, - FadePage( - page: SearchResults( - isLiveCareAppointment: false, - doctorsList: docList, - patientDoctorAppointmentListHospital: - patientDoctorAppointmentListHospital))) + context, + FadePage( + page: SearchResults( + isLiveCareAppointment: false, + doctorsList: docList, + patientDoctorAppointmentListHospital: + patientDoctorAppointmentListHospital))) .then((value) { print("navigation return "); dropdownValue = null; dropdownTitle = ""; selectedHospital = null; clinicIds = List.empty(); - setState(() { - - }); + setState(() {}); // getProjectsList(); }); } @@ -522,13 +491,8 @@ class _SearchByHospitalState extends State { searchInfo.clinic = selectedClinic; searchInfo.date = DateTime.now(); - if (context - .read() - .isLogin) { - if (context - .read() - .user - .age! > 12) { + if (context.read().isLogin) { + if (context.read().user.age! > 12) { navigateToDentalComplaints(context, searchInfo); } else { callDoctorsSearchAPI(17); @@ -540,9 +504,9 @@ class _SearchByHospitalState extends State { navigateToLaserClinic(context); // callDoctorsSearchAPI(); } else if (dropdownValue!.split("-")[1] == "true" - // && authProvider.isLogin && - // authUser.patientType == 1 - ) { + // && authProvider.isLogin && + // authUser.patientType == 1 + ) { Navigator.push( context, FadePage( @@ -564,9 +528,7 @@ class _SearchByHospitalState extends State { callDoctorsSearchAPI(int.parse(dropdownValue!.split("-")[0])); } }); - setState(() { - - }); + setState(() {}); } else { callDoctorsSearchAPI(int.parse(dropdownValue!.split("-")[0])); } From 34ffec93fda21e740cdd22ddf7ea8970872baf0c Mon Sep 17 00:00:00 2001 From: "taha.alam" Date: Sun, 20 Oct 2024 12:59:48 +0300 Subject: [PATCH 04/11] WD: calender issue fixed. --- lib/pages/BookAppointment/widgets/reminder_dialog.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/pages/BookAppointment/widgets/reminder_dialog.dart b/lib/pages/BookAppointment/widgets/reminder_dialog.dart index a16876db..b3c39861 100644 --- a/lib/pages/BookAppointment/widgets/reminder_dialog.dart +++ b/lib/pages/BookAppointment/widgets/reminder_dialog.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; @@ -44,10 +45,10 @@ showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, S } } -Future _showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted, +Future _showReminderDialog(BuildContext providedContext, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted, {required Function onSuccess, String? title, String? description, Function(int)? onMultiDateSuccess, bool? isMultiAllowed}) async { return showDialog( - context: context, + context: providedContext, barrierDismissible: true, // user must tap button! builder: (BuildContext context) { return Dialog( @@ -81,7 +82,7 @@ Future _showReminderDialog(BuildContext context, DateTime dateTime, String if (onMultiDateSuccess == null) { CalendarUtils calendarUtils = await CalendarUtils.getInstance(); await calendarUtils.createOrUpdateEvent( - title: title ?? TranslationBase.of(context).reminderTitle + " " + doctorName, + title: title ?? TranslationBase.of(providedContext).reminderTitle + " " + doctorName, description: description ?? "At " + appoDateFormatted + " " + appoTimeFormatted, scheduleDateTime: dateTime, eventId: eventId); From 7ddd932c5121c247ad3aee7640e7dc013c498247 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 20 Oct 2024 15:03:14 +0300 Subject: [PATCH 05/11] no message --- lib/config/config.dart | 4 ++-- lib/core/viewModels/project_view_model.dart | 2 +- lib/pages/BookAppointment/components/SearchByClinic.dart | 2 +- lib/pages/BookAppointment/components/SearchByDoctor.dart | 2 +- .../BookAppointment/components/search_by_hospital_name.dart | 6 ++++-- lib/pages/conference/zoom/call_screen.dart | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 6f4ccaef..f223ab40 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -22,14 +22,14 @@ 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://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'http://10.20.200.111:1010/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; -// var BASE_URL = 'https://webservices.hmg.com/'; +var BASE_URL = 'https://webservices.hmg.com/'; // var BASE_URL = 'http://10.50.100.198:4422/'; diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index d4707aa9..57362d6f 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -48,7 +48,7 @@ class ProjectViewModel extends BaseViewModel { GetAdmissionInfoResponseModel getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel(); GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel(); - bool isIndoorNavigationEnabled = false; + bool isIndoorNavigationEnabled = true; int waitingAppointmentProjectID = 0; DoctorList? waitingAppointmentDoctor; diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index f89b6349..f9cc30b4 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -648,7 +648,7 @@ class _SearchByClinicState extends State { doctorsList.forEach((element) { List doctorByHospital = _patientDoctorAppointmentListHospital .where( - (elementClinic) => elementClinic.filterName == element.projectName, + (elementClinic) => elementClinic.filterName == element.getProjectCompleteName(), ) .toList(); diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 55f1a31d..bc17a2ca 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -105,7 +105,7 @@ class _SearchByDoctorState extends State { }); doctorsList.forEach((element) { - List doctorByHospital = _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList(); + List doctorByHospital = _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.getProjectCompleteName()).toList(); if (doctorByHospital.length != 0) { _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element); diff --git a/lib/pages/BookAppointment/components/search_by_hospital_name.dart b/lib/pages/BookAppointment/components/search_by_hospital_name.dart index d6315e35..7c5d4542 100644 --- a/lib/pages/BookAppointment/components/search_by_hospital_name.dart +++ b/lib/pages/BookAppointment/components/search_by_hospital_name.dart @@ -366,6 +366,7 @@ class _SearchByHospitalState extends State { setState(() { dropdownValue = null; selectedHospital = null; + dropdownTitle = ""; clinicIds = List.empty(); }); }); @@ -406,7 +407,7 @@ class _SearchByHospitalState extends State { _patientDoctorAppointmentListHospital .where( (elementClinic) => - elementClinic.filterName == element.projectName, + elementClinic.filterName == element.getProjectCompleteName(), ) .toList(); @@ -477,6 +478,7 @@ class _SearchByHospitalState extends State { setState(() { dropdownValue = null; selectedHospital = null; + dropdownTitle = ""; clinicIds = List.empty(); }); }); @@ -485,7 +487,7 @@ class _SearchByHospitalState extends State { getDoctorsList(BuildContext context) { SearchInfo searchInfo = new SearchInfo(); if (dropdownValue != null) if (dropdownValue!.split("-")[0] == "17") { - searchInfo.ProjectID = int.parse(selectedHospital?.mainProjectID ?? ""); + searchInfo.ProjectID = int.parse(selectedHospital?.mainProjectID.toString() ?? ""); searchInfo.ClinicID = int.parse(dropdownValue!.split("-")[0]); searchInfo.hospital = selectedHospital; searchInfo.clinic = selectedClinic; diff --git a/lib/pages/conference/zoom/call_screen.dart b/lib/pages/conference/zoom/call_screen.dart index 2ba0e49e..74a87ad2 100644 --- a/lib/pages/conference/zoom/call_screen.dart +++ b/lib/pages/conference/zoom/call_screen.dart @@ -472,7 +472,7 @@ class _CallScreenState extends State { ], ), ); - if (errorType == Errors.SessionJoinFailed || errorType == Errors.SessionDisconncting) { + if (errorType == Errors.SessionJoinFailed || errorType == Errors.SessionDisconnecting) { Timer( const Duration(milliseconds: 1000), () => Navigator.pop(context), From cee903dd6bb794d55357f2c19ae358a0f0af6c8c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 20 Oct 2024 17:02:38 +0300 Subject: [PATCH 06/11] changes for the hospital gesture clicked area and nearest check not showing the hospital dropdown area --- lib/core/viewModels/project_view_model.dart | 2 +- .../components/SearchByClinic.dart | 2 + .../components/search_by_hospital_name.dart | 143 ++++++++++-------- lib/uitl/CalendarUtils.dart | 28 ++-- 4 files changed, 104 insertions(+), 71 deletions(-) diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 57362d6f..d4707aa9 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -48,7 +48,7 @@ class ProjectViewModel extends BaseViewModel { GetAdmissionInfoResponseModel getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel(); GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel(); - bool isIndoorNavigationEnabled = true; + bool isIndoorNavigationEnabled = false; int waitingAppointmentProjectID = 0; DoctorList? waitingAppointmentDoctor; diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index f9cc30b4..a113e81b 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -1,6 +1,7 @@ import "dart:collection"; import 'package:auto_size_text/auto_size_text.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; @@ -95,6 +96,7 @@ class _SearchByClinicState extends State { @override Widget build(BuildContext context) { + AppGlobal.context = context; return Container( child: SingleChildScrollView( child: Column( diff --git a/lib/pages/BookAppointment/components/search_by_hospital_name.dart b/lib/pages/BookAppointment/components/search_by_hospital_name.dart index 7c5d4542..72503cb4 100644 --- a/lib/pages/BookAppointment/components/search_by_hospital_name.dart +++ b/lib/pages/BookAppointment/components/search_by_hospital_name.dart @@ -89,71 +89,77 @@ class _SearchByHospitalState extends State { ), ), mHeight(8), - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - margin: EdgeInsets.only(left: 20, right: 20), - padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), - child: Row( - children: [ - Flexible( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).selectHospital, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, + InkWell( + onTap: () { + openDropdown(projectDropdownKey); + }, + child: Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + margin: EdgeInsets.only(left: 20, right: 20), + padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), + child: Row( + children: [ + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).selectHospital, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), ), - ), - Container( - height: 18, - width: double.infinity, - child: DropdownButtonHideUnderline( - child: DropdownButton( - hint: Text( - TranslationBase.of(context).selectHospital), - value: selectedHospital, - iconSize: 0, - isExpanded: true, - style: TextStyle( - fontSize: 14, - letterSpacing: -0.56, - color: Colors.black), - items: projectsList.map((HospitalsModel item) { - return DropdownMenuItem( - value: item, - child: AutoSizeText( - item.name!, - maxLines: 1, - minFontSize: 10, - style: TextStyle( - fontSize: SizeConfig.textMultiplier! * 1.6, - fontWeight: FontWeight.w600, - letterSpacing: -0.39, - height: 0.8, + Container( + height: 18, + width: double.infinity, + child: DropdownButtonHideUnderline( + child: DropdownButton( + key: projectDropdownKey, + hint: Text( + TranslationBase.of(context).selectHospital), + value: selectedHospital, + iconSize: 0, + isExpanded: true, + style: TextStyle( + fontSize: 14, + letterSpacing: -0.56, + color: Colors.black), + items: projectsList.map((HospitalsModel item) { + return DropdownMenuItem( + value: item, + child: AutoSizeText( + item.name!, + maxLines: 1, + minFontSize: 10, + style: TextStyle( + fontSize: SizeConfig.textMultiplier! * 1.6, + fontWeight: FontWeight.w600, + letterSpacing: -0.39, + height: 0.8, + ), ), - ), - // Text('${item.name!}'), - ); - }).toList(), - onChanged: (HospitalsModel? newValue) { - getClinicWrtHospital(newValue); - setState(() { - selectedHospital = newValue; - }); - }, + // Text('${item.name!}'), + ); + }).toList(), + onChanged: (HospitalsModel? newValue) { + getClinicWrtHospital(newValue); + setState(() { + selectedHospital = newValue; + }); + }, + ), ), ), - ), - ], + ], + ), ), - ), - Icon(Icons.keyboard_arrow_down), - ], - )), + Icon(Icons.keyboard_arrow_down), + ], + )), + ), if (clinicIds?.isNotEmpty == true) ...[ mHeight(8), InkWell( @@ -228,8 +234,23 @@ class _SearchByHospitalState extends State { void openDropdown(GlobalKey key) { GestureDetector? detector; - detector = searchForGestureDetector(key.currentContext!); + + void searchForGestureDetector(BuildContext element) { + element.visitChildElements((element) { + if (element.widget != null && element.widget is GestureDetector) { + detector = element.widget as GestureDetector?; + //return false; + } else { + searchForGestureDetector(element); + } + + //return true; + }); + } + + searchForGestureDetector(key.currentContext!); assert(detector != null); + detector!.onTap!(); } diff --git a/lib/uitl/CalendarUtils.dart b/lib/uitl/CalendarUtils.dart index 57ec961a..cf67bb57 100644 --- a/lib/uitl/CalendarUtils.dart +++ b/lib/uitl/CalendarUtils.dart @@ -108,10 +108,10 @@ class CalendarUtils { TZDateTime scheduleDateTimeUTZ = TZDateTime.from(scheduleDateTime!, _currentLocation); - // print("writableCalendars-name: " + writableCalendars.name); - // print("writableCalendars-Id: " + writableCalendars.id); - // print("writableCalendarsToString: " + writableCalendars.toString()); - // print("writableCalendarsToString: " + writableCalendars!.id!); + print("writableCalendars-name: " + writableCalendars.name); + print("writableCalendars-Id: " + writableCalendars.id); + print("writableCalendarsToString: " + writableCalendars.toString()); + print("writableCalendarsToString: " + writableCalendars!.id!); Event event = Event( writableCalendars!.id, start: scheduleDateTimeUTZ, @@ -119,11 +119,21 @@ class CalendarUtils { title: title, description: description, ); - await deviceCalendarPlugin.createOrUpdateEvent(event).catchError((e) { - print("catchError " + e.toString()); - }).whenComplete(() { - print("whenComplete " + eventId!); - }); + + + if(Platform.isAndroid) { + Result result = await deviceCalendarPlugin.hasPermissions(); + print(result); + await deviceCalendarPlugin.createOrUpdateEvent(event).catchError((e) { + print("catchError " + e.toString()); + }).whenComplete(() { + print("whenComplete Calender ID " + eventId!); + }); + } + + + + } deleteEvent(Calendar _calendar, Event _event) async { From 073cb9f7e889590243745eafc0220c39f9319715 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 22 Oct 2024 16:22:27 +0300 Subject: [PATCH 07/11] Update to stores 16.5: 1. Indoor navigation 2. Walkin Appointment 3. Derma Package 4. NPHIES Eligibility --- lib/config/config.dart | 12 +-- lib/config/localized_values.dart | 4 +- lib/core/service/medical/medical_service.dart | 10 ++- lib/core/viewModels/project_view_model.dart | 2 +- .../widgets/AppointmentActions.dart | 4 +- lib/pages/ToDoList/ToDo.dart | 6 +- .../fragments/home_page_fragment2.dart | 4 +- lib/pages/landing/widgets/services_view.dart | 3 +- lib/uitl/penguin_method_channel.dart | 3 +- lib/uitl/translations_delegate_base.dart | 3 + lib/uitl/utils.dart | 4 +- .../dialogs/location_selection_dialog.dart | 79 ++++++------------- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- pubspec.yaml | 4 +- 14 files changed, 62 insertions(+), 80 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index f223ab40..d025d082 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -23,15 +23,15 @@ 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 = 'https://hmgwebservices.com/'; // var BASE_URL = 'http://10.20.200.111:1010/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; -var BASE_URL = 'https://webservices.hmg.com/'; +// var BASE_URL = 'https://webservices.hmg.com/'; -// var BASE_URL = 'http://10.50.100.198:4422/'; + // var BASE_URL = 'http://10.200.204.42/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -354,7 +354,7 @@ var CAN_PAY_FOR_FOR_WALKIN_APPOINTMENT = 'Services/Doctors.svc/REST/CanPayForWal var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 16.4; +var VERSION_ID = 16.5; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; @@ -611,9 +611,9 @@ var GET_DENTAL_APPOINTMENT_INVOICE = "Services/Patients.svc/REST/HIS_eInvoiceFor var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL = "Services/Notifications.svc/REST/SendInvoiceForDental"; -var GET_TAMARA_PLAN = 'https://mdlaboratories.com/tamara/Home/GetInstallments'; +var GET_TAMARA_PLAN = 'https://mdlaboratories.com/tamaralive/Home/GetInstallments'; -var GET_TAMARA_PAYMENT_STATUS = 'https://mdlaboratories.com/tamara/api/OnlineTamara/order_status?orderid='; +var GET_TAMARA_PAYMENT_STATUS = 'https://mdlaboratories.com/tamaralive/api/OnlineTamara/order_status?orderid='; var UPDATE_TAMARA_STATUS = 'Services/PayFort_Serv.svc/REST/Tamara_UpdateRequestStatus'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index b9a5a5ec..a962e009 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1994,5 +1994,7 @@ const Map localizedValues = { "addToWaitingList": {"en": "Add to waiting list", "ar": "اضافه الى قائمة الانتظار"}, "searchClinic": {"en": "Search Clinic", "ar": "بحث العيادة"}, "selectBranch":{"en":"Select Branch", "ar":"اختر الفرع"}, - "searchByBranch":{"en":"Search By Branch Name", "ar":"البحث عن طريق اسم الفرع"} + "searchByBranch":{"en":"Search By Branch Name", "ar":"البحث عن طريق اسم الفرع"}, + "hospitalNavigationTitle": {"en": "Hospital", "ar": "الملاحة"}, + "hospitalNavigationSubtitle": {"en": "Navigation", "ar": "المستشفى"}, }; diff --git a/lib/core/service/medical/medical_service.dart b/lib/core/service/medical/medical_service.dart index a77729c9..445f5ab6 100644 --- a/lib/core/service/medical/medical_service.dart +++ b/lib/core/service/medical/medical_service.dart @@ -72,11 +72,15 @@ class MedicalService extends BaseService { dynamic localRes; await baseAppClient.post(GET_DOCTOR_FREE_SLOTS, onSuccess: (response, statusCode) async { localRes = response; + freeSlots.clear(); + localRes['FreeTimeSlots'].forEach((item) => freeSlots.add(item)); }, onFailure: (String error, int statusCode) { - throw error; + hasError = true; + super.error = error; + // throw error; }, body: request); - freeSlots.clear(); - localRes['FreeTimeSlots'].forEach((item) => freeSlots.add(item)); + // freeSlots.clear(); + // localRes['FreeTimeSlots'].forEach((item) => freeSlots.add(item)); // localRes['List_DoctorWorkingHoursTable'].forEach((item) => // {doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item))}); } diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index d4707aa9..57362d6f 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -48,7 +48,7 @@ class ProjectViewModel extends BaseViewModel { GetAdmissionInfoResponseModel getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel(); GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel(); - bool isIndoorNavigationEnabled = false; + bool isIndoorNavigationEnabled = true; int waitingAppointmentProjectID = 0; DoctorList? waitingAppointmentDoctor; diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index fcb698b3..e7e7b1d0 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -191,8 +191,8 @@ class _AppointmentActionsState extends State { initPenguinSDK() async { NavigationClinicDetails data = NavigationClinicDetails(); - // data.clinicId = widget.appo.clinicID.toString(); - data.clinicId = "49"; + data.clinicId = widget.appo.clinicID.toString(); + // data.clinicId = "49"; data.patientId = widget.appo.patientID.toString(); data.projectId = widget.appo.projectID.toString(); final bool permited = await AppPermission.askPenguinPermissions(); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 2c7f89fc..6ab67f12 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -378,12 +378,12 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { ), ), ), - if (projectViewModel.isIndoorNavigationEnabled) + if (projectViewModel.isIndoorNavigationEnabled && projectViewModel.havePrivilege(107) && appoList[index].projectID == 130) InkWell( onTap: () { NavigationClinicDetails data = NavigationClinicDetails(); - // data.clinicId = appoList[index].clinicID.toString(); - data.clinicId = "46"; + data.clinicId = appoList[index].clinicID.toString(); + // data.clinicId = "46"; data.patientId = appoList[index].patientID.toString(); data.projectId = appoList[index].projectID.toString(); initPenguinSDK(data); diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 7711b4ff..a1e12240 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -54,7 +54,7 @@ class _HomePageFragment2State extends State { hmgServices.add(HmgServices(1, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); projectViewModel.isIndoorNavigationEnabled - ? hmgServices.add(HmgServices(2, "Hospital", "Navigation", "assets/images/new/indoor_nav_home.svg", isLogin)) + ? hmgServices.add(HmgServices(2, TranslationBase.of(context).hospitalNavigationTitle, TranslationBase.of(context).hospitalNavigationSubtitle, "assets/images/new/indoor_nav_home.svg", isLogin)) : hmgServices.add(HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); hmgServices.add(HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); @@ -346,7 +346,7 @@ class _HomePageFragment2State extends State { itemCount: hmgServices.length, padding: EdgeInsets.zero, itemBuilder: (BuildContext context, int index) { - return ServicesView(hmgServices[index], index, true, projectViewModel, isLocked: hmgServices[index].action == 2 ? !projectViewModel.havePrivilege(107) : false); + return ServicesView(hmgServices[index], index, true, projectViewModel, isLocked: (hmgServices[index].action == 2 && projectViewModel.isIndoorNavigationEnabled) ? !projectViewModel.havePrivilege(107) : false); }, ), ), diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart index c69f772c..e98855aa 100644 --- a/lib/pages/landing/widgets/services_view.dart +++ b/lib/pages/landing/widgets/services_view.dart @@ -195,6 +195,7 @@ class ServicesView extends StatelessWidget { showDialog( context: context, builder: (cxt) => LocationSelectionDialog( + isArabic: projectViewModel.isArabic, data: projectsListLocal, selectedIndex: _selectedHospitalIndex, onValueSelected: (index) { @@ -215,7 +216,7 @@ class ServicesView extends StatelessWidget { Permission.bluetoothScan, Permission.activityRecognition, ].request().whenComplete(() { - PenguinMethodChannel.launch("penguin", projectViewModel.isArabic ? "ar" : "en", "1231755"); + PenguinMethodChannel.launch("penguin", projectViewModel.isArabic ? "ar" : "en", projectViewModel.authenticatedUserObject.user.patientID.toString()); }); } // } diff --git a/lib/uitl/penguin_method_channel.dart b/lib/uitl/penguin_method_channel.dart index 12421f5e..f2d51573 100644 --- a/lib/uitl/penguin_method_channel.dart +++ b/lib/uitl/penguin_method_channel.dart @@ -17,7 +17,8 @@ class PenguinMethodChannel { "dataServiceName": "api", "positionServiceName": "pe", "clientID": "HMG", - "username": "test", + // "username": "test", + "username": username, "isSimulationModeEnabled": false, "isShowUserName": false, "isUpdateUserLocationSmoothly": true, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 87bb5f6f..db5033e2 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2983,6 +2983,9 @@ class TranslationBase { String get continueOrbookNew => localizedValues["continueOrbookNew"][locale.languageCode]; String get newAppointment => localizedValues["newAppointment"][locale.languageCode]; String get proceedPackage => localizedValues["proceedPackage"][locale.languageCode]; + + String get hospitalNavigationTitle => localizedValues["hospitalNavigationTitle"][locale.languageCode]; + String get hospitalNavigationSubtitle => localizedValues["hospitalNavigationSubtitle"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 01779851..1529d605 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -68,12 +68,12 @@ class Utils { static var navigationProjectsList = [ { "Desciption": "Sahafa Hospital", - "DesciptionN": null, + "DesciptionN": "مستشفى الصحافة", "ID": 130, "LegalName": "Sahafa Hospital", "LegalNameN": "مستشفى الصحافة", "Name": "Sahafa Hospital", - "NameN": null, + "NameN": "مستشفى الصحافة", "PhoneNumber": "+966115222222", "SetupID": "013311", "DistanceInKilometers": 0, diff --git a/lib/widgets/dialogs/location_selection_dialog.dart b/lib/widgets/dialogs/location_selection_dialog.dart index 9181615f..9ffb2635 100644 --- a/lib/widgets/dialogs/location_selection_dialog.dart +++ b/lib/widgets/dialogs/location_selection_dialog.dart @@ -10,12 +10,9 @@ class LocationSelectionDialog extends StatelessWidget { final List data; final Function(int)? onValueSelected; final int? selectedIndex; + final bool isArabic; - const LocationSelectionDialog( - {super.key, - required this.data, - this.onValueSelected, - this.selectedIndex}); + const LocationSelectionDialog({super.key, required this.data, this.onValueSelected, this.selectedIndex, required this.isArabic}); @override Widget build(BuildContext context) { @@ -25,6 +22,7 @@ class LocationSelectionDialog extends StatelessWidget { borderRadius: BorderRadius.circular(8), ), child: LocationDialogBody( + isArabic: isArabic, data: data, onValueSelected: onValueSelected, selectedIndex: selectedIndex, @@ -36,12 +34,9 @@ class LocationDialogBody extends StatefulWidget { final List data; final Function(int)? onValueSelected; final int? selectedIndex; + final bool isArabic; - const LocationDialogBody( - {super.key, - required this.data, - this.onValueSelected, - this.selectedIndex}); + const LocationDialogBody({super.key, required this.data, this.onValueSelected, this.selectedIndex, required this.isArabic}); @override State createState() => _LocationDialogBodyState(); @@ -55,6 +50,7 @@ class _LocationDialogBodyState extends State { Widget build(BuildContext context) { return isListVisible ? LocationListExpandedBody( + isArabic: widget.isArabic, data: widget.data, onItemClick: (data) { if (data.isEmpty) return; @@ -78,22 +74,19 @@ class _LocationDialogBodyState extends State { isListVisible = true; }); }, - selectedText: currentlySelected == -1 - ? "" - : widget.data[currentlySelected].name ?? ""); + selectedText: currentlySelected == -1 ? "" : widget.data[currentlySelected].name ?? ""); } } class LocationListExpandedBody extends StatefulWidget { final List data; final Function(String) onItemClick; + final bool isArabic; - const LocationListExpandedBody( - {super.key, required this.data, required this.onItemClick}); + const LocationListExpandedBody({super.key, required this.data, required this.onItemClick, required this.isArabic}); @override - State createState() => - _LocationListExpandedBodyState(); + State createState() => _LocationListExpandedBodyState(); } class _LocationListExpandedBodyState extends State { @@ -117,17 +110,16 @@ class _LocationListExpandedBodyState extends State { mainAxisSize: MainAxisSize.min, children: [ SelectBranchHeader(), - SizedBox(height: 8,), + SizedBox( + height: 8, + ), TextField( controller: controller, onChanged: (v) { tempListData.clear(); if (v.length > 0) { for (int i = 0; i < widget.data.length; i++) { - if (widget.data[i].name - ?.toLowerCase() - .contains(v.toLowerCase()) == - true) { + if (widget.data[i].name?.toLowerCase().contains(v.toLowerCase()) == true) { tempListData.add(widget.data[i]); } } @@ -140,7 +132,7 @@ class _LocationListExpandedBodyState extends State { hintStyle: TextStyle(fontSize: 12), hintText: TranslationBase.of(context).searchByBranch, suffixIcon: Icon(Icons.search), - contentPadding: EdgeInsets.symmetric(vertical: 9,horizontal: 14), + contentPadding: EdgeInsets.symmetric(vertical: 9, horizontal: 14), border: OutlineInputBorder( borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide( @@ -163,16 +155,11 @@ class _LocationListExpandedBodyState extends State { height: 24, child: InkWell( onTap: () { - widget - .onItemClick(tempListData[index].name ?? ""); + widget.onItemClick(tempListData[index].name ?? ""); }, child: Text( - "${tempListData[index].name ?? ""} ( ${tempListData[index].distanceInKilometers} km )", - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - color: Colors.black, - letterSpacing: -0.96), + "${widget.isArabic ? tempListData[index].nameN : tempListData[index].name ?? ""}", + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Colors.black, letterSpacing: -0.96), ), ), ), @@ -190,11 +177,7 @@ class LocationListWrapBody extends StatelessWidget { final VoidCallback? onTextBoxClicked; final String selectedText; - const LocationListWrapBody( - {super.key, - this.onConfirmClicked, - this.onTextBoxClicked, - required this.selectedText}); + const LocationListWrapBody({super.key, this.onConfirmClicked, this.onTextBoxClicked, required this.selectedText}); @override Widget build(BuildContext context) { @@ -203,7 +186,7 @@ class LocationListWrapBody extends StatelessWidget { child: Column( mainAxisSize: MainAxisSize.min, children: [ - SelectBranchHeader(), + SelectBranchHeader(), SizedBox( height: 24, ), @@ -213,21 +196,13 @@ class LocationListWrapBody extends StatelessWidget { }, title: Text( TranslationBase.of(context).selectBranch, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - color: Colors.black, - letterSpacing: -0.96), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Colors.black, letterSpacing: -0.96), ), subtitle: selectedText.isEmpty ? null : Text( selectedText, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w400, - color: Colors.black, - letterSpacing: -0.96), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w400, color: Colors.black, letterSpacing: -0.96), ), trailing: Icon( Icons.arrow_drop_down_outlined, @@ -262,19 +237,15 @@ class LocationListWrapBody extends StatelessWidget { } } -class SelectBranchHeader extends StatelessWidget{ +class SelectBranchHeader extends StatelessWidget { @override Widget build(BuildContext context) { - return Row( + return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( TranslationBase.of(context).selectBranch, - style: TextStyle( - fontSize: 24, - fontWeight: FontWeight.w600, - color: Colors.black, - letterSpacing: -0.96), + style: TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: Colors.black, letterSpacing: -0.96), ), InkWell( onTap: () { diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 6f61ac8a..ee68f743 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -38,9 +38,9 @@ class MyInAppBrowser extends InAppBrowser { static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS diff --git a/pubspec.yaml b/pubspec.yaml index 02c894e1..475a72f2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.065+4050065 +version: 4.5.067+4050067 environment: sdk: ">=3.0.0 <3.13.0" @@ -107,7 +107,7 @@ dependencies: flutter_svg: ^2.0.8 #Calendar Events - manage_calendar_events: ^2.0.3 + manage_calendar_events: 2.0.3 #InAppBrowser flutter_inappwebview: ^6.1.5 From 605f02afe2fec1025bd6a832787bdc18ad97706b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 24 Oct 2024 10:33:47 +0300 Subject: [PATCH 08/11] Sickleave CR updates & changes --- lib/config/localized_values.dart | 9 ++++-- lib/core/service/medical/labs_service.dart | 4 ++- .../sickleave_workplace_update_page.dart | 28 +++++++++++++------ lib/uitl/translations_delegate_base.dart | 6 ++-- 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a962e009..54fff1b7 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1872,8 +1872,13 @@ const Map localizedValues = { "insuranceClassName": {"en": "Insurance Class", "ar": "فئة التأمين"}, "insuranceRequestSubmit": {"en": "Your insurance update request has been submitted successfully.", "ar": "تم تقديم طلب تحديث التأمين الخاص بك بنجاح."}, "NFCNotSupported": {"en": "Your device does not support NFC. Please visit reception to Check-In", "ar": "جهازك لا يدعم NFC. يرجى زيارة مكتب الاستقبال لتسجيل الوصول"}, - "enter-workplace-name": {"en": "Please enter your workplace name:", "ar": "رجاء إدخال مكان العمل:"}, - "workplaceName": {"en": "Workplace name:", "ar": "مكان العمل:"}, + "enter-workplace-name": {"en": "Please enter your workplace details:", "ar": "الرجاء إدخال تفاصيل مكان عملك:"}, + + "workplaceName": {"en": "Workplace name English:", "ar": "مكان العمل انجليزي:"}, + "workplaceNameAr": {"en": "Workplace name Arabic:", "ar": "مكان العمل عربي:"}, + "occupationNameEn": {"en": "Occupation name English:", "ar": "مكان العمل انجليزي:"}, + "occupationNameAr": {"en": "Occupation name Arabic:", "ar": "مكان العمل عربي:"}, + "callLiveCareSupport": {"en": "Call LiveCare Support", "ar": "اتصل بدعم اللايف كير"}, "needApproval": { "en": "Your sick leave is under process in medical administration, you will be notified once approved.", diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 77ea728e..671cc90f 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -124,12 +124,14 @@ class LabsService extends BaseService { return Future.value(localRes); } - Future updateWorkplaceName(String workplaceName, String workplaceNameAR, int requestNumber, String setupID, int projectID) async { + Future updateWorkplaceName(String workplaceName, String workplaceNameAR, String occupation, String occupationAR, int requestNumber, String setupID, int projectID) async { hasError = false; Map body = Map(); body['Placeofwork'] = workplaceName; body['Placeofworkar'] = workplaceNameAR; + body['Occupation'] = occupation; + body['Occupationar'] = occupationAR; body['Req_ID'] = requestNumber; body['TargetSetupID'] = setupID; body['ProjectID'] = projectID; diff --git a/lib/pages/medical/sickleave_workplace_update_page.dart b/lib/pages/medical/sickleave_workplace_update_page.dart index 0e555bab..f818021f 100644 --- a/lib/pages/medical/sickleave_workplace_update_page.dart +++ b/lib/pages/medical/sickleave_workplace_update_page.dart @@ -25,6 +25,10 @@ class WorkplaceUpdatePage extends StatefulWidget { class _WorkplaceUpdatePageState extends State { TextEditingController workplaceName = new TextEditingController(); + + TextEditingController workplaceNameAr = new TextEditingController(); + TextEditingController occupationNameEn = new TextEditingController(); + TextEditingController occupationNameAr = new TextEditingController(); bool? _isButtonDisabled; ProjectViewModel? projectViewModel; @@ -66,7 +70,13 @@ class _WorkplaceUpdatePageState extends State { ), ), mHeight(8), - inputWidget(TranslationBase.of(context).workplaceName, "", workplaceName), + inputWidget(TranslationBase.of(context).workplaceName, "", workplaceName, FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]"))), + mHeight(8), + inputWidget(TranslationBase.of(context).workplaceNameAr, "", workplaceNameAr, FilteringTextInputFormatter.allow(RegExp("[ء-ي ]"))), + mHeight(8), + inputWidget(TranslationBase.of(context).occupationNameEn, "", occupationNameEn, FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]"))), + mHeight(8), + inputWidget(TranslationBase.of(context).occupationNameAr, "", occupationNameAr, FilteringTextInputFormatter.allow(RegExp("[ء-ي ]"))), ], ), ), @@ -83,7 +93,7 @@ class _WorkplaceUpdatePageState extends State { height: 50, elevation: 0, color: CustomColors.accentColor, - disabledColor:Colors.grey.withOpacity(0.25), + disabledColor: Colors.grey.withOpacity(0.25), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), child: Text( TranslationBase.of(context).submit, @@ -94,10 +104,11 @@ class _WorkplaceUpdatePageState extends State { ), ), onPressed: () { - if (_isButtonDisabled == false) + // if (_isButtonDisabled == false) + if (workplaceName.text.isNotEmpty && workplaceNameAr.text.isNotEmpty && occupationNameEn.text.isNotEmpty && occupationNameAr.text.isNotEmpty) updateWorkplaceNameDialog(); else - AppToast.showErrorToast(message: TranslationBase.of(context).enterWorkplaceName); + AppToast.showErrorToast(message: TranslationBase.of(context).enterDetailBelow); }, ), ), @@ -109,7 +120,7 @@ class _WorkplaceUpdatePageState extends State { ); } - Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) { + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, TextInputFormatter inputFormatter, {String? prefix, bool isEnable = true, bool hasSelection = false}) { return Container( padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), alignment: Alignment.center, @@ -145,7 +156,8 @@ class _WorkplaceUpdatePageState extends State { keyboardType: TextInputType.name, controller: _controller, inputFormatters: [ - projectViewModel!.isArabic ? FilteringTextInputFormatter.allow(RegExp("[ء-ي ]")) : FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]")), + // projectViewModel!.isArabic ? FilteringTextInputFormatter.allow(RegExp("[ء-ي ]")) : FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]")), + inputFormatter ], onChanged: (value) => {_onPassportTextChanged(value)}, style: TextStyle( @@ -226,9 +238,7 @@ class _WorkplaceUpdatePageState extends State { LabsService service = new LabsService(); GifLoaderDialogUtils.showMyDialog(context); - service - .updateWorkplaceName(projectViewModel!.isArabic ? "-" : workplaceName.text, projectViewModel!.isArabic ? workplaceName.text : "-", widget.requestNumber, widget.setupID, widget.projectID) - .then((res) { + service.updateWorkplaceName(workplaceName.text, workplaceNameAr.text, occupationNameEn.text, occupationNameAr.text, widget.requestNumber, widget.setupID, widget.projectID).then((res) { GifLoaderDialogUtils.hideDialog(context); Navigator.of(context).pop(true); }).catchError((err) { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index db5033e2..be20b67a 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2978,14 +2978,16 @@ class TranslationBase { String get searchClinic => localizedValues["searchClinic"][locale.languageCode]; String get selectBranch => localizedValues["selectBranch"][locale.languageCode]; String get searchByBranch => localizedValues["searchByBranch"][locale.languageCode]; - String get existingPackage => localizedValues["existingPackage"][locale.languageCode]; String get continueOrbookNew => localizedValues["continueOrbookNew"][locale.languageCode]; String get newAppointment => localizedValues["newAppointment"][locale.languageCode]; String get proceedPackage => localizedValues["proceedPackage"][locale.languageCode]; - String get hospitalNavigationTitle => localizedValues["hospitalNavigationTitle"][locale.languageCode]; String get hospitalNavigationSubtitle => localizedValues["hospitalNavigationSubtitle"][locale.languageCode]; + + String get workplaceNameAr => localizedValues["workplaceNameAr"][locale.languageCode]; + String get occupationNameEn => localizedValues["occupationNameEn"][locale.languageCode]; + String get occupationNameAr => localizedValues["occupationNameAr"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From c6ee01c65206c49f2acda9a234e4562adbea1027 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 28 Oct 2024 10:50:42 +0300 Subject: [PATCH 09/11] Waiting appointment bug fix --- .../components/DocAvailableAppointments.dart | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index d44eee92..6bef82b9 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -280,23 +280,27 @@ class _DocAvailableAppointmentsState extends State wit selectedDateJSON = freeSlotsResponse[0]; }); openTimeSlotsPickerForDate( - (isLiveCareSchedule != null && isLiveCareSchedule) + isWaitingAppointmentAvailable + ? DateTime.now() + : (isLiveCareSchedule != null && isLiveCareSchedule) + ? DateUtil.convertStringToDate(selectedDateJSON) + : DateUtil.convertStringToDateSaudiTimezone( + selectedDateJSON, + int.parse( + widget.doctor.projectID.toString(), + ), + ), + docFreeSlots); + _calendarController.selectedDate = isWaitingAppointmentAvailable + ? DateTime.now() + : (isLiveCareSchedule != null && isLiveCareSchedule) ? DateUtil.convertStringToDate(selectedDateJSON) : DateUtil.convertStringToDateSaudiTimezone( selectedDateJSON, int.parse( widget.doctor.projectID.toString(), ), - ), - docFreeSlots); - _calendarController.selectedDate = (isLiveCareSchedule != null && isLiveCareSchedule) - ? DateUtil.convertStringToDate(selectedDateJSON) - : DateUtil.convertStringToDateSaudiTimezone( - selectedDateJSON, - int.parse( - widget.doctor.projectID.toString(), - ), - ); + ); _calendarController.displayDate = _calendarController.selectedDate; return _eventsParsed; } @@ -360,16 +364,16 @@ class _DocAvailableAppointmentsState extends State wit freeSlotsResponse = res['FreeTimeSlots']; _getJSONSlots().then((value) { setState(() { - _events.clear(); - _events = value; - if (widget.doctorSchedule != null) - { - _onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date'])); - _calendarController.selectedDate = DateUtil.convertStringToDate( - widget.doctorSchedule['Date'], - ); - }; - }); + _events.clear(); + _events = value; + if (widget.doctorSchedule != null) { + _onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date'])); + _calendarController.selectedDate = DateUtil.convertStringToDate( + widget.doctorSchedule['Date'], + ); + } + ; + }); }); } else { DocAvailableAppointments.areAppointmentsAvailable = false; From 3071a20b8a292f4cd8970ea07a18dfe175721516 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 29 Oct 2024 11:46:46 +0300 Subject: [PATCH 10/11] VIDA 4 package booking update --- .../Appointments/PatientPackageComponent.dart | 15 +++++---------- .../appointment_services/GetDoctorsList.dart | 3 ++- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/models/Appointments/PatientPackageComponent.dart b/lib/models/Appointments/PatientPackageComponent.dart index 31163cc7..26ce9229 100644 --- a/lib/models/Appointments/PatientPackageComponent.dart +++ b/lib/models/Appointments/PatientPackageComponent.dart @@ -15,8 +15,7 @@ class PatientPackageComponent { Map toJson() { final Map data = new Map(); if (this.patientPackageComponents != null) { - data['PatientPackageComponents'] = - this.patientPackageComponents!.map((v) => v.toJson()).toList(); + data['PatientPackageComponents'] = this.patientPackageComponents!.map((v) => v.toJson()).toList(); } return data; } @@ -30,15 +29,9 @@ class PatientPackageComponents { int? projectID; int? sequence; String? setupID; + num? invoiceNo_VP; - PatientPackageComponents( - {this.invoiceNo, - this.lineItemNo, - this.procedureID, - this.procedureName, - this.projectID, - this.sequence, - this.setupID}); + PatientPackageComponents({this.invoiceNo, this.lineItemNo, this.procedureID, this.procedureName, this.projectID, this.sequence, this.setupID, this.invoiceNo_VP}); PatientPackageComponents.fromJson(Map json) { invoiceNo = json['InvoiceNo']; @@ -48,6 +41,7 @@ class PatientPackageComponents { projectID = json['ProjectID']; sequence = json['Sequence']; setupID = json['SetupID']; + invoiceNo_VP = json['InvoiceNo_VP']; } Map toJson() { @@ -59,6 +53,7 @@ class PatientPackageComponents { data['ProjectID'] = this.projectID; data['Sequence'] = this.sequence; data['SetupID'] = this.setupID; + data['InvoiceNo_VP'] = this.invoiceNo_VP; return data; } } diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 9e4bdaa8..35b6d163 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -387,7 +387,7 @@ class DoctorsListService extends BaseService { } Future insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, int languageID, BuildContext context, - [String? procedureID, num? testTypeEnum, num? testProcedureEnum, ProjectViewModel? projectViewModel, int? invoiceNumber, int? lineItemNo]) async { + [String? procedureID, num? testTypeEnum, num? testProcedureEnum, ProjectViewModel? projectViewModel, int? invoiceNumber, int? lineItemNo, String? invoiceNoVP]) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -428,6 +428,7 @@ class DoctorsListService extends BaseService { "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType, "InvoiceNo": invoiceNumber, + "InvoiceNo_VP": invoiceNoVP, "LineItemNo": lineItemNo, // "TokenID":"@dm!n" }; From 3d44aa2e64c3eaa1092e1e01e2a1b1f65cc6dd1a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 3 Nov 2024 16:20:44 +0300 Subject: [PATCH 11/11] Sickleave updates --- android/app/src/main/AndroidManifest.xml | 5 +- lib/config/config.dart | 14 +++--- lib/config/localized_values.dart | 47 ++++++++++++------- lib/core/service/medical/labs_service.dart | 5 +- lib/core/viewModels/project_view_model.dart | 2 +- .../SmartWatch/WeeklyHeartRateResModel.dart | 2 +- .../SmartWatch/YearlyHeartRateResModel.dart | 2 +- lib/pages/BookAppointment/BookConfirm.dart | 14 +++--- .../components/DocAvailableAppointments.dart | 4 +- .../sickleave_workplace_update_page.dart | 12 +++-- .../distance/distanceTracker.dart | 4 +- .../steps/stepsTracker.dart | 4 +- .../rate_appointment_clinic.dart | 2 +- .../payfort_services/payfort_service.dart | 20 ++++---- lib/theme/colors.dart | 1 + lib/uitl/penguin_method_channel.dart | 2 +- pubspec.yaml | 3 +- 17 files changed, 82 insertions(+), 61 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 58ac88b7..64d3eed4 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -34,9 +34,8 @@ - - - + + diff --git a/lib/config/config.dart b/lib/config/config.dart index d025d082..53b28a48 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -22,8 +22,8 @@ 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 = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'http://10.20.200.111:1010/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; @@ -354,7 +354,7 @@ var CAN_PAY_FOR_FOR_WALKIN_APPOINTMENT = 'Services/Doctors.svc/REST/CanPayForWal var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 16.5; +var VERSION_ID = 16.7; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; @@ -680,10 +680,10 @@ var INSERT_WALKIN_APPOINTMENT = "Services/Doctors.svc/REST/InsertWalkinAppointme //PAYFORT var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails"; var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse"; -var payFortEnvironment = FortEnvironment.production; -var applePayMerchantId = "merchant.com.hmgwebservices"; -// var payFortEnvironment = FortEnvironment.test; -// var applePayMerchantId = "merchant.com.hmgwebservices.uat"; +// var payFortEnvironment = FortEnvironment.production; +// var applePayMerchantId = "merchant.com.hmgwebservices"; +var payFortEnvironment = FortEnvironment.test; +var applePayMerchantId = "merchant.com.hmgwebservices.uat"; class AppGlobal { static var context; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 54fff1b7..546c2aeb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1874,10 +1874,11 @@ const Map localizedValues = { "NFCNotSupported": {"en": "Your device does not support NFC. Please visit reception to Check-In", "ar": "جهازك لا يدعم NFC. يرجى زيارة مكتب الاستقبال لتسجيل الوصول"}, "enter-workplace-name": {"en": "Please enter your workplace details:", "ar": "الرجاء إدخال تفاصيل مكان عملك:"}, - "workplaceName": {"en": "Workplace name English:", "ar": "مكان العمل انجليزي:"}, - "workplaceNameAr": {"en": "Workplace name Arabic:", "ar": "مكان العمل عربي:"}, - "occupationNameEn": {"en": "Occupation name English:", "ar": "مكان العمل انجليزي:"}, - "occupationNameAr": {"en": "Occupation name Arabic:", "ar": "مكان العمل عربي:"}, + // "workplaceName": {"en": "Workplace name:", "ar": "مكان العمل:"}, + "workplaceName": {"en": "Workplace name English", "ar": "مكان العمل انجليزي:"}, + "workplaceNameAr": {"en": "Workplace name Arabic *", "ar": "مكان العمل عربي:"}, + "occupationNameEn": {"en": "Occupation name English", "ar": "مكان العمل انجليزي:"}, + "occupationNameAr": {"en": "Occupation name Arabic *", "ar": "مكان العمل عربي:"}, "callLiveCareSupport": {"en": "Call LiveCare Support", "ar": "اتصل بدعم اللايف كير"}, "needApproval": { @@ -1950,8 +1951,15 @@ const Map localizedValues = { "generalInstructions": {"en": "General Instructions:", "ar": "تعليمات عامة:"}, "copyLink": {"en": "COPY LINK", "ar": "نسخ الوصلة:"}, "paymentLinkCopied": {"en": "Payment link copied to your clipboard!'", "ar": "تم نسخ رابط الدفع إلى الحافظة الخاصة بك!"}, - "copyLinkTxt": {"en": "Or you can copy the payment link from below & send it to someone who can pay on your behalf: ", "ar": "أو يمكنك نسخ رابط الدفع من الأسفل وإرساله إلى شخص يمكنه الدفع نيابة عنك:"}, - "proErrorMessage": {"en": "Dear patient, Our staff is currently out of office, please note that our working hours are from 7:00 AM to 10:00 PM, and we'd love to help you during that time, or you can call ", "ar": "عزيزي المريض ، طاقم العمل لدينا خارج المكتب حاليًا ، يرجى ملاحظة أن ساعات العمل لدينا من 7:00 صباحًا إلى 10:00 مساءً ، ويسعدنا مساعدتك خلال هذا الوقت ، أو يمكنك الاتصال بـ <أدخل الرقم هنا>"}, + "copyLinkTxt": { + "en": "Or you can copy the payment link from below & send it to someone who can pay on your behalf: ", + "ar": "أو يمكنك نسخ رابط الدفع من الأسفل وإرساله إلى شخص يمكنه الدفع نيابة عنك:" + }, + "proErrorMessage": { + "en": + "Dear patient, Our staff is currently out of office, please note that our working hours are from 7:00 AM to 10:00 PM, and we'd love to help you during that time, or you can call ", + "ar": "عزيزي المريض ، طاقم العمل لدينا خارج المكتب حاليًا ، يرجى ملاحظة أن ساعات العمل لدينا من 7:00 صباحًا إلى 10:00 مساءً ، ويسعدنا مساعدتك خلال هذا الوقت ، أو يمكنك الاتصال بـ <أدخل الرقم هنا>" + }, "admissionNo": {"en": "Admission No", "ar": "رقم القبول:"}, "admissionReqNo": {"en": "Admission Request No", "ar": "رقم طلب القبول:"}, "dischargeDate": {"en": "Discharge Date", "ar": "تاريخ التفريغ"}, @@ -1972,10 +1980,7 @@ const Map localizedValues = { "validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"}, "contactRRT": {"en": "Contact RRT", "ar": "تواصل مع فريق الاستجابة السريعة"}, "checkInViaLocation": {"en": "Check-In Via Location", "ar": "تسجيل الوصول عبر الموقع"}, - "locationCheckInError": { - "en": "Please make sure that you're within the hospital location to perform online check-in.", - "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت." - }, + "locationCheckInError": {"en": "Please ensure you're within the hospital location to perform online check-in.", "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."}, "upcoming": {"en": "Upcoming", "ar": "المواعيد القادمة"}, "noUpcomingAppointment": {"en": "No upcoming appointments", "ar": "لا توجد مواعيد القادمة"}, "locationTimeoutError": {"en": "Unable to fetch your location, Please try again.", "ar": "غير قادر على جلب موقعك، يرجى المحاولة مرة أخرى."}, @@ -1983,23 +1988,29 @@ const Map localizedValues = { "selectHospitalBloodDonation": {"en": "Please select the hospital you want to book an appointment with: ", "ar": "يرجى اختيار المستشفى الذي تريد حجز موعد معه:"}, "wecare": {"en": "We Care", "ar": "نحن نهتم"}, "myinstructions": {"en": "My Instructions", "ar": "تعليماتي"}, - "existingPackage":{"en":"This patient has a package under this clinic,","ar":"هذا المريض لديه حزمة تحت هذه العيادة،"}, - "continueOrbookNew":{"en":"do you want to continue with that package? or book new appointment?","ar":"هل تريد الاستمرار في هذه الباقة؟ أو حجز موعد جديد؟"}, - "newAppointment":{"en":"New Appointment","ar":"موعد جديد"}, - "proceedPackage":{"en":"Proceed with package","ar":"المضي قدما في الحزمة"}, + "existingPackage": {"en": "This patient has a package under this clinic,", "ar": "هذا المريض لديه حزمة تحت هذه العيادة،"}, + "continueOrbookNew": {"en": "do you want to continue with that package? or book new appointment?", "ar": "هل تريد الاستمرار في هذه الباقة؟ أو حجز موعد جديد؟"}, + "newAppointment": {"en": "New Appointment", "ar": "موعد جديد"}, + "proceedPackage": {"en": "Proceed with package", "ar": "المضي قدما في الحزمة"}, "clinicLocation": {"en": "Clinic Location", "ar": "موقع العيادة"}, "waitingAppointment": {"en": "Waiting appointment", "ar": "انتظار الموعد"}, "whatWaitingAppointment": {"en": "What is Waiting appointment?", "ar": "ما هو انتظار الموعد؟"}, - "waitingAppointmentText1": {"en": "The waiting appointments feature allows you to book an appointment while you are inside the hospital building, and in case there is no available slot in the doctor’s schedule.", "ar": "تتيح لك خاصية انتظار المواعيد حجز موعد أثناء تواجدك داخل مبنى المستشفى، وفي حالة عدم وجود وقت متاح في جدول الطبيب."}, + "waitingAppointmentText1": { + "en": "The waiting appointments feature allows you to book an appointment while you are inside the hospital building, and in case there is no available slot in the doctor’s schedule.", + "ar": "تتيح لك خاصية انتظار المواعيد حجز موعد أثناء تواجدك داخل مبنى المستشفى، وفي حالة عدم وجود وقت متاح في جدول الطبيب." + }, "waitingAppointmentText2": {"en": "The appointment with the doctor is confirmed, but the time of entry is uncertain", "ar": "دخول الموعد مؤكد, التوقيت غير محدد."}, - "waitingAppointmentText3": {"en": "Note: You must have to pay within 10 minutes of booking, otherwise your appointment will be cancelled automatically", "ar": "ملحوظة: يجب عليك الدفع خلال 10 دقائق من الحجز، وإلا سيتم إلغاء موعدك تلقائيًا"}, + "waitingAppointmentText3": { + "en": "Note: You must have to pay within 10 minutes of booking, otherwise your appointment will be cancelled automatically", + "ar": "ملحوظة: يجب عليك الدفع خلال 10 دقائق من الحجز، وإلا سيتم إلغاء موعدك تلقائيًا" + }, "waitingAppointmentVerificationMethod": {"en": "Please select verification method", "ar": "الرجاء تحديد طريقة التحقق"}, "howToUseVerificationMethod": {"en": "How to use verification methods?", "ar": "كيفية استخدام طرق التحقق؟"}, "addToWaitingList": {"en": "Add to waiting list", "ar": "اضافه الى قائمة الانتظار"}, "searchClinic": {"en": "Search Clinic", "ar": "بحث العيادة"}, - "selectBranch":{"en":"Select Branch", "ar":"اختر الفرع"}, - "searchByBranch":{"en":"Search By Branch Name", "ar":"البحث عن طريق اسم الفرع"}, + "selectBranch": {"en": "Select Branch", "ar": "اختر الفرع"}, + "searchByBranch": {"en": "Search By Branch Name", "ar": "البحث عن طريق اسم الفرع"}, "hospitalNavigationTitle": {"en": "Hospital", "ar": "الملاحة"}, "hospitalNavigationSubtitle": {"en": "Navigation", "ar": "المستشفى"}, }; diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 671cc90f..8ca246a0 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -125,13 +125,14 @@ class LabsService extends BaseService { } Future updateWorkplaceName(String workplaceName, String workplaceNameAR, String occupation, String occupationAR, int requestNumber, String setupID, int projectID) async { + // Future updateWorkplaceName(String workplaceName, String workplaceNameAR, int requestNumber, String setupID, int projectID) async { hasError = false; Map body = Map(); body['Placeofwork'] = workplaceName; - body['Placeofworkar'] = workplaceNameAR; + body['PlaceofworkAr'] = workplaceNameAR; body['Occupation'] = occupation; - body['Occupationar'] = occupationAR; + body['OccupationAr'] = occupationAR; body['Req_ID'] = requestNumber; body['TargetSetupID'] = setupID; body['ProjectID'] = projectID; diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 57362d6f..d4707aa9 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -48,7 +48,7 @@ class ProjectViewModel extends BaseViewModel { GetAdmissionInfoResponseModel getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel(); GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel(); - bool isIndoorNavigationEnabled = true; + bool isIndoorNavigationEnabled = false; int waitingAppointmentProjectID = 0; DoctorList? waitingAppointmentDoctor; diff --git a/lib/models/SmartWatch/WeeklyHeartRateResModel.dart b/lib/models/SmartWatch/WeeklyHeartRateResModel.dart index 1c21c22d..26341ee0 100644 --- a/lib/models/SmartWatch/WeeklyHeartRateResModel.dart +++ b/lib/models/SmartWatch/WeeklyHeartRateResModel.dart @@ -8,7 +8,7 @@ class WeeklyHeartRateResModel { {this.valueAvg, this.machineDate, this.medCategoryID, this.patientID}); WeeklyHeartRateResModel.fromJson(Map json) { - num value = json['ValueAvg']; + num value = json['ValueAvg'] != null ? json['ValueAvg'] : 0.0; valueAvg = json['ValueAvg'] != null ? value.toInt() : 0; machineDate = json['MachineDate']; medCategoryID = json['MedCategoryID']; diff --git a/lib/models/SmartWatch/YearlyHeartRateResModel.dart b/lib/models/SmartWatch/YearlyHeartRateResModel.dart index 331d5adb..3d81ff2c 100644 --- a/lib/models/SmartWatch/YearlyHeartRateResModel.dart +++ b/lib/models/SmartWatch/YearlyHeartRateResModel.dart @@ -15,7 +15,7 @@ class YearlyHeartRateResModel { this.year}); YearlyHeartRateResModel.fromJson(Map json) { - num value = json['ValueAvg']; + num value = json['ValueAvg'] != null ? json['ValueAvg'] : 0.0; valueAvg = json['ValueAvg'] != null ? value.toInt() : 0; medCategoryID = json['MedCategoryID']; month = json['Month']; diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index dcda064c..65dfa1b1 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -680,7 +680,7 @@ class _BookConfirmState extends State { ); } - cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context, {int? invoiceNumber, int? lineItemNo}) async { + cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context, {int? invoiceNumber, int? lineItemNo, String? invoiceNoVP}) async { ConfirmDialog.closeAlertDialog(context); GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false); DoctorsListService service = new DoctorsListService(); @@ -692,7 +692,7 @@ class _BookConfirmState extends State { if (isLiveCareSchedule != null && isLiveCareSchedule) { insertLiveCareScheduledAppointment(context, widget.doctor); } else { - insertAppointment(context, widget.doctor, widget.initialSlotDuration); + insertAppointment(context, widget.doctor, widget.initialSlotDuration, invoiceNumber: invoiceNumber, lineItemNo: lineItemNo, invoiceNoVP: invoiceNoVP); } }); } else { @@ -736,7 +736,7 @@ class _BookConfirmState extends State { widget.service.convertPatientToCash(docObject.projectID!).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res["MessageStatus"] == 1) { - if(isLiveCareAppointment) { + if (isLiveCareAppointment) { getLiveCareAppointmentPatientShare(context, appointmentNo, docObject!.clinicID!, docObject.projectID!, docObject); } else { getPatientShare(context, appointmentNo, docObject.clinicID!, docObject.projectID!, docObject); @@ -881,7 +881,9 @@ class _BookConfirmState extends State { okFunction: () => { ConfirmDialog.closeAlertDialog(context), insertAppointment(context, widget.doctor, widget.initialSlotDuration, - invoiceNumber: package.patientPackageComponents![0].invoiceNo, lineItemNo: package.patientPackageComponents![0].lineItemNo) + invoiceNumber: package.patientPackageComponents![0].invoiceNo, + lineItemNo: package.patientPackageComponents![0].lineItemNo, + invoiceNoVP: package.patientPackageComponents![0].invoiceNo_VP.toString()) }, cancelFunction: () => {insertAppointment(context, widget.doctor, widget.initialSlotDuration)}, ); @@ -894,7 +896,7 @@ class _BookConfirmState extends State { }); } - insertAppointment(context, DoctorList docObject, int initialSlotDuration, {int? invoiceNumber, int? lineItemNo}) async { + insertAppointment(context, DoctorList docObject, int initialSlotDuration, {int? invoiceNumber, int? lineItemNo, String? invoiceNoVP}) async { final timeSlot = DocAvailableAppointments.selectedAppoDateTime; String logs = await sharedPref.getString('selectedLogSlots'); List decodedLogs = json.decode(logs); @@ -903,7 +905,7 @@ class _BookConfirmState extends State { widget.service // .insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, widget.selectedTime, widget.selectedDate, initialSlotDuration, context, 'null', null, null, projectViewModel) .insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, widget.selectedTime, widget.selectedDate, initialSlotDuration, projectViewModel.isArabic ? 1 : 2, context, - null, null, null, projectViewModel, invoiceNumber, lineItemNo) + null, null, null, projectViewModel, invoiceNumber, lineItemNo, invoiceNoVP) .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 6bef82b9..6e12c68e 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -331,10 +331,10 @@ class _DocAvailableAppointmentsState extends State wit Widget getSelectedButton(int index) { return CustomTextButton( - backgroundColor: CustomColors.green, + backgroundColor: dayEvents[index].isoTime == TranslationBase.of(context).waitingAppointment ? CustomColors.darkOrange : CustomColors.green, elevation: 0, side: BorderSide( - color: CustomColors.green, //Color of the border + color: dayEvents[index].isoTime == TranslationBase.of(context).waitingAppointment ? CustomColors.darkOrange : CustomColors.green, //Color of the border style: BorderStyle.solid, //Style of the border width: 1.5 //width of the border ), diff --git a/lib/pages/medical/sickleave_workplace_update_page.dart b/lib/pages/medical/sickleave_workplace_update_page.dart index f818021f..ec7991cb 100644 --- a/lib/pages/medical/sickleave_workplace_update_page.dart +++ b/lib/pages/medical/sickleave_workplace_update_page.dart @@ -70,6 +70,7 @@ class _WorkplaceUpdatePageState extends State { ), ), mHeight(8), + // inputWidget(TranslationBase.of(context).workplaceName, "", workplaceName), inputWidget(TranslationBase.of(context).workplaceName, "", workplaceName, FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]"))), mHeight(8), inputWidget(TranslationBase.of(context).workplaceNameAr, "", workplaceNameAr, FilteringTextInputFormatter.allow(RegExp("[ء-ي ]"))), @@ -105,7 +106,8 @@ class _WorkplaceUpdatePageState extends State { ), onPressed: () { // if (_isButtonDisabled == false) - if (workplaceName.text.isNotEmpty && workplaceNameAr.text.isNotEmpty && occupationNameEn.text.isNotEmpty && occupationNameAr.text.isNotEmpty) + if (workplaceNameAr.text.isNotEmpty && occupationNameAr.text.isNotEmpty) + // AppToast.showSuccessToast(message: "API Called"); updateWorkplaceNameDialog(); else AppToast.showErrorToast(message: TranslationBase.of(context).enterDetailBelow); @@ -121,6 +123,7 @@ class _WorkplaceUpdatePageState extends State { } Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, TextInputFormatter inputFormatter, {String? prefix, bool isEnable = true, bool hasSelection = false}) { + // Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) { return Container( padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), alignment: Alignment.center, @@ -219,8 +222,8 @@ class _WorkplaceUpdatePageState extends State { } updateWorkplaceNameDialog() { - var messageEn = "The workplace name you entered is: " + workplaceName.text + ". Please confirm!"; - var messageAr = "اسم مكان العمل الذي أدخلته هو: " + workplaceName.text + ". يرجى تأكيد!"; + var messageEn = "The workplace name you entered is: " + workplaceNameAr.text + ". Please confirm!"; + var messageAr = "اسم مكان العمل الذي أدخلته هو: " + workplaceNameAr.text + ". يرجى تأكيد!"; ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: projectViewModel!.isArabic ? messageAr : messageEn, @@ -239,6 +242,9 @@ class _WorkplaceUpdatePageState extends State { GifLoaderDialogUtils.showMyDialog(context); service.updateWorkplaceName(workplaceName.text, workplaceNameAr.text, occupationNameEn.text, occupationNameAr.text, widget.requestNumber, widget.setupID, widget.projectID).then((res) { + // service + // .updateWorkplaceName(projectViewModel!.isArabic ? "-" : workplaceName.text, projectViewModel!.isArabic ? workplaceName.text : "-", widget.requestNumber, widget.setupID, widget.projectID) + // .then((res) { GifLoaderDialogUtils.hideDialog(context); Navigator.of(context).pop(true); }).catchError((err) { diff --git a/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart b/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart index 0e356b78..432707ce 100644 --- a/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart @@ -216,7 +216,7 @@ class _DistanceTrackerState extends State with SingleTickerProv (element) { weeklyTimeSeriesData.add( TimeSeriesSales2( - DateUtil.convertStringToDate(element.machineDate!), + DateUtil.convertStringToDate(element.machineDate ?? DateUtil.convertDateToString(DateTime.now())), element.value != null ? (element.value!.toDouble() / 1000) : 0.0, ), ); @@ -501,7 +501,7 @@ class _DistanceTrackerState extends State with SingleTickerProv children: [ Utils.tableColumnValue( '${DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDate(step.machineDate!), + DateUtil.convertStringToDate(step.machineDate ?? DateUtil.convertDateToString(DateTime.now())), )} ', isCapitable: false, mProjectViewModel: projectViewModel), diff --git a/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart b/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart index fcd87cfd..a9a19945 100644 --- a/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart @@ -212,7 +212,7 @@ class _StepsTrackerState extends State with SingleTickerProviderSt (element) { weeklyTimeSeriesData.add( TimeSeriesSales2( - DateUtil.convertStringToDate(element.machineDate!), + DateUtil.convertStringToDate(element.machineDate ?? DateUtil.convertDateToString(DateTime.now())), element.value != null ? element.value!.toDouble() : 0.0, ), ); @@ -527,7 +527,7 @@ class _StepsTrackerState extends State with SingleTickerProviderSt children: [ Utils.tableColumnValue( '${DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDate(step.machineDate!), + DateUtil.convertStringToDate(step.machineDate ?? DateUtil.convertDateToString(DateTime.now())), )} ', isCapitable: false, mProjectViewModel: projectViewModel), diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index 44484373..4dbc3edd 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -75,7 +75,7 @@ class _RateAppointmentClinicState extends State { style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), Text( - model.appointmentDetails.startTime.toString().substring(0, 5), + model.appointmentDetails.startTime != "" ? model.appointmentDetails.startTime.toString().substring(0, 5) : "", style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), ], diff --git a/lib/services/payfort_services/payfort_service.dart b/lib/services/payfort_services/payfort_service.dart index 64a015cd..9983a22c 100644 --- a/lib/services/payfort_services/payfort_service.dart +++ b/lib/services/payfort_services/payfort_service.dart @@ -168,16 +168,16 @@ class PayfortService extends BaseService { /// Step 4: Processing Payment [Don't multiply with 100] /// Amount value send always round ex. [100] not [100.00, 100.21] FortRequest request = FortRequest( - amount: orderAmount!, - customerName: customerName!, - customerEmail: customerEmail!, - orderDescription: orderDescription!, - sdkToken: sdkTokenResponse?.sdkToken ?? '', - merchantReference: merchantReference!, - currency: currency, - customerIp: (await _info.getWifiIP() ?? ''), - language: 'en' - ); + amount: orderAmount!, + customerName: customerName!, + customerEmail: customerEmail!, + // orderDescription: orderDescription!, + orderDescription: "Dr. Sulaiman Al Habib Hospital", + sdkToken: sdkTokenResponse?.sdkToken ?? '', + merchantReference: merchantReference!, + currency: currency, + customerIp: (await _info.getWifiIP() ?? ''), + language: 'en'); _payfort.callPayFortForApplePay( request: request, diff --git a/lib/theme/colors.dart b/lib/theme/colors.dart index 328af105..a9d4e437 100644 --- a/lib/theme/colors.dart +++ b/lib/theme/colors.dart @@ -21,6 +21,7 @@ class CustomColors { static const Color appBackgroudGrey2Color = Color(0xFFF8F8F8); static const Color green = Color(0xFF359846); static const Color orange = Color(0xFFCC9B14); + static const Color darkOrange = Color(0xFFE16F17); static const Color femaleColor = Color(0xFF359846); static const Color maleColor = Color(0xFFCC9B14); diff --git a/lib/uitl/penguin_method_channel.dart b/lib/uitl/penguin_method_channel.dart index f2d51573..7b50d635 100644 --- a/lib/uitl/penguin_method_channel.dart +++ b/lib/uitl/penguin_method_channel.dart @@ -17,7 +17,7 @@ class PenguinMethodChannel { "dataServiceName": "api", "positionServiceName": "pe", "clientID": "HMG", - // "username": "test", + // "username": "Haroon", "username": username, "isSimulationModeEnabled": false, "isShowUserName": false, diff --git a/pubspec.yaml b/pubspec.yaml index 475a72f2..143df07f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.067+4050067 +version: 4.5.068+4050068 environment: sdk: ">=3.0.0 <3.13.0" @@ -36,6 +36,7 @@ dependencies: #Google Fit & Apple HealthKit # health: ^3.0.3 health: ^11.1.0 + pedometer: ^4.0.2 #chart fl_chart: ^0.64.0