diff --git a/android/build.gradle b/android/build.gradle index 69a65d6a..1849765a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -37,6 +37,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:7.1.3' +// classpath 'com.android.tools.build:gradle:8.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.8' // classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1' diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 318f2f08..63df2a6d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -583,7 +583,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -601,7 +601,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.999; + MARKETING_VERSION = 4.6.004; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -735,7 +735,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -753,7 +753,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.999; + MARKETING_VERSION = 4.6.004; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -779,7 +779,7 @@ CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -797,7 +797,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.999; + MARKETING_VERSION = 4.6.004; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/lib/config/config.dart b/lib/config/config.dart index de198ba2..1d6a295a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,8 +21,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:2018/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; + // var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; @@ -353,7 +353,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 = 17.6; +var VERSION_ID = 17.9; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; @@ -700,10 +700,10 @@ var IS_DOCTOR_AVAILABLE_BY_CALENDAR_SCHEDULE = 'Services/OUTPs.svc/REST/HIS_IsDo //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/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 9097d2fd..d083c422 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -187,7 +187,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; //0560717232 - // body['PatientID'] = 4769527; //4609100 + // body['PatientID'] = 2007395; //4609100 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 9b3904be..3f83a493 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -231,9 +231,9 @@ class LabsService extends BaseService { _requestSendLabReportEmail.languageID = languageID; // await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) { - await baseAppClient.post(SEND_LAB_RESULT_EMAIL_NEW, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(isVidaPlus ? SEND_LAB_RESULT_EMAIL : SEND_LAB_RESULT_EMAIL_NEW, onSuccess: (dynamic response, int statusCode) { if (isDownload) { - labReportPDF = response['PdfContent']; + labReportPDF = isVidaPlus ? response['LabReportsPDFContent'] : response['PdfContent']; } }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 02f8ebe7..464786df 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -200,9 +200,11 @@ class _AnicllaryOrdersState extends State with SingleTic Expanded( child: Row( children: [ - SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), + projectViewModel.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), mWidth(6), _getNormalText(value, isBold: isBold, isTotal: isTotal), + mWidth(6), + projectViewModel.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(), ], ), ), @@ -326,7 +328,8 @@ class _AnicllaryOrdersState extends State with SingleTic ), mWidth(3), Text( - _ancillaryProcLists[0].ancillaryOrderProcDetailsList![0].orderNo.toString(), + // _ancillaryProcLists[0].ancillaryOrderProcDetailsList![0].orderNo.toString(), + _ancillaryProcLists[0].ancillaryOrderProcDetailsList!.isNotEmpty ? _ancillaryProcLists[0].ancillaryOrderProcDetailsList![0].orderNo.toString() : "0", style: TextStyle( fontWeight: FontWeight.w600, fontSize: 12, diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 6bdc612c..61b0f9d9 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -1098,7 +1098,7 @@ class _BookSuccessState extends State { padding: EdgeInsets.only(bottom: 10.0, left: 20, right: 20), child: Row( children: [ - SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16, color: Colors.white), + projectViewModel.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16, color: Colors.white), mWidth(6), Text( text, @@ -1110,6 +1110,8 @@ class _BookSuccessState extends State { fontWeight: FontWeight.w600, ), ), + mWidth(6), + projectViewModel.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16, color: Colors.white) : Container(), ], ), ); diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 6e12c68e..67a795da 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart'; import 'package:flutter/cupertino.dart'; @@ -45,16 +46,18 @@ class _DocAvailableAppointmentsState extends State wit AppSharedPreferences sharedPref = new AppSharedPreferences(); var selectedDate = ""; + var selectedNextDate = ""; dynamic selectedDateJSON; dynamic jsonFreeSlots; - + final DateFormat dateFormatter = DateFormat('yyyy-MM-dd'); List docFreeSlots = []; List dayEvents = []; - + List nextDayEvents = []; int selectedButtonIndex = 0; - + int selectedNextDayButtonIndex = -1; dynamic freeSlotsResponse; + // String nextDayAppointmentDate =""; late ScrollController _scrollController; var language; @@ -115,9 +118,11 @@ class _DocAvailableAppointmentsState extends State wit final DateFormat formatter = DateFormat('yyyy-MM-dd'); setState(() { this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, language); + this.selectedNextDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day.add(Duration(days: 1)), language); + _calendarController.selectedDate = day; openTimeSlotsPickerForDate(day, docFreeSlots); DocAvailableAppointments.selectedDate = formatter.format(day); - _calendarController.selectedDate = day; + selectedNextDayButtonIndex = -1; print(_calendarController.selectedDate); }); } @@ -139,19 +144,51 @@ class _DocAvailableAppointmentsState extends State wit child: Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)), ), DocAvailableAppointments.areSlotsAvailable - ? Container( - height: 40, - child: ListView.builder( - controller: _scrollController, - scrollDirection: Axis.horizontal, - itemCount: dayEvents.length, - itemBuilder: (context, index) { - return Container( - margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5), - child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index), - ); - }, - ), + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: 40, + child: ListView.builder( + controller: _scrollController, + scrollDirection: Axis.horizontal, + itemCount: dayEvents.length, + itemBuilder: (context, index) { + return Container( + margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5), + child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index), + ); + }, + ), + ), + SizedBox( + height: 20, + ), + nextDayEvents.isNotEmpty && projectViewModel.havePrivilege(110) + ? Container( + padding: EdgeInsets.only(left: 20, right: 20, bottom: 20), + child: Text( + selectedNextDate, + style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.black), + ), + ) + : SizedBox(), + Container( + height: 40, + padding: EdgeInsets.only(left: 0, right: 0), + child: ListView.builder( + controller: _scrollController, + scrollDirection: Axis.horizontal, + itemCount: nextDayEvents.length, + itemBuilder: (context, index) { + return Container( + margin: EdgeInsets.only(right: (index == nextDayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5), + child: index == selectedNextDayButtonIndex ? getSelectedNextDayButton(index) : getNormalNextDayButton(index), + ); + }, + ), + ) + ], ) : Center( child: Padding( @@ -225,7 +262,7 @@ class _DocAvailableAppointmentsState extends State wit Map timeSlot = {"isoTime": dayEvents[i].isoTime, "start": dayEvents[i].start.toString(), "end": dayEvents[i].end.toString(), "vidaDate": dayEvents[i].vidaDate}; timeList.add(timeSlot); } - + filterNextDayAppo(freeSlots, timeList.last); AppSharedPreferences sharedPref = new AppSharedPreferences(); sharedPref.setString('selectedLogSlots', json.encode(timeList)); DocAvailableAppointments.selectedTime = dayEvents[selectedButtonIndex].isoTime; @@ -234,12 +271,27 @@ class _DocAvailableAppointmentsState extends State wit }); } + filterNextDayAppo(List freeSlots, Map listList) { + DateTime dateStart = DateTime.parse(listList['end']).add(Duration(days: 1)); + + DateTime dateStartObj = new DateTime(dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0); + nextDayEvents = []; + DateTime beforeHour = new DateTime(dateStart.year, dateStart.month, dateStart.day, 6, 0, 0, 0, 0); + if (projectViewModel.havePrivilege(110)) { + freeSlots.forEach((v) { + if (v.start == dateStartObj && v.end!.isBefore(beforeHour)) nextDayEvents.add(v); + }); + } else { + nextDayEvents = []; + } + // print(nextDayEvents); + } + Future> _getJSONSlots() async { Map _eventsParsed; List slotsList = []; DateTime date; final DateFormat formatter = DateFormat('HH:mm'); - final DateFormat dateFormatter = DateFormat('yyyy-MM-dd'); for (var i = 0; i < freeSlotsResponse.length; i++) { date = (isLiveCareSchedule != null && isLiveCareSchedule) ? DateUtil.convertStringToDate(freeSlotsResponse[i]) @@ -259,6 +311,7 @@ class _DocAvailableAppointmentsState extends State wit ), ), ); + DocAvailableAppointments.selectedAppoDateTime = (isLiveCareSchedule != null && isLiveCareSchedule) ? DateUtil.convertStringToDate(freeSlotsResponse[0]) : DateUtil.convertStringToDateSaudiTimezone( @@ -277,6 +330,16 @@ class _DocAvailableAppointmentsState extends State wit ), ), language); + selectedNextDate = DateUtil.getWeekDayMonthDayYearDateFormatted( + (isLiveCareSchedule != null && isLiveCareSchedule) + ? DateUtil.convertStringToDate(freeSlotsResponse[0]).add(Duration(days: 1)) + : DateUtil.convertStringToDateSaudiTimezone( + freeSlotsResponse[0], + int.parse( + widget.doctor.projectID.toString(), + ), + ).add(Duration(days: 1)), + language); selectedDateJSON = freeSlotsResponse[0]; }); openTimeSlotsPickerForDate( @@ -320,8 +383,10 @@ class _DocAvailableAppointmentsState extends State wit setState(() { selectedButtonIndex = index; + selectedNextDayButtonIndex = -1; DocAvailableAppointments.selectedTime = dayEvents[index].isoTime; print(DocAvailableAppointments.selectedTime); + DocAvailableAppointments.selectedDate = dateFormatter.format(_calendarController.selectedDate!); }); projectViewModel.analytics.appointment.book_appointment_time_selection(appointment_type: 'regular', dateTime: timeslot.end, doctor: widget.doctor); }, @@ -342,6 +407,7 @@ class _DocAvailableAppointmentsState extends State wit setState(() { selectedButtonIndex = index; DocAvailableAppointments.selectedTime = dayEvents[index].isoTime; + DocAvailableAppointments.selectedDate = dateFormatter.format(_calendarController.selectedDate!); print(DocAvailableAppointments.selectedTime); }); }, @@ -349,6 +415,54 @@ class _DocAvailableAppointmentsState extends State wit ); } + Widget getNormalNextDayButton(int index) { + return CustomTextButton( + backgroundColor: Colors.white, + elevation: 0, + side: BorderSide( + color: Colors.black, //Color of the border + style: BorderStyle.solid, //Style of the border + width: 1.5 //width of the border + ), + onPressed: () { + final timeslot = nextDayEvents[index]; + DocAvailableAppointments.selectedAppoDateTime = timeslot.end; + + setState(() { + selectedButtonIndex = -1; + selectedNextDayButtonIndex = index; + DocAvailableAppointments.selectedTime = nextDayEvents[index].isoTime; + DocAvailableAppointments.selectedDate = dateFormatter.format(_calendarController.selectedDate!.add(Duration(days: 1))); + print(DocAvailableAppointments.selectedTime); + }); + projectViewModel.analytics.appointment.book_appointment_time_selection(appointment_type: 'regular', dateTime: timeslot.end, doctor: widget.doctor); + }, + child: Text(nextDayEvents[index].isoTime!, style: TextStyle(fontSize: 12.0, color: Color(0xFF60686b))), + ); + } + + Widget getSelectedNextDayButton(int index) { + return CustomTextButton( + backgroundColor: nextDayEvents[index].isoTime == TranslationBase.of(context).waitingAppointment ? CustomColors.darkOrange : CustomColors.green, + elevation: 0, + side: BorderSide( + color: nextDayEvents[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 + ), + onPressed: () { + setState(() { + selectedButtonIndex = -1; + selectedNextDayButtonIndex = index; + DocAvailableAppointments.selectedTime = nextDayEvents[index].isoTime; + DocAvailableAppointments.selectedDate = dateFormatter.format(_calendarController.selectedDate!.add(Duration(days: 1))); + print(DocAvailableAppointments.selectedTime); + }); + }, + child: Text(nextDayEvents[index].isoTime!, style: TextStyle(fontSize: 12.0, color: Colors.white)), + ); + } + getDoctorFreeSlots(context, DoctorList docObject) { print(DocAvailableAppointments.initialSlotDuration); GifLoaderDialogUtils.showMyDialog(context); diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 158f2c49..cab8e507 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -70,7 +70,7 @@ class _SearchByClinicState extends State { @override void initState() { - locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); + locationUtils = new LocationUtils(isShowConfirmDialog: true, isShowLocationTimeoutDialog: false, context: context); WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList()); checkPVM(); super.initState(); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index 093789f3..d0beeab7 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -49,7 +49,8 @@ class _PickupLocationState extends State { // double _longitude; AppoitmentAllHistoryResultList? myAppointment; HospitalsModel? _selectedHospital; - LocationDetails? _result ; + LocationDetails? _result; + LocationUtils? locationUtils; late ProjectViewModel projectViewModel; @@ -522,12 +523,16 @@ class _PickupLocationState extends State { Text(TranslationBase.of(context).patientShareTotalToDo, style: TextStyle(fontSize: 13.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)), Row( children: [ - SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), + projectViewModel.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), mWidth(6), Text( - (widget.patientER_RC.transportationDetails!.tripType == 1 ? ' ${widget.patientER_RC.patientERTransportationMethod!.priceTotal}' : ' ${(widget.patientER_RC.patientERTransportationMethod!.priceTotal * 2)}'), + (widget.patientER_RC.transportationDetails!.tripType == 1 + ? ' ${widget.patientER_RC.patientERTransportationMethod!.priceTotal}' + : ' ${(widget.patientER_RC.patientERTransportationMethod!.priceTotal * 2)}'), style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.bold), ), + mWidth(6), + projectViewModel.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(), ], ), ], diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart index 23bd8b18..1dac66a0 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart @@ -126,7 +126,7 @@ class _SelectTransportationMethodState extends State flex: 1, child: Row( children: [ - SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), + projectViewModel.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), mWidth(6), Text( ' ${widget.amRequestViewModel.amRequestModeList[index].priceTotal}', @@ -136,6 +136,8 @@ class _SelectTransportationMethodState extends State fontWeight: FontWeight.w600, ), ), + mWidth(6), + projectViewModel.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(), ], ), ) @@ -334,12 +336,14 @@ class _SelectTransportationMethodState extends State Text(TranslationBase.of(context).patientShareTotalToDo, style: TextStyle(fontSize: 13.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)), Row( children: [ - SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), + projectViewModel.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), mWidth(6), Text( (_way == Way.OneWay ? ' ${_erTransportationMethod.priceTotal}' : ' ${(_erTransportationMethod.priceTotal * 2)}'), style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.bold), ), + mWidth(6), + projectViewModel.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(), ], ), ], diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart index 10be1e11..86442ce6 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart @@ -132,7 +132,7 @@ class _SummaryState extends State { Text(TranslationBase.of(context).patientShareTotalToDo, style: TextStyle(fontSize: 13.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)), Row( children: [ - SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), + projectViewModel.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), mWidth(6), Text( (widget.patientER_RC.transportationDetails!.tripType == 1 @@ -140,6 +140,8 @@ class _SummaryState extends State { : ' ${(widget.patientER_RC.patientERTransportationMethod!.priceTotal * 2)}'), style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.bold), ), + mWidth(6), + projectViewModel.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(), ], ), ], diff --git a/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart b/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart index 53fd0f34..1eeb5d9f 100644 --- a/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart +++ b/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart @@ -279,8 +279,7 @@ class _EROnlineCheckInPaymentDetailsState extends State { Expanded( child: Row( children: [ - SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 12, height: 12), + projectViewModel!.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), mWidth(6), Text( amount, @@ -218,6 +218,8 @@ class RRTRequestPageState extends State { fontWeight: FontWeight.w600, ), ), + mWidth(6), + projectViewModel!.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(), ], ), ), @@ -242,7 +244,7 @@ class RRTRequestPageState extends State { Expanded( child: Row( children: [ - SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 12, height: 12), + projectViewModel!.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), mWidth(6), Text( vat, @@ -252,6 +254,8 @@ class RRTRequestPageState extends State { fontWeight: FontWeight.w600, ), ), + mWidth(6), + projectViewModel!.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(), ], ), ), @@ -276,17 +280,14 @@ class RRTRequestPageState extends State { Expanded( child: Row( children: [ - SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 14, height: 14), + projectViewModel!.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 14, height: 14), mWidth(6), Text( total, - style: TextStyle( - fontSize: 14, - letterSpacing: -0.48, - fontWeight: FontWeight.bold, - color: CustomColors.black - ), + style: TextStyle(fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold, color: CustomColors.black), ), + mWidth(6), + projectViewModel!.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(), ], ), ), diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 2744c56f..4a3334cd 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -214,7 +214,7 @@ class _AppointmentDetailsState extends State with SingleTick return SizedBox(); } else { List list = []; - if (widget.parentIndex == 0 && _tabController!.index == 0) { + if (widget.parentIndex == 0 && _tabController!.index == 0 && widget.appo.patientStatusType != 43) { list.add( Expanded( child: DefaultButton( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 05d90571..b58921a6 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -663,7 +663,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { setState(() { if (value != null) { notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); - model.setState(model.count, 0, true, notificationCount); + model.setState(model.count, model.ancillaryCount, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); // FlutterAppIconBadge.updateBadge(int.parse(notificationCount)); } diff --git a/lib/pages/livecare/live_care_payment_page.dart b/lib/pages/livecare/live_care_payment_page.dart index c9e1f889..79c5db55 100644 --- a/lib/pages/livecare/live_care_payment_page.dart +++ b/lib/pages/livecare/live_care_payment_page.dart @@ -136,7 +136,7 @@ class _LiveCarePatmentPageState extends State { child: (widget.getERAppointmentFeesList.currency! == "ريال" || widget.getERAppointmentFeesList.currency! == "SAR") ? Row( children: [ - SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), + projectViewModel.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), mWidth(6), Text( widget.getERAppointmentFeesList.amount!, @@ -146,6 +146,8 @@ class _LiveCarePatmentPageState extends State { fontWeight: FontWeight.w600, ), ), + mWidth(6), + projectViewModel.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(), ], ) : Text( @@ -179,7 +181,7 @@ class _LiveCarePatmentPageState extends State { child: (widget.getERAppointmentFeesList.currency! == "ريال" || widget.getERAppointmentFeesList.currency! == "SAR") ? Row( children: [ - SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), + projectViewModel.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), mWidth(6), Text( widget.getERAppointmentFeesList.tax!, @@ -189,6 +191,8 @@ class _LiveCarePatmentPageState extends State { fontWeight: FontWeight.w600, ), ), + mWidth(6), + projectViewModel.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(), ], ) : Text( @@ -222,7 +226,7 @@ class _LiveCarePatmentPageState extends State { child: (widget.getERAppointmentFeesList.currency! == "ريال" || widget.getERAppointmentFeesList.currency! == "SAR") ? Row( children: [ - SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), + projectViewModel.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), mWidth(6), Text( widget.getERAppointmentFeesList.total!, @@ -232,6 +236,8 @@ class _LiveCarePatmentPageState extends State { fontWeight: FontWeight.w600, ), ), + mWidth(6), + projectViewModel.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(), ], ) : Text( diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index b0a5df48..c4b825dc 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -501,12 +501,12 @@ class _clinic_listState extends State { ); } else { GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: "An error occurred while processing your request"); + AppToast.showErrorToast(message: "An error occurred while processing your request", localContext: context); } }).catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(localContext!); - AppToast.showErrorToast(message: err); + AppToast.showErrorToast(message: err, localContext: context); }); } catch (ex) { print(ex.toString()); diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index 036bc328..96cd9944 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -108,17 +108,22 @@ class AskDoctorPage extends StatelessWidget { ); } - Future checkIfDoctorAvailable(DoctorList _doctor, BuildContext context) { + Future checkIfDoctorAvailable(DoctorList _doctor, BuildContext context) async { + AskDoctorService askDocservice = new AskDoctorService(); bool isAvailable = false; GifLoaderDialogUtils.showMyDialog(context); - service.isDoctorAvailable(doctorId: _doctor.doctorID, projectId: _doctor.projectID, clinicId: _doctor.clinicID).then((res) { + await askDocservice.isDoctorAvailable(doctorId: _doctor.doctorID, projectId: _doctor.projectID, clinicId: _doctor.clinicID).then((res) { GifLoaderDialogUtils.hideDialog(context); - print(res['IsDoctorAvailable']); - if (res['IsDoctorAvailable']) { - isAvailable = true; + if (res != null) { + print(res['IsDoctorAvailable']); + if (res['IsDoctorAvailable']) { + isAvailable = true; + } else { + isAvailable = false; + AppToast.showErrorToast(message: res['endUserMessage'], localContext: context); + } } else { - isAvailable = false; - AppToast.showErrorToast(message: res['endUserMessage'], localContext: context); + isAvailable = true; } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index ca46b5cb..70ff4821 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -152,7 +152,7 @@ class _ConfirmPaymentPageState extends State { ), Row( children: [ - widget.advanceModel!.hospitalsModel!.projectOutSA! ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 20, height: 20), + widget.advanceModel!.hospitalsModel!.projectOutSA! ? Container() : projectViewModel.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 20, height: 20), mWidth(6), Text( widget.advanceModel!.hospitalsModel!.projectOutSA! ? '${widget.advanceModel!.amount} ' + TranslationBase.of(context).aed : '${widget.advanceModel!.amount}', @@ -163,6 +163,8 @@ class _ConfirmPaymentPageState extends State { letterSpacing: -0.48, ), ), + mWidth(6), + widget.advanceModel!.hospitalsModel!.projectOutSA! ? Container() : projectViewModel.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 20, height: 20) : Container(), ], ) ], diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index 25f22797..dc664cf8 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -100,12 +100,14 @@ class MyBalancePage extends StatelessWidget { children: [ projectViewModel.user!.outSA == 1 ? Container() - : SvgPicture.asset( - "assets/images/new/Saudi_Riyal_Symbol.svg", - width: 22, - height: 22, - color: Colors.white, - ), + : projectViewModel.isArabic + ? Container() + : SvgPicture.asset( + "assets/images/new/Saudi_Riyal_Symbol.svg", + width: 22, + height: 22, + color: Colors.white, + ), mWidth(6), Text( double.parse(model.totalAdvanceBalanceAmount?.toString() ?? "0").toStringAsFixed(2), @@ -113,10 +115,19 @@ class MyBalancePage extends StatelessWidget { fontSize: 24, fontWeight: FontWeight.bold, letterSpacing: -1.44, - height: 24 / 23, + height: 24 / 21, color: Colors.white, ), ), + mWidth(6), + projectViewModel.isArabic + ? SvgPicture.asset( + "assets/images/new/Saudi_Riyal_Symbol.svg", + width: 22, + height: 22, + color: Colors.white, + ) + : Container(), ], ), Text( @@ -174,11 +185,9 @@ class MyBalancePage extends StatelessWidget { children: [ projectViewModel.user!.outSA == 1 ? Container() - : Row( - children: [ - SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), - ], - ), + : projectViewModel.isArabic + ? Container() + : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16), mWidth(6), Text( amount.toStringAsFixed(2) + " " + (projectViewModel.user!.outSA == 1 ? TranslationBase.of(context).aed : ""), @@ -189,6 +198,8 @@ class MyBalancePage extends StatelessWidget { color: Color(0xff2E303A), ), ), + mWidth(6), + projectViewModel.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(), ], ), ], diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index e1bda009..4737756c 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -429,7 +429,7 @@ class ClinicListService extends BaseService { localRes = response; }, onFailure: (String error, int statusCode) { throw error; - }, body: request); + }, body: request, isAllowAny: true); return Future.value(localRes); } diff --git a/lib/services/payfort_services/payfort_view_model.dart b/lib/services/payfort_services/payfort_view_model.dart index 29a79f14..2ba62fc2 100644 --- a/lib/services/payfort_services/payfort_view_model.dart +++ b/lib/services/payfort_services/payfort_view_model.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/enum/PayfortEnums.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/services/payfort_services/payfort_project_details_resp_model.dart'; import 'package:diplomaticquarterapp/services/payfort_services/payfort_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:flutter/cupertino.dart'; @@ -77,7 +78,8 @@ class PayfortViewModel extends ChangeNotifier { ); GifLoaderDialogUtils.hideDialog(AppGlobal.context); } catch (e) { - Utils.showErrorToast(e.toString()); + // Utils.showErrorToast(e.toString()); + AppToast.showErrorToast(message: e.toString(), localContext: AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context); throw e; } diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index 90119490..17ccd145 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -18,11 +18,12 @@ class LocationUtils { AppSharedPreferences sharedPref = new AppSharedPreferences(); bool isShowConfirmDialog; + bool isShowLocationTimeoutDialog; BuildContext context; bool isHuawei; final GeolocatorPlatform _geolocatorPlatform = GeolocatorPlatform.instance; - LocationUtils({required this.isShowConfirmDialog, required this.context, this.isHuawei = false}); + LocationUtils({required this.isShowConfirmDialog, required this.context, this.isHuawei = false, this.isShowLocationTimeoutDialog = true}); void getCurrentLocation({Function(LatLng)? callBack}) async { if (Platform.isAndroid && isHuawei) { @@ -32,12 +33,15 @@ class LocationUtils { if (value) { await Geolocator.checkPermission().then((permission) async { if (permission == LocationPermission.always || permission == LocationPermission.whileInUse) { - Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.best, timeLimit: Duration(seconds: 5)).then((value) { + Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: Duration(seconds: 5)).then((value) { setLocation(value); if (callBack != null) callBack(LatLng(value.latitude, value.longitude)); }).catchError((err) { print(err); - if (isShowConfirmDialog) showLocationTimeOutDialog(failureCallBack: (){}); + if (isShowConfirmDialog && isShowLocationTimeoutDialog) + showLocationTimeOutDialog(failureCallBack: () { + Geolocator.openAppSettings(); + }); }); } @@ -51,7 +55,7 @@ class LocationUtils { if (callBack != null) callBack(LatLng(value.latitude, value.longitude)); }); } else { - if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: (){}); + if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: () {}); } }); } else { @@ -59,7 +63,7 @@ class LocationUtils { getCurrentLocation(callBack: callBack); } else { setZeroLocation(); - if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: (){}); + if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: () {}); } } } @@ -130,7 +134,9 @@ class LocationUtils { accuracy: 1.0, heading: 0.0, speed: 0.0, - speedAccuracy: 1, altitudeAccuracy: 0.0, headingAccuracy: 0.0, + speedAccuracy: 1, + altitudeAccuracy: 0.0, + headingAccuracy: 0.0, // altitudeAccuracy: 0.0, // headingAccuracy: 0.0, // altitudeAccuracy: 0, diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart index 00d3700b..22c27384 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -20,13 +20,15 @@ class BottomNavigationItem extends StatelessWidget { final String? name; final bool? isDisabled; + late ToDoCountProviderModel toDoProvider; + AuthenticatedUserObject authenticatedUserObject = locator(); BottomNavigationItem({this.icon, this.activeIcon, this.changeIndex, this.index, this.currentIndex, this.name, this.isDisabled = false}); @override Widget build(BuildContext context) { - var model = Provider.of(context); + toDoProvider = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context); return Expanded( child: SizedBox( @@ -72,7 +74,7 @@ class BottomNavigationItem extends StatelessWidget { ), ], ) - : (authenticatedUserObject.isLogin && model.isShowBadge) + : (authenticatedUserObject.isLogin && toDoProvider.isShowBadge) ? Stack( alignment: AlignmentDirectional.center, children: [ @@ -120,7 +122,7 @@ class BottomNavigationItem extends StatelessWidget { // borderRadius: BorderRadius.circular(8), badgeContent: Container( padding: EdgeInsets.all(2.0), - child: Text((model.count! + model.ancillaryCount!).toString(), style: TextStyle(color: Colors.white, fontSize: 14.0)), + child: Text((toDoProvider.count! + toDoProvider.ancillaryCount!).toString(), style: TextStyle(color: Colors.white, fontSize: 14.0)), ), ), ), diff --git a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index c492ee55..68f88910 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -67,7 +67,7 @@ class _LaboratoryResultWidgetState extends State { widget.patientLabOrder!.actualDoctorRate!, widget.patientLabOrder!.noOfPatientsRate!, projectViewModel.user.emailAddress!), - buttonTitle: TranslationBase.of(context).downloadReport, + buttonTitle: TranslationBase.of(context).download, buttonIcon: "assets/images/new/download_1.svg", showConfirmMessageDialog: false, isDownload: true, diff --git a/pubspec.yaml b/pubspec.yaml index f9eba669..26febe1e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.6.083+4050083 +version: 4.6.085+4050085 environment: sdk: ">=3.0.0 <3.13.0" @@ -60,7 +60,9 @@ dependencies: local_auth: ^2.1.7 localstorage: ^4.0.0+1 maps_launcher: ^2.0.1 - url_launcher: ^6.0.15 +# url_launcher: ^6.0.15 + url_launcher: ^6.3.1 + url_launcher_ios: ^6.3.2 shared_preferences: ^2.0.0 # flutter_flexible_toast: ^0.1.4 fluttertoast: ^8.0.8 @@ -97,7 +99,7 @@ dependencies: # Qr code Scanner TODO fix it location: ^5.0.3 - barcode_scan2: ^4.2.2 + barcode_scan2: 4.3.2 # Rating Stars flutter_rating_bar: ^4.0.1 @@ -187,6 +189,7 @@ dependencies: firebase_crashlytics: ^3.0.0 cloudflare_turnstile: ^2.0.1 + device_info_plus: ^10.1.2 app_links: ^6.4.0 # vital_sign_camera: # path: ./packages/vital_sign_camera