diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 08adc616..e2e96449 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -69,7 +69,7 @@ "date": "التاريخ", "time": "الوقت", "pendingPayment": "معلق للدفع", - "payNow": "ادفع الآن", + "payNow": "الدفع", "viewQR": "عرض رمز الاستجابة السريعة", "instruction": "تعليمات", "livecare": "لايف كير", @@ -171,9 +171,9 @@ "emailSentError": "خطأ في إرسال البريد الإلكتروني", "close": "إغلاق", "closeIt": "أغلق", - "booked": "محجوز", + "booked": "تم الحجز", "confirmed": "مؤكد", - "arrived": "وصل", + "arrived": " تم الوصول", "payNowBookSuccess": "ادفع الآن عبر تطبيق الحبيب", "payNowBookSuccesstext1": "ادفع الآن باستخدام خدمة الدفع عبر الإنترنت من بوابات الدفع الآمنة", "payNowBookSuccesstext2": "يمكنك أيضًا الدفع لاحقًا عبر الدفع الإلكتروني أو في المستشفى.", @@ -274,7 +274,7 @@ "parkingDescription": "خدمة المواقف هي لك لمسح موقع السيارة حتى تتمكن من العثور عليها بسهولة عند مغادرتك. انقر على زر (مسح الموقف) لحفظ موقع الموقف، ثم سيظهر زر (عرض موقفي) لإظهار الطريق إلى الموقف. إذا كنت ترغب في إعادة مسح موقف السيارة QR فقط انقر على (مسح بياناتي).", "appointments": "المواعيد", "all2": "الكل", - "checkinOption": "تسجيل الوصول", + "checkinOption": "تسجيل الحضور", "readBarcode": "قراءة الكود", "showMyPark": "عرض الموقف", "clearMyData": "امسح البيانات", @@ -296,7 +296,7 @@ "radiology": "الأشعة", "radiologySubtitle": "النتيجة", "lab": "المختبر", - "labSubtitle": "النتائج", + "labSubtitle": "نتائج", "medicines": "الأدوية", "medicinesSubtitle": "الوصفات", "vitalSigns": "علامات حيوية", @@ -311,9 +311,11 @@ "myMedicalSubtitle": "الأدوية", "myDoctor": "أطبائي", "myDoctorSubtitle": "القائمة", + "myDoctorSubtitle2": "قائمة", "eye": "العين", "eyeSubtitle": "القياس", "insurance": "التأمين", + "insurance2": "تأمين", "insuranceSubtitle": "البطاقة", "updateInsurance": "تحديث", "updateInsuranceSubtitle": "التأمين", @@ -328,6 +330,7 @@ "monthly": "شهري", "monthlySubtitle": "التقرير", "sick": "مريض", + "sick2": "المريضة", "sickSubtitle": "الإجازات", "myBalance": "رصيدي", "myBalanceSubtitle": "الرصيد", @@ -490,9 +493,11 @@ "refferalTitle": "إحالة إلكترونية", "refferalSubTitle": "الخدمة", "healthCare": "الرعاية الصحية", - "emergency": "حالة طوارئ", + "emergency": "طوارئ", + "emergency2": "الطوارئ", "erservices": "خدمات الطوارئ", "services2": "الخدمات", + "services3": "خدمات", "cantSeeProfile": "لرؤية ملفك الطبي، يرجى تسجيل الدخول أو التسجيل الآن", "loginRegisterNow": "تسجيل الدخول أو التسجيل الآن", "hmgPharmacy": "صيدلية الحبيب", @@ -765,6 +770,7 @@ "erConsultation": "تتيح لك هذه الخدمة إجراء استشارة افتراضية عبر الإنترنت عبر مكالمة فيديو مباشرة مع الطبيب من أي مكان وفي أي وقت.", "myInvoice": "القائمة", "invoiceList": "فواتيري", + "invoiceList2": "فواتيري", "allInvoices": "كل الفواتير", "hospitals": "المستشفيات", "clinics": "العيادات", @@ -888,7 +894,7 @@ "to": "إلى", "startDate": "تاريخ البدء", "endDate": "تاريخ الانتهاء", - "walkin": "زيارة بدون موعد", + "walkin": "بدون موعد", "laserClinic": "عيادة الليزر", "continueString": "يكمل", "covid_info": "تجري مستشفيات د. سليمان الحبيب فحص فيروس كورونا المستجد وتصدر شهادات السفر على مدار الساعة، طوال أيام الأسبوع، وبسرعة ودقة عالية. يمكن للراغبين في الاستفادة من هذه الخدمة زيارة أحد فروع مستشفيات د. سليمان الحبيب وإجراء فحص كورونا خلال بضع دقائق والحصول على النتائج خلال عدة ساعات خدمة فحص فيروس كورونا Covid 19 بتقنية PCR للكشف عن الفيروس وفقاً لأعلى المعايير العالمية وبأحدث أجهزة RT-PCR عالية الدقة (GeneXpert الأمريكي وغيره)، وهي طرق معتمدة من قبل هيئة الغذاء والدواء وكذلك من قبل المركز السعودي للوقاية من الأمراض المُعدية", @@ -931,7 +937,7 @@ "immediateConsultation": "استشارة فورية", "scheduledConsultation": "استشارة مجدولة", "pharmaLiveCare": "لايف كير الصيدلية", - "notSureHelpMeChooseClinic": "غير متأكد؟ ساعدني في اختيار عيادة!", + "notSureHelpMeChooseClinic": "هل تريد مساعدة في اختيار العياة؟", "mentionYourSymptomsAndFindDoctors": "اذكر أعراضك واعثر على قائمة الأطباء وفقاً لذلك", "immediateService": "خدمة فورية", "noNeedToWaitGetMedicalConsultation": "لا حاجة للانتظار، ستحصل على استشارة طبية فورية عبر مكالمة فيديو", @@ -995,7 +1001,7 @@ "processingCheckIn": "جاري معالجة تسجيل الحضور...", "bookingWaitingAppointment": "جاري حجز موعد الانتظار، يرجى الانتظار...", "enterValidIDorIqama": "يرجى إدخال رقم هوية وطنية أو رقم ملف صالح", - "selectAppointment": "حدد الموعد", + "selectAppointment": "اختر الموعد", "rebookSameDoctor": "أعد الحجز مع نفس الطبيب", "queueing": "قائمة الانتظار", "inQueue": "في قائمة الانتظار", @@ -1291,7 +1297,7 @@ "rebook": "إعادة الحجز", "noOphthalmologyAppointments": "لم يتم العثور على أي مواعيد في قسم طب العيون...", "noVitalSignsRecordedYet": "لا توجد علامات حيوية مسجلة بعد", - "appointmentsAndVisits": "المواعيد والزيارات", + "appointmentsAndVisits": "المواعيد", "labAndRadiology": "المختبر والأشعة", "activeMedicationsAndPrescriptions": "الوصفات الطبية", "allPrescriptions": "جميع الوصفات", @@ -1465,6 +1471,7 @@ "distanceDescription": "المسافة المقطوعة على مدار اليوم", "overview": "نظرة عامة", "details": "التفاصيل", + "details2": "تفاصيل", "healthy": "صحي", "warning": "تحذير", "vitalSignDetails": "تفاصيل العلامات الحيوية", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 18484fc1..0f108ade 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -69,7 +69,7 @@ "date": "Date", "time": "Time", "pendingPayment": "Pending for payment", - "payNow": "Pay Now", + "payNow": "Payment", "viewQR": "View QR Code", "instruction": "Instructions", "livecare": "LiveCare", @@ -310,6 +310,7 @@ "myMedicalSubtitle": "Medications", "myDoctor": "My Doctors", "myDoctorSubtitle": "List", + "myDoctorSubtitle2": "List", "eye": "Eye", "eyeSubtitle": "Measurement", "insurance": "Insurance", @@ -327,6 +328,7 @@ "monthly": "Monthly", "monthlySubtitle": "Report", "sick": "Sick", + "sick2": "Sick", "sickSubtitle": "Leaves", "myBalance": "My Balance", "myBalanceSubtitle": "Credit", @@ -484,8 +486,10 @@ "refferalSubTitle": "Service", "healthCare": "Health Care", "emergency": "Emergency", + "emergency2": "Emergency", "erservices": "Emergency", "services2": "Services", + "services3": "Services", "cantSeeProfile": "To view your medical profile, please log in or register now", "loginRegisterNow": "Login or Register Now", "hmgPharmacy": "HMG Pharmacy", @@ -757,6 +761,7 @@ "erConsultation": "This service allows you to make an online virtual consultation via video call directly with the doctor from anywhere at any time.", "myInvoice": "List", "invoiceList": "My Invoice", + "invoiceList2": "My Invoice", "allInvoices": "All Invoices", "hospitals": "Hospitals", "clinics": "Clinics", @@ -1457,6 +1462,7 @@ "distanceDescription": "Distance covered throughout the day", "overview": "Overview", "details": "Details", + "details2": "Details", "healthy": "Healthy", "warning": "Warning", "vitalSignDetails": "Vital Sign Details", diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index bf9144fa..ef1cd36a 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -4,7 +4,7 @@ import 'package:hmg_patient_app_new/core/enums.dart'; class ApiConsts { static const maxSmallScreen = 660; - static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod; + static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.preProd; // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT @@ -205,6 +205,9 @@ class ApiConsts { static String updateDiabeticResult = 'Services/Patients.svc/REST/Patient_UpdateDiabtecResult'; static String deactivateDiabeticStatus = 'Services/Patients.svc/REST/Patient_DeactivateDiabeticStatus'; static String sendAverageBloodSugarReport = 'Services/Notifications.svc/REST/SendAverageBloodSugarReport'; + static String averageBloodSugarReportDownload = 'Services/Notifications.svc/REST/SendAverageBloodSugarReportDownload'; + static String averageWeightReportDownload = 'Services/Notifications.svc/REST/SendAverageBodyWeightReportDownload'; + static String averageBloodPressureReportDownload = 'Services/Notifications.svc/REST/SendAverageBloodPressureReportDownload'; // Blood Pressure static String getBloodPressureResultAverage = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; diff --git a/lib/features/health_trackers/health_trackers_repo.dart b/lib/features/health_trackers/health_trackers_repo.dart index 2a64fc46..52bc40f6 100644 --- a/lib/features/health_trackers/health_trackers_repo.dart +++ b/lib/features/health_trackers/health_trackers_repo.dart @@ -15,6 +15,9 @@ abstract class HealthTrackersRepo { /// Get blood sugar results (week, month, year). Future>> getDiabeticResults(); + Future>> downloadBloodSugarReport(); + Future>> downloadWeightReport(); + Future>> downloadBloodPressureReport(); /// Add new blood sugar result. Future>> addDiabeticResult({ @@ -211,6 +214,114 @@ class HealthTrackersRepoImp implements HealthTrackersRepo { } } + @override + Future>> downloadBloodSugarReport() async { + try { + GenericApiModel? apiResponse; + Failure? failure; + + await apiClient.post( + ApiConsts.averageBloodSugarReportDownload, + body: {}, + onFailure: (error, statusCode, {messageStatus, failureType}) { + failure = failureType; + }, + onSuccess: (response, statusCode, {messageStatus, errorMessage}) { + try { + dynamic pdf = response['ReportPDFContent']; + + apiResponse = GenericApiModel( + messageStatus: messageStatus, + statusCode: statusCode, + errorMessage: errorMessage, + data: pdf, + ); + } catch (e) { + failure = DataParsingFailure(e.toString()); + } + }, + ); + + if (failure != null) return Left(failure!); + if (apiResponse == null) return Left(ServerFailure("Unknown error")); + return Right(apiResponse!); + } catch (e) { + return Left(UnknownFailure(e.toString())); + } + } + + + @override + Future>> downloadWeightReport() async { + try { + GenericApiModel? apiResponse; + Failure? failure; + + await apiClient.post( + ApiConsts.averageWeightReportDownload, + body: {}, + onFailure: (error, statusCode, {messageStatus, failureType}) { + failure = failureType; + }, + onSuccess: (response, statusCode, {messageStatus, errorMessage}) { + try { + dynamic pdf = response['ReportPDFContent']; + + apiResponse = GenericApiModel( + messageStatus: messageStatus, + statusCode: statusCode, + errorMessage: errorMessage, + data: pdf, + ); + } catch (e) { + failure = DataParsingFailure(e.toString()); + } + }, + ); + + if (failure != null) return Left(failure!); + if (apiResponse == null) return Left(ServerFailure("Unknown error")); + return Right(apiResponse!); + } catch (e) { + return Left(UnknownFailure(e.toString())); + } + } + @override + Future>> downloadBloodPressureReport() async { + try { + GenericApiModel? apiResponse; + Failure? failure; + + await apiClient.post( + ApiConsts.averageBloodPressureReportDownload, + body: {}, + onFailure: (error, statusCode, {messageStatus, failureType}) { + failure = failureType; + }, + onSuccess: (response, statusCode, {messageStatus, errorMessage}) { + try { + dynamic pdf = response['ReportPDFContent']; + + apiResponse = GenericApiModel( + messageStatus: messageStatus, + statusCode: statusCode, + errorMessage: errorMessage, + data: pdf, + ); + } catch (e) { + failure = DataParsingFailure(e.toString()); + } + }, + ); + + if (failure != null) return Left(failure!); + if (apiResponse == null) return Left(ServerFailure("Unknown error")); + return Right(apiResponse!); + } catch (e) { + return Left(UnknownFailure(e.toString())); + } + } + @override Future>> addDiabeticResult({ required String bloodSugarDateChart, diff --git a/lib/features/health_trackers/health_trackers_view_model.dart b/lib/features/health_trackers/health_trackers_view_model.dart index ab54f595..8f7e0ffa 100644 --- a/lib/features/health_trackers/health_trackers_view_model.dart +++ b/lib/features/health_trackers/health_trackers_view_model.dart @@ -1,6 +1,8 @@ import 'dart:developer'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/cupertino.dart'; +import 'package:hmg_patient_app_new/core/enums.dart'; import 'package:hmg_patient_app_new/features/health_trackers/health_trackers_repo.dart'; import 'package:hmg_patient_app_new/features/health_trackers/models/blood_pressure/blood_pressure_result.dart'; import 'package:hmg_patient_app_new/features/health_trackers/models/blood_pressure/month_blood_pressure_result_average.dart'; @@ -14,7 +16,9 @@ import 'package:hmg_patient_app_new/features/health_trackers/models/weight/month import 'package:hmg_patient_app_new/features/health_trackers/models/weight/week_weight_measurement_result_average.dart'; import 'package:hmg_patient_app_new/features/health_trackers/models/weight/weight_measurement_result.dart'; import 'package:hmg_patient_app_new/features/health_trackers/models/weight/year_weight_measurement_result_average.dart'; +import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart'; +import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; class HealthTrackersViewModel extends ChangeNotifier { HealthTrackersRepo healthTrackersRepo; @@ -425,6 +429,91 @@ class HealthTrackersViewModel extends ChangeNotifier { } } + + Future downloadBloodSugerReport({ + Function(String)? onSuccess, + }) async { + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.generatingReport.tr()); + try { + final result = await healthTrackersRepo.downloadBloodSugarReport(); + LoaderBottomSheet.hideLoader(); + bool success = false; + + result.fold( + (failure) { + errorHandlerService.handleError(failure: failure); + }, + (apiModel) { + success = true; + if (onSuccess != null) onSuccess(apiModel.data??""); + }, + ); + + notifyListeners(); + + return success; + } catch (e) { + log('Error in sendWeightReportByEmail: $e'); + return false; + } + } + + Future downloadBloodPressureReport({ + Function(String)? onSuccess, + }) async { + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.generatingReport.tr()); + try { + final result = await healthTrackersRepo.downloadBloodPressureReport(); + LoaderBottomSheet.hideLoader(); + bool success = false; + + result.fold( + (failure) { + errorHandlerService.handleError(failure: failure); + }, + (apiModel) { + success = true; + if (onSuccess != null) onSuccess(apiModel.data??""); + }, + ); + + notifyListeners(); + + return success; + } catch (e) { + log('Error in sendWeightReportByEmail: $e'); + return false; + } + } + Future downloadWeightReport({ + Function(String)? onSuccess, + }) async { + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.generatingReport.tr()); + try { + final result = await healthTrackersRepo.downloadWeightReport(); + LoaderBottomSheet.hideLoader(); + bool success = false; + + result.fold( + (failure) { + errorHandlerService.handleError(failure: failure); + }, + (apiModel) { + success = true; + if (onSuccess != null) onSuccess(apiModel.data??""); + }, + ); + + notifyListeners(); + + return success; + } catch (e) { + log('Error in sendWeightReportByEmail: $e'); + return false; + } + } + + // ==================== BLOOD PRESSURE TRACKING METHODS ==================== /// Fetch blood pressure averages and results @@ -1118,4 +1207,30 @@ class HealthTrackersViewModel extends ChangeNotifier { diastolicController.dispose(); super.dispose(); } + + Future downloadReport(HealthTrackerTypeEnum trackerType, {required Function(dynamic report) onSuccess}) async { + switch (trackerType) { + case HealthTrackerTypeEnum.bloodSugar: + await downloadBloodSugerReport( + onSuccess : (value){ + onSuccess(value); + } + ); + break; + case HealthTrackerTypeEnum.bloodPressure: + await downloadBloodPressureReport( + onSuccess : (value){ + onSuccess(value); + } + ); + break; + case HealthTrackerTypeEnum.weightTracker: + await downloadWeightReport( + onSuccess : (value){ + onSuccess(value); + } + ); + break; + } + } } diff --git a/lib/features/immediate_livecare/immediate_livecare_view_model.dart b/lib/features/immediate_livecare/immediate_livecare_view_model.dart index 6613b481..e61292d6 100644 --- a/lib/features/immediate_livecare/immediate_livecare_view_model.dart +++ b/lib/features/immediate_livecare/immediate_livecare_view_model.dart @@ -39,6 +39,7 @@ class ImmediateLiveCareViewModel extends ChangeNotifier { MyAppointmentsViewModel myAppointmentsViewModel; List immediateLiveCareClinicsList = []; + List mainLiveCareClinicList = []; bool isImmediateLiveCareClinicsLoading = false; int liveCareSelectedCallType = 0; // 1- Video, 2- Audio, 3- Phone late GetLiveCareClinicListResponseModel immediateLiveCareSelectedClinic; @@ -61,6 +62,7 @@ class ImmediateLiveCareViewModel extends ChangeNotifier { initImmediateLiveCare() { _appState = getIt(); immediateLiveCareClinicsList = []; + mainLiveCareClinicList = []; isImmediateLiveCareClinicsLoading = true; liveCareSelectedCallType = 0; // 1- Video, 2- Audio, 3- Phone immediateLiveCareSelectedClinic = GetLiveCareClinicListResponseModel(); @@ -90,9 +92,11 @@ class ImmediateLiveCareViewModel extends ChangeNotifier { if (apiResponse.messageStatus == 2) { // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); } else if (apiResponse.messageStatus == 1) { - immediateLiveCareClinicsList = apiResponse.data!; + mainLiveCareClinicList = apiResponse.data!; - immediateLiveCareClinicsList.sort((a, b) => b.isOnline!.compareTo(a.isOnline!)); + mainLiveCareClinicList.sort((a, b) => b.isOnline!.compareTo(a.isOnline!)); + immediateLiveCareClinicsList.clear(); + immediateLiveCareClinicsList.addAll(mainLiveCareClinicList); isImmediateLiveCareClinicsLoading = false; notifyListeners(); @@ -103,6 +107,18 @@ class ImmediateLiveCareViewModel extends ChangeNotifier { }, ); } + void filterClinic(String query){ + if(query.isEmpty){ + immediateLiveCareClinicsList.clear(); + immediateLiveCareClinicsList.addAll(mainLiveCareClinicList); + }else{ + + // bool isArabic = getIt.get().isArabic(); + immediateLiveCareClinicsList = mainLiveCareClinicList.where((clinic) => clinic.serviceName!.toLowerCase().contains(query.toLowerCase()) || clinic.serviceNameN!.toLowerCase().contains(query.toLowerCase() + )).toList(); + } + notifyListeners(); + } Future getLiveCareImmediateAppointmentFees({Function(dynamic)? onSuccess, Function(String)? onError}) async { final result = diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 1bd8019d..fbe9bef9 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -312,9 +312,11 @@ abstract class LocaleKeys { static const myMedicalSubtitle = 'myMedicalSubtitle'; static const myDoctor = 'myDoctor'; static const myDoctorSubtitle = 'myDoctorSubtitle'; + static const myDoctorSubtitle2 = 'myDoctorSubtitle2'; static const eye = 'eye'; static const eyeSubtitle = 'eyeSubtitle'; static const insurance = 'insurance'; + static const insurance2 = 'insurance2'; static const insuranceSubtitle = 'insuranceSubtitle'; static const updateInsurance = 'updateInsurance'; static const updateInsuranceSubtitle = 'updateInsuranceSubtitle'; @@ -329,6 +331,7 @@ abstract class LocaleKeys { static const monthly = 'monthly'; static const monthlySubtitle = 'monthlySubtitle'; static const sick = 'sick'; + static const sick2 = 'sick2'; static const sickSubtitle = 'sickSubtitle'; static const myBalance = 'myBalance'; static const myBalanceSubtitle = 'myBalanceSubtitle'; @@ -492,8 +495,10 @@ abstract class LocaleKeys { static const refferalSubTitle = 'refferalSubTitle'; static const healthCare = 'healthCare'; static const emergency = 'emergency'; + static const emergency2 = 'emergency2'; static const erservices = 'erservices'; static const services2 = 'services2'; + static const services3 = 'services3'; static const cantSeeProfile = 'cantSeeProfile'; static const loginRegisterNow = 'loginRegisterNow'; static const hmgPharmacy = 'hmgPharmacy'; @@ -764,6 +769,7 @@ abstract class LocaleKeys { static const erConsultation = 'erConsultation'; static const myInvoice = 'myInvoice'; static const invoiceList = 'invoiceList'; + static const invoiceList2 = 'invoiceList2'; static const allInvoices = 'allInvoices'; static const hospitals = 'hospitals'; static const clinics = 'clinics'; @@ -1460,6 +1466,7 @@ abstract class LocaleKeys { static const distanceDescription = 'distanceDescription'; static const overview = 'overview'; static const details = 'details'; + static const details2 = 'details2'; static const healthy = 'healthy'; static const warning = 'warning'; static const vitalSignDetails = 'vitalSignDetails'; diff --git a/lib/presentation/book_appointment/livecare/select_immediate_livecare_clinic_page.dart b/lib/presentation/book_appointment/livecare/select_immediate_livecare_clinic_page.dart index 870c8ad8..16c7d421 100644 --- a/lib/presentation/book_appointment/livecare/select_immediate_livecare_clinic_page.dart +++ b/lib/presentation/book_appointment/livecare/select_immediate_livecare_clinic_page.dart @@ -3,6 +3,7 @@ import 'dart:async'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; +import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; @@ -22,6 +23,7 @@ import 'package:hmg_patient_app_new/presentation/book_appointment/livecare/widge import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; +import 'package:hmg_patient_app_new/widgets/input_widget.dart'; import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:provider/provider.dart'; @@ -68,6 +70,34 @@ class _SelectImmediateLiveCareClinicPageState extends State(builder: (context, immediateLiveCareVM, child) { return Column( children: [ + TextInputWidget( + labelText: LocaleKeys.search.tr(context: context), + hintText: LocaleKeys.clinicName.tr(context: context), + controller: searchEditingController, + isEnable: true, + prefix: null, + autoFocus: false, + isBorderAllowed: false, + keyboardType: TextInputType.text, + focusNode: textFocusNode, + suffix: searchEditingController.text.isNotEmpty + ? GestureDetector( + onTap: () { + searchEditingController.clear(); + immediateLiveCareVM.filterClinic(""); + textFocusNode.unfocus(); + }, + child: Utils.buildSvgWithAssets(icon: AppAssets.close_bottom_sheet_icon, width: 20.h, height: 20.h, fit: BoxFit.scaleDown), + ) + : null, + onChange: (value) { + immediateLiveCareVM.filterClinic(value!); + }, + padding: EdgeInsets.symmetric( + vertical: ResponsiveExtension(10).h, + horizontal: ResponsiveExtension(15).h, + ), + ), ListView.separated( padding: EdgeInsets.only(top: 16.h), shrinkWrap: true, diff --git a/lib/presentation/health_trackers/health_tracker_detail_page.dart b/lib/presentation/health_trackers/health_tracker_detail_page.dart index 737a150f..28e035b0 100644 --- a/lib/presentation/health_trackers/health_tracker_detail_page.dart +++ b/lib/presentation/health_trackers/health_tracker_detail_page.dart @@ -27,6 +27,7 @@ import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/graph/custom_graph.dart'; import 'package:hmg_patient_app_new/widgets/input_widget.dart'; import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; +import 'package:open_filex/open_filex.dart'; import 'package:provider/provider.dart'; import 'package:shimmer/shimmer.dart'; @@ -1250,7 +1251,32 @@ class _HealthTrackerDetailPageState extends State { return Scaffold( backgroundColor: AppColors.bgScaffoldColor, body: CollapsingListView( - sendEmail: () async => onSendEmailPressed(context), + downloadReport: () async { + + + + await context.read().downloadReport(widget.trackerType, + onSuccess: (report) async { + + if (report.isEmpty) {} + String path = await Utils.createFileFromString(report, "pdf"); + try { + OpenFilex.open(path); + } catch (ex) { + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getErrorWidget(loadingText: "Cannot open file"), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + } + }); + + + + // .downloadBloodSugerReport(); + }, title: _getPageTitle(), bottomChild: Consumer( builder: (context, viewModel, child) { diff --git a/lib/presentation/home/data/landing_page_data.dart b/lib/presentation/home/data/landing_page_data.dart index a60a7c18..fbf7043d 100644 --- a/lib/presentation/home/data/landing_page_data.dart +++ b/lib/presentation/home/data/landing_page_data.dart @@ -71,12 +71,12 @@ class LandingPageData { ), ]; - static List get getLoggedInServiceCardsList => [ + List get getLoggedInServiceCardsList => [ ServiceCardData( serviceName: "emergency", icon: AppAssets.emergency_services_icon, - title: LocaleKeys.emergency, - subtitle: LocaleKeys.services2, + title: getIt.get().isArabic()?LocaleKeys.services3 :LocaleKeys.emergency2, + subtitle: getIt.get().isArabic()?LocaleKeys.emergency2:LocaleKeys.services3, backgroundColor: AppColors.primaryRedColor, iconColor: Colors.white, textColor: Colors.white, @@ -85,8 +85,8 @@ class LandingPageData { ServiceCardData( serviceName: "lab_results", icon: AppAssets.home_lab_result_icon, - title: LocaleKeys.lab, - subtitle: LocaleKeys.labSubtitle, + title: getIt.get().isArabic()?LocaleKeys.labSubtitle:LocaleKeys.lab, + subtitle: getIt.get().isArabic()?LocaleKeys.lab:LocaleKeys.labSubtitle , backgroundColor: AppColors.whiteColor, iconColor: AppColors.blackColor, textColor: AppColors.blackColor, @@ -95,8 +95,8 @@ class LandingPageData { ServiceCardData( serviceName: "radiology_results", icon: AppAssets.my_radiology_icon, - title: LocaleKeys.radiology, - subtitle: LocaleKeys.radiologySubtitle, + title: getIt.get().isArabic()?LocaleKeys.labSubtitle:LocaleKeys.radiology, + subtitle: getIt.get().isArabic()?LocaleKeys.radiology:LocaleKeys.labSubtitle , backgroundColor: AppColors.whiteColor, iconColor: AppColors.blackColor, textColor: AppColors.blackColor, @@ -105,8 +105,8 @@ class LandingPageData { ServiceCardData( serviceName: "prescriptions", icon: AppAssets.my_prescription_icon, - title: LocaleKeys.medicinesSubtitle, - subtitle: LocaleKeys.details, + title: getIt.get().isArabic()?LocaleKeys.details2:LocaleKeys.medicinesSubtitle, + subtitle: getIt.get().isArabic()?LocaleKeys.medicinesSubtitle:LocaleKeys.details2, backgroundColor: AppColors.whiteColor, iconColor: AppColors.blackColor, textColor: AppColors.blackColor, @@ -115,8 +115,8 @@ class LandingPageData { ServiceCardData( serviceName: "insurance_update", icon: AppAssets.insurance_update_icon, - title: LocaleKeys.insurance, - subtitle: LocaleKeys.details, + title: getIt.get().isArabic()?LocaleKeys.details2: LocaleKeys.insurance2, + subtitle: getIt.get().isArabic()?LocaleKeys.insurance2: LocaleKeys.details2, backgroundColor: AppColors.whiteColor, iconColor: AppColors.blackColor, textColor: AppColors.blackColor, @@ -135,8 +135,8 @@ class LandingPageData { ServiceCardData( serviceName: "sick_leaves", icon: AppAssets.my_sick_leave_icon, - title: LocaleKeys.sick, - subtitle: LocaleKeys.sickSubtitle, + title: getIt.get().isArabic()?LocaleKeys.sickSubtitle:LocaleKeys.sick2, + subtitle: getIt.get().isArabic()?LocaleKeys.sick2:LocaleKeys.sickSubtitle, backgroundColor: AppColors.whiteColor, iconColor: AppColors.blackColor, textColor: AppColors.blackColor, @@ -145,8 +145,8 @@ class LandingPageData { ServiceCardData( serviceName: "my_invoice", icon: AppAssets.invoiceListIcon, - title: LocaleKeys.invoiceList, - subtitle: LocaleKeys.myDoctorSubtitle, + title: getIt.get().isArabic()?LocaleKeys.myDoctorSubtitle2:LocaleKeys.invoiceList2, + subtitle: getIt.get().isArabic()?LocaleKeys.invoiceList2:LocaleKeys.myDoctorSubtitle2, backgroundColor: AppColors.whiteColor, iconColor: AppColors.blackColor, textColor: AppColors.blackColor, diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index f103bd3f..fc5924ca 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -696,7 +696,7 @@ class _LandingPageState extends State { .width / 2.5 - 10), child: ListView.separated( scrollDirection: Axis.horizontal, - itemCount: LandingPageData.getLoggedInServiceCardsList.length, + itemCount: LandingPageData().getLoggedInServiceCardsList.length, shrinkWrap: true, controller: _horizontalScrollController, padding: EdgeInsets.only(left: 0.h, right: 0.h, top: 16.h, bottom: 12.h), @@ -708,14 +708,14 @@ class _LandingPageState extends State { horizontalOffset: 100.0, child: FadeInAnimation( child: SmallServiceCard( - icon: LandingPageData.getLoggedInServiceCardsList[index].icon, - title: LandingPageData.getLoggedInServiceCardsList[index].title, - subtitle: LandingPageData.getLoggedInServiceCardsList[index].subtitle, - iconColor: LandingPageData.getLoggedInServiceCardsList[index].iconColor!, - textColor: LandingPageData.getLoggedInServiceCardsList[index].textColor, - backgroundColor: LandingPageData.getLoggedInServiceCardsList[index].backgroundColor, - isBold: LandingPageData.getLoggedInServiceCardsList[index].isBold, - serviceName: LandingPageData.getLoggedInServiceCardsList[index].serviceName, + icon: LandingPageData().getLoggedInServiceCardsList[index].icon, + title: LandingPageData().getLoggedInServiceCardsList[index].title, + subtitle: LandingPageData().getLoggedInServiceCardsList[index].subtitle, + iconColor: LandingPageData().getLoggedInServiceCardsList[index].iconColor!, + textColor: LandingPageData().getLoggedInServiceCardsList[index].textColor, + backgroundColor: LandingPageData().getLoggedInServiceCardsList[index].backgroundColor, + isBold: LandingPageData().getLoggedInServiceCardsList[index].isBold, + serviceName: LandingPageData().getLoggedInServiceCardsList[index].serviceName, ), ), ), diff --git a/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart b/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart index 7ae38db1..52dba2dd 100644 --- a/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart +++ b/lib/presentation/lab/lab_result_via_clinic/lab_order_result_item.dart @@ -91,35 +91,41 @@ class LabOrderResultItem extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Visibility( - visible: tests?.checkIfGraphShouldBeDisplayed() == true, - child: Column( - spacing: 6.h, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - severityText.tr().toText10(isBold: true, color: AppColors.greyTextColor), - Utils.buildSvgWithAssets(icon: AppAssets.lab_result_indicator, width: 21, height: 23, iconColor: iconColor), - ], + Flexible( + flex: 2, + child: Visibility( + visible: tests?.checkIfGraphShouldBeDisplayed() == true, + child: Column( + spacing: 6.h, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + severityText.tr().toText10(isBold: true, color: AppColors.greyTextColor), + Utils.buildSvgWithAssets(icon: AppAssets.lab_result_indicator, width: 21, height: 23, iconColor: iconColor), + ], + ), ), ), - Visibility( - visible: tests?.checkIfGraphShouldBeDisplayed() == true, - child: CustomButton( - icon: AppAssets.view_report_icon, - iconColor: AppColors.infoColor, - iconSize: 16.h, - text: LocaleKeys.viewReport.tr(context: context), - onPressed: () { - onTap(); - }, - backgroundColor: AppColors.infoColor.withAlpha(20), - borderColor: AppColors.infoColor.withAlpha(0), - textColor: AppColors.infoColor, - fontSize: 14, - fontWeight: FontWeight.w600, - borderRadius: 12, - padding: EdgeInsets.fromLTRB(10, 0, 10, 0), - height: 40.h, + Flexible( + flex:2, + child: Visibility( + visible: tests?.checkIfGraphShouldBeDisplayed() == true, + child: CustomButton( + icon: AppAssets.view_report_icon, + iconColor: AppColors.infoColor, + iconSize: 16.h, + text: LocaleKeys.viewReport.tr(context: context), + onPressed: () { + onTap(); + }, + backgroundColor: AppColors.infoColor.withAlpha(20), + borderColor: AppColors.infoColor.withAlpha(0), + textColor: AppColors.infoColor, + fontSize: 14, + fontWeight: FontWeight.w600, + borderRadius: 12, + padding: EdgeInsets.fromLTRB(10, 0, 10, 0), + height: 40.h, + ), ), ), ], diff --git a/lib/widgets/bottom_navigation/bottom_navigation.dart b/lib/widgets/bottom_navigation/bottom_navigation.dart index 2518375a..fe586fe4 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation.dart @@ -27,7 +27,7 @@ class BottomNavigation extends StatelessWidget { BottomNavItem( icon: AppAssets.bookAppoBottom, fillIcon: AppAssets.bookAppoBottom, - label: LocaleKeys.appointment.tr(context: context), + label: LocaleKeys.appointments.tr(context: context), iconSize: 32, isSpecial: true), appState.isAuthenticated // ? BottomNavItem(icon: AppAssets.toDoBottom, label: LocaleKeys.todoList.tr(context: context)) @@ -80,7 +80,7 @@ class BottomNavigation extends StatelessWidget { ), // const SizedBox(height: 10), SizedBox(height: item.isSpecial ? 0 : 8.h), - item.label.toText11(isBold: true), + item.label.toText10(isBold: true), // SizedBox(height: item.isSpecial ? 5 : 0) ], ), diff --git a/lib/widgets/buttons/custom_button.dart b/lib/widgets/buttons/custom_button.dart index d2534587..d868755a 100644 --- a/lib/widgets/buttons/custom_button.dart +++ b/lib/widgets/buttons/custom_button.dart @@ -86,7 +86,8 @@ class CustomButton extends StatelessWidget { ), if (text.isNotEmpty && icon != null) Flexible( - child: Text( + child: + Text( text, overflow: textOverflow ?? TextOverflow.ellipsis, maxLines: 1,