diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 7820b354..f0e830f7 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -123,7 +123,7 @@ "forgotFileNoTitle": "نسيت الملف الطبي", "enterNationalId": "يرجى إدخال رقم الهاتف المحمول ورقم الهوية", "profileInfo": "يرجى إدخال معلومات الملف الشخصي", - "submit": "تحديث", + "submit": "بحث", "forgotDesc": "أدخل رقم الهاتف المحمول لاستلام رقم الملف الطبي عبر الرسائل القصيرة", "dob": "تاريخ الميلاد", "hijriDate": "التاريخ الهجري", @@ -1608,7 +1608,7 @@ "dietModerateCarbsDescription": "تناول معتدل للكربوهيدرات مع توازن في البروتين والدهون: يوفر طاقة مستقرة للأنشطة اليومية والتمارين مع قدر من المرونة. مناسب لكثير من الأشخاص الذين يسعون لإدارة وزن مستدامة وتحسين الأداء.", "dietUSDAGuidelinesDescription": "نمط متوازن مستند إلى (USDA): يركز على الفواكه والخضروات والحبوب الكاملة والبروتينات قليلة الدهن، مع الحد من السكريات المضافة والدهون المشبعة. يُعد إطارًا قائمًا على الأدلة لدعم الصحة العامة، وكفاية العناصر الغذائية، والوقاية من الأمراض المزمنة.", "dietZoneDietDescription": "حمية الزون (~40٪ كربوهيدرات / 30٪ بروتين / 30٪ دهون): تركز على التوازن الهرموني وضبط الحصص الغذائية. قد تُحسّن تركيب الجسم ومستوى الطاقة لدى بعض الأشخاص، لكنها تتطلب تخطيطًا جيدًا؛ ويُفضّل تخصيصها بالتعاون مع مختص تغذية.", - "contextDependent": "يعتمد السياق", + "contextDependent": "يختلف باختلاف الحالة", "calculatedValue": "القيمة المحسوبة", "calculationFormula": "صيغة الحساب", "confirmYourLocation": "قم بتأكيد موقعك", @@ -1822,7 +1822,7 @@ "symptomsCheckSuggestions": "الاحتمالات", "appointmentArrived": "تم الحضور", "calendarPermissionAlertForAppointment": "يرجى منح إذن الوصول إلى التقويم من إعدادات التطبيق لضبط تذكير الموعد", -"rechargePageKey": "اختر المستفيد", +"rechargePageKey": "شحن المحفظة", "selectFamilyFile": "اختيار ", "ancillaryOrdersListNew": "طلبات غير مكتملة", "medicalReportNew": "التقارير الطبية", @@ -1840,5 +1840,6 @@ "loadingAIAnalysisPrescription": "ٍتحليل الوصفات الطبية بواسطة الذكاء الاصطناعي، يرجى الانتظار...", "thisAboveInfoPrescription": "تم تحليل الوصفة الطبية هذه بواسطة الذكاء الاصطناعي، وهي لا تُعدّ نصيحة طبية. استشر طبيبك المختص للتشخيص والعلاج.", "liveCareNotificationPermissionsMessage": "يتطلب لايف كير أذونات الإشعارات، يرجى السماح بهذه الأذونات للمتابعة.", - "weatherIndicators": "طقس" + "weatherIndicators": "طقس", + "submitRating": "إرسال التقييم" } diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index 85318fea..e17992f9 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -1830,7 +1830,8 @@ "loadingAIAnalysisPrescription": "Analysing your prescription, let the AI do the magic, This might take some time.", "thisAboveInfoPrescription": "This prescription was analyzed by AI, and it is not medical advice. Consult your healthcare provider for diagnosis and treatment.", "liveCareNotificationPermissionsMessage": "LiveCare requires Notifications permission, Please allow to proceed.", - "weatherIndicators": "Weather" + "weatherIndicators": "Weather", + "submitRating": "Submit" } diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index a8f8c2fb..db4d6a8c 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -34,7 +34,7 @@ class ApiConsts { // static String QLINE_URL = "https://qline.hmg.com/api/PatientCall/PatientInQueue_Detail"; - static String CHAT_URL = "https://chat.hmg.com/Index.aspx?RequestedId="; + static String CHAT_URL = "https://chat.hmg.com/geneysChat/Index.aspx?RequestedId="; // static String GET_TAMARA_INSTALLMENTS_URL = "https://epharmacy.hmg.com/tamara/Home/getinstallments"; @@ -58,6 +58,7 @@ class ApiConsts { symptomsCheckerUsername = 'mobile_user'; symptomsCheckerPassword = '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92'; + CHAT_URL = "https://chat.hmg.com/geneysChat/Index.aspx?RequestedId="; break; case AppEnvironmentTypeEnum.dev: baseUrl = "https://uat.hmgwebservices.com/"; diff --git a/lib/core/utils/push_notification_handler.dart b/lib/core/utils/push_notification_handler.dart index c96591ab..9bf34660 100644 --- a/lib/core/utils/push_notification_handler.dart +++ b/lib/core/utils/push_notification_handler.dart @@ -351,6 +351,8 @@ class PushNotificationHandler { init(BuildContext context) async { this.context = context; + await requestPermissions(); + if (Platform.isIOS) { voIPKit.getVoIPToken().then((value) { log("🎈 APNS VOIP KIT TOKEN: $value"); @@ -441,7 +443,9 @@ class PushNotificationHandler { sound: true, ); if (permission.authorizationStatus == AuthorizationStatus.denied) return; - } else {} + } else { + final permission = await FirebaseMessaging.instance.requestPermission(); + } try { FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage? message) async { diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index 6b209b67..d02607c5 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -34,6 +34,7 @@ import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/authentication/login.dart'; import 'package:hmg_patient_app_new/presentation/authentication/saved_login_screen.dart'; import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart'; +import 'package:hmg_patient_app_new/presentation/my_family/my_family.dart'; import 'package:hmg_patient_app_new/routes/app_routes.dart'; import 'package:hmg_patient_app_new/services/cache_service.dart'; import 'package:hmg_patient_app_new/services/dialog_service.dart'; @@ -368,11 +369,7 @@ class AuthenticationViewModel extends ChangeNotifier { } else if (apiResponse.messageStatus == 1) { if (apiResponse.data['isSMSSent']) { _appState.setAppAuthToken = apiResponse.data['LogInTokenID']; - await sendActivationCode( - otpTypeEnum: otpTypeEnum, - phoneNumber: phoneNumberController.text, - nationalIdOrFileNumber: nationalIdController.text, - isForRegister: false); + await sendActivationCode(otpTypeEnum: otpTypeEnum, phoneNumber: phoneNumberController.text, nationalIdOrFileNumber: nationalIdController.text, isForRegister: false); } else { if (apiResponse.data['IsAuthenticated']) { await checkActivationCode( @@ -434,10 +431,7 @@ class AuthenticationViewModel extends ChangeNotifier { } final resultEither = await _authenticationRepo.sendActivationCodeRepo( - sendActivationCodeReq: request, - isRegister: checkIsUserComingForRegister(request: payload), - languageID: 'er', - isFormFamilyFile: isFormFamilyFile); + sendActivationCodeReq: request, isRegister: checkIsUserComingForRegister(request: payload), languageID: 'er', isFormFamilyFile: isFormFamilyFile); resultEither.fold( (failure) async => await _errorHandlerService.handleError(failure: failure), @@ -514,9 +508,7 @@ class AuthenticationViewModel extends ChangeNotifier { bool isSwitchUser = false, int? patientID, }) async { - bool isForRegister = (_appState.getUserRegistrationPayload.healthId != null || - _appState.getUserRegistrationPayload.patientOutSa == true || - _appState.getUserRegistrationPayload.patientOutSa == 1); + bool isForRegister = (_appState.getUserRegistrationPayload.healthId != null || _appState.getUserRegistrationPayload.patientOutSa == true || _appState.getUserRegistrationPayload.patientOutSa == 1); MyAppointmentsViewModel myAppointmentsVM = getIt(); if (isSwitchUser && _appState.getSuperUserID == null) { @@ -558,8 +550,7 @@ class AuthenticationViewModel extends ChangeNotifier { request["ForRegisteration"] = _appState.getUserRegistrationPayload.isRegister; request["isRegister"] = false; - final resultEither = - await _authenticationRepo.checkActivationCodeRepo(newRequest: request, activationCode: activationCode.toString(), isRegister: true); + final resultEither = await _authenticationRepo.checkActivationCodeRepo(newRequest: request, activationCode: activationCode.toString(), isRegister: true); LoaderBottomSheet.hideLoader(); @@ -633,7 +624,9 @@ class AuthenticationViewModel extends ChangeNotifier { await medicalVm.getFamilyFiles(status: 0); if (isFormFamilyFile) { await medicalVm.getAllPendingRecordsByResponseId(); - _navigationService.pushAndReplace(AppRoutes.medicalFilePage); + _navigationService.replaceAllRoutesAndNavigateToLandingWithMedicalAuth().whenComplete(() { + _navigationService.pushPageRoute(AppRoutes.familyFilesPage); + }); } else { _navigationService.replaceAllRoutesAndNavigateToLanding(); } @@ -870,8 +863,7 @@ class AuthenticationViewModel extends ChangeNotifier { : _appState.getAuthenticatedUser()!.mobileNumber)!; nationalIdController.text = _appState.getAuthenticatedUser()!.patientIdentificationNo!; onSuccess(); - } else if ((loginTypeEnum == LoginTypeEnum.sms || - loginTypeEnum == LoginTypeEnum.whatsapp && _appState.getSelectDeviceByImeiRespModelElement == null) && + } else if ((loginTypeEnum == LoginTypeEnum.sms || loginTypeEnum == LoginTypeEnum.whatsapp && _appState.getSelectDeviceByImeiRespModelElement == null) && _appState.getAuthenticatedUser() != null) { phoneNumberController.text = (_appState.getAuthenticatedUser()!.mobileNumber!.startsWith("0") ? _appState.getAuthenticatedUser()!.mobileNumber!.replaceFirst("0", "") @@ -928,8 +920,7 @@ class AuthenticationViewModel extends ChangeNotifier { LoaderBottomSheet.showLoader(); // LoadingUtils.showFullScreenLoader(loadingText: "Setting up your medical file.\nMay take a moment."); - var request = RequestUtils.getUserSignupCompletionRequest( - fullName: nameController.text, emailAddress: emailController.text, gender: genderType, maritalStatus: maritalStatus); + var request = RequestUtils.getUserSignupCompletionRequest(fullName: nameController.text, emailAddress: emailController.text, gender: genderType, maritalStatus: maritalStatus); final resultEither = await _authenticationRepo.registerUser(registrationPayloadDataModelRequest: request); resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) async { @@ -1059,8 +1050,7 @@ class AuthenticationViewModel extends ChangeNotifier { biometricEnabled: loginType == 1 || loginType == 2 ? false : true, firstNameN: _appState.getAuthenticatedUser()!.firstNameN, lastNameN: _appState.getAuthenticatedUser()!.lastNameN, - zipCode: - _appState.getAuthenticatedUser()!.zipCode //selectedCountrySignup == CountryEnum.others ? '0': selectedCountrySignup.countryCode, + zipCode: _appState.getAuthenticatedUser()!.zipCode //selectedCountrySignup == CountryEnum.others ? '0': selectedCountrySignup.countryCode, ) .toJson()); resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) async { diff --git a/lib/features/my_appointments/my_appointments_repo.dart b/lib/features/my_appointments/my_appointments_repo.dart index eeef41e4..553491e1 100644 --- a/lib/features/my_appointments/my_appointments_repo.dart +++ b/lib/features/my_appointments/my_appointments_repo.dart @@ -16,6 +16,7 @@ import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/ import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_history_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_appointment_share_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_queue_details_response_model.dart'; +import 'package:hmg_patient_app_new/features/my_invoices/models/get_invoices_list_response_model.dart'; import 'package:hmg_patient_app_new/services/logger_service.dart'; import 'models/req_model/appointment_rate_req_model.dart'; @@ -89,6 +90,8 @@ abstract class MyAppointmentsRepo { required int clinicID, required int appointmentNo, }); + + Future>>> getAppointmentInvoice(num appointmentNum); } class MyAppointmentsRepoImp implements MyAppointmentsRepo { @@ -1142,4 +1145,42 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo { return Left(UnknownFailure(e.toString())); } } + + @override + Future>>> getAppointmentInvoice(num appointmentNum) async { + Map mapDevice = {"AppointmentNo": appointmentNum}; + + try { + GenericApiModel>? apiResponse; + Failure? failure; + await apiClient.post( + GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC, + body: mapDevice, + onFailure: (error, statusCode, {messageStatus, failureType}) { + failure = failureType; + }, + onSuccess: (response, statusCode, {messageStatus, errorMessage}) { + try { + final list = response['List_AllInvoices']; + + final invoicesList = list.map((item) => GetInvoicesListResponseModel.fromJson(item as Map)).toList().cast(); + + apiResponse = GenericApiModel>( + messageStatus: messageStatus, + statusCode: statusCode, + errorMessage: null, + data: invoicesList, + ); + } 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())); + } + } } diff --git a/lib/features/my_appointments/my_appointments_view_model.dart b/lib/features/my_appointments/my_appointments_view_model.dart index cb52a19d..2fda0505 100644 --- a/lib/features/my_appointments/my_appointments_view_model.dart +++ b/lib/features/my_appointments/my_appointments_view_model.dart @@ -2,6 +2,7 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:get_it/get_it.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/calender_utils_new.dart'; import 'package:hmg_patient_app_new/core/utils/date_util.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; @@ -17,6 +18,8 @@ import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/ import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/patient_queue_details_response_model.dart'; import 'package:hmg_patient_app_new/features/my_appointments/my_appointments_repo.dart'; import 'package:hmg_patient_app_new/features/my_appointments/utils/appointment_type.dart'; +import 'package:hmg_patient_app_new/features/my_invoices/models/get_invoices_list_response_model.dart'; +import 'package:hmg_patient_app_new/features/my_invoices/my_invoices_repo.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/presentation/insurance/insurance_home_page.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart'; @@ -25,6 +28,7 @@ import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.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:open_filex/open_filex.dart'; class MyAppointmentsViewModel extends ChangeNotifier { int selectedTabIndex = 0; @@ -1519,4 +1523,74 @@ class MyAppointmentsViewModel extends ChangeNotifier { ); } } + + Future getAppointmentInvoice({required num appointmentNum, Function(dynamic)? onSuccess, Function(String)? onError}) async { + String? downloadInvoicePDFBase64 = ""; + final result = await myAppointmentsRepo.getAppointmentInvoice(appointmentNum); + + result.fold( + (failure) async { + if (onError != null) { + onError(failure.message ?? "Unknown error"); + } + }, + (apiResponse) async { + if (apiResponse.messageStatus == 2) { + if (onError != null) { + onError(apiResponse.errorMessage ?? "Unknown error"); + } + // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); + } else if (apiResponse.messageStatus == 1) { + if (apiResponse.data!.isNotEmpty) { + GetInvoicesListResponseModel getInvoicesListResponseModel = apiResponse.data!.first; + final result = await getIt + .get() + .downloadInvoice(setupId: getInvoicesListResponseModel.setupId!, invoiceNo: getInvoicesListResponseModel.invoiceNo!, projectID: getInvoicesListResponseModel.projectId!); + + result.fold( + (failure) async { + if (onError != null) { + onError(failure.message); + } + }, + (apiResponse) async { + if (apiResponse.messageStatus == 2) { + // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); + } else if (apiResponse.messageStatus == 1) { + if (apiResponse.data != null && apiResponse.data!.isNotEmpty) { + downloadInvoicePDFBase64 = apiResponse.data!; + String path = await Utils.createFileFromString(downloadInvoicePDFBase64!, "pdf"); + try { + OpenFilex.open(path); + } catch (ex) { + showCommonBottomSheetWithoutHeight( + GetIt.instance().navigatorKey.currentContext!, + child: Utils.getErrorWidget(loadingText: "Cannot open file"), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + } + } else { + downloadInvoicePDFBase64 = ""; + } + if (onSuccess != null) { + onSuccess(apiResponse); + } + } + }, + ); + } else { + showCommonBottomSheetWithoutHeight( + GetIt.instance().navigatorKey.currentContext!, + child: Utils.getErrorWidget(loadingText: "Cannot open invoice"), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + } + } + }, + ); + } } diff --git a/lib/features/radiology/radiology_view_model.dart b/lib/features/radiology/radiology_view_model.dart index cf795a1d..30f9683a 100644 --- a/lib/features/radiology/radiology_view_model.dart +++ b/lib/features/radiology/radiology_view_model.dart @@ -61,10 +61,18 @@ class RadiologyViewModel extends ChangeNotifier { } Future getPatientRadiologyOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async { + patientRadiologyOrders.clear(); + notifyListeners(); + final result = await radiologyRepo.getPatientRadiologyOrders(); result.fold( - (failure) async => await errorHandlerService.handleError(failure: failure), + // (failure) async => await errorHandlerService.handleError(failure: failure), + (failure) { + isRadiologyOrdersLoading = false; + filterSuggestions(); + notifyListeners(); + }, (apiResponse) { if (apiResponse.messageStatus == 2) { // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 7e4f4c0b..d5410585 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1831,7 +1831,8 @@ abstract class LocaleKeys { static const generateAiAnalysisPrescription = 'generateAiAnalysisPrescription'; static const loadingAIAnalysisPrescription = 'loadingAIAnalysisPrescription'; static const thisAboveInfoPrescription = 'thisAboveInfoPrescription'; - static const weatherIndicators = 'weatherIndicators'; static const liveCareNotificationPermissionsMessage = 'liveCareNotificationPermissionsMessage'; + static const weatherIndicators = 'weatherIndicators'; + static const submitRating = 'submitRating'; } diff --git a/lib/presentation/appointments/appointment_details_page.dart b/lib/presentation/appointments/appointment_details_page.dart index 1c0347e1..7b63d87f 100644 --- a/lib/presentation/appointments/appointment_details_page.dart +++ b/lib/presentation/appointments/appointment_details_page.dart @@ -802,6 +802,32 @@ class _AppointmentDetailsPageState extends State { ), ); }), + MedicalFileCard( + label: LocaleKeys.viewInvoiceDetails.tr(context: context), + textColor: AppColors.blackColor, + backgroundColor: AppColors.whiteColor, + svgIcon: AppAssets.invoices_list_icon, + isLargeText: true, + iconSize: 36.w, + ).onPress(() { + LoaderBottomSheet.showLoader(loadingText: LocaleKeys.fetchingInvoiceDetails.tr(context: context)); + myAppointmentsViewModel.getAppointmentInvoice( + appointmentNum: widget.patientAppointmentHistoryResponseModel.appointmentNo, + onSuccess: (val) { + LoaderBottomSheet.hideLoader(); + }, + onError: (err) { + LoaderBottomSheet.hideLoader(); + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getErrorWidget(loadingText: err), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + }, + ); + }), myAppointmentsVM.isAppointmentRatedResponseLoading ? MedicalFileCard( label: "Medical File", diff --git a/lib/presentation/appointments/widgets/appointment_card.dart b/lib/presentation/appointments/widgets/appointment_card.dart index d53b541b..98bc48d6 100644 --- a/lib/presentation/appointments/widgets/appointment_card.dart +++ b/lib/presentation/appointments/widgets/appointment_card.dart @@ -294,7 +294,7 @@ class _AppointmentCardState extends State { SizedBox(height: 8.h), Wrap( direction: Axis.horizontal, - spacing: 3.h, + spacing: 6.h, runSpacing: 4.h, children: [ AppCustomChipWidget( diff --git a/lib/presentation/book_appointment/livecare/immediate_livecare_pending_request_page.dart b/lib/presentation/book_appointment/livecare/immediate_livecare_pending_request_page.dart index ed524ab6..1c4f63e8 100644 --- a/lib/presentation/book_appointment/livecare/immediate_livecare_pending_request_page.dart +++ b/lib/presentation/book_appointment/livecare/immediate_livecare_pending_request_page.dart @@ -9,6 +9,7 @@ import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; +import 'package:hmg_patient_app_new/features/contact_us/contact_us_view_model.dart'; import 'package:hmg_patient_app_new/features/immediate_livecare/immediate_livecare_view_model.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; @@ -31,6 +32,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State().getChatRequestID( + name: name, + mobileNo: mobileNo, + workGroup: "Live_Care_Chat", + onSuccess: (response) { + debugPrint("Chat Request ID received: ${getIt.get().chatRequestID}"); + chatURL = "https://chat.hmg.com/Index.aspx?RequestedId=${getIt.get().chatRequestID}"; + debugPrint("Chat URL: $chatURL"); + Uri uri = Uri.parse(chatURL); + launchUrl(uri, mode: LaunchMode.platformDefault, webOnlyWindowName: ""); + }, + onError: (error) { + debugPrint("Error getting chat request ID: $error"); + }, + ); + } + // void startTimer() { // // timer = Timer.periodic(const Duration(seconds: 1), (_) => addTime()); // // setState(() {}); diff --git a/lib/presentation/hmg_services/widgets/weather_widget.dart b/lib/presentation/hmg_services/widgets/weather_widget.dart index 65ad9de5..9ea2aa2b 100644 --- a/lib/presentation/hmg_services/widgets/weather_widget.dart +++ b/lib/presentation/hmg_services/widgets/weather_widget.dart @@ -110,9 +110,9 @@ class WeatherWidget extends StatelessWidget { ); }, padding: EdgeInsets.zero, - backgroundColor: AppColors.secondaryLightRedColor, - borderColor: AppColors.secondaryLightRedColor, - textColor: AppColors.primaryRedColor, + backgroundColor: AppColors.infoColor.withValues(alpha: 0.12), + borderColor: AppColors.infoColor.withValues(alpha: 0.01), + textColor: AppColors.infoColor, fontSize: 14.f, fontWeight: FontWeight.w600, borderRadius: 10.r, diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index b8313323..07e60238 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -146,16 +146,11 @@ class _LandingPageState extends State { notificationsViewModel.initNotificationsViewModel(); insuranceViewModel.initInsuranceProvider(); - // Commented as per new requirement to remove rating popup from the app - - if (!appState.isRatedVisible) { - appointmentRatingViewModel.getLastRatingAppointment( - onSuccess: (response) { - if (appointmentRatingViewModel.appointmentRatedList.isNotEmpty) { - appointmentRatingViewModel.getAppointmentDetails( - appointmentRatingViewModel.appointmentRatedList.last.appointmentNo!, - appointmentRatingViewModel.appointmentRatedList.last.projectID!, - onSuccess: ((response) { + if(!appState.isRatedVisible) { + appointmentRatingViewModel.getLastRatingAppointment(onSuccess: (response) { + if (appointmentRatingViewModel.appointmentRatedList.isNotEmpty) { + appointmentRatingViewModel.getAppointmentDetails(appointmentRatingViewModel.appointmentRatedList.last.appointmentNo!, appointmentRatingViewModel.appointmentRatedList.last.projectID!, + onSuccess: ((response) { appointmentRatingViewModel.setClinicOrDoctor(false); appointmentRatingViewModel.setTitle(LocaleKeys.rateDoctor.tr(context: context)); appointmentRatingViewModel.setSubTitle(LocaleKeys.howWasYourLastVisitWithDoctor.tr(context: context)); @@ -1455,10 +1450,6 @@ class _DirectionalDotPaginationBuilder extends SwiperPlugin { @override Widget build(BuildContext context, SwiperPluginConfig config) { - final int activeIndex = isRTL ? (totalCount - 1 - config.activeIndex) : config.activeIndex; - print("the index is $activeIndex"); - print("the config.activeIndex is ${config.activeIndex}"); - return Row( mainAxisSize: MainAxisSize.min, textDirection: ui.TextDirection.ltr, // always lay out dots left-to-right diff --git a/lib/presentation/lab/search_lab_report.dart b/lib/presentation/lab/search_lab_report.dart index ac559f42..24f24d68 100644 --- a/lib/presentation/lab/search_lab_report.dart +++ b/lib/presentation/lab/search_lab_report.dart @@ -25,9 +25,8 @@ class _SearchLabResultsContentState extends State { @override void initState() { super.initState(); - filteredSuggestions = List.from(widget.labSuggestionsList); + filteredSuggestions = List.from(widget.labSuggestionsList)..sort((a, b) => a.toLowerCase().compareTo(b.toLowerCase())); - // Listen for changes in the search field searchEditingController.addListener(() { filterSuggestions(); }); @@ -44,11 +43,11 @@ class _SearchLabResultsContentState extends State { if (query.isEmpty) { setState(() { - filteredSuggestions = List.from(widget.labSuggestionsList); + filteredSuggestions = List.from(widget.labSuggestionsList)..sort((a, b) => a.toLowerCase().compareTo(b.toLowerCase())); }); } else { setState(() { - filteredSuggestions = widget.labSuggestionsList.where((suggestion) => suggestion.toLowerCase().contains(query)).toList(); + filteredSuggestions = widget.labSuggestionsList.where((suggestion) => suggestion.toLowerCase().contains(query)).toList()..sort((a, b) => a.toLowerCase().compareTo(b.toLowerCase())); }); } } diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index 008a3849..f4c05a4b 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -40,6 +40,9 @@ import 'package:hmg_patient_app_new/presentation/appointments/widgets/ask_doctor import 'package:hmg_patient_app_new/presentation/book_appointment/book_appointment_page.dart'; import 'package:hmg_patient_app_new/presentation/book_appointment/doctor_profile_page.dart'; import 'package:hmg_patient_app_new/presentation/book_appointment/widgets/appointment_calendar.dart'; +import 'package:hmg_patient_app_new/presentation/habib_wallet/habib_wallet_page.dart'; +import 'package:hmg_patient_app_new/presentation/habib_wallet/recharge_wallet_page.dart'; +import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart'; import 'package:hmg_patient_app_new/presentation/insurance/insurance_approvals_page.dart'; import 'package:hmg_patient_app_new/presentation/insurance/insurance_home_page.dart'; import 'package:hmg_patient_app_new/presentation/insurance/widgets/insurance_update_details_card.dart'; diff --git a/lib/presentation/profile_settings/profile_settings.dart b/lib/presentation/profile_settings/profile_settings.dart index 16c2a383..c581bcd5 100644 --- a/lib/presentation/profile_settings/profile_settings.dart +++ b/lib/presentation/profile_settings/profile_settings.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; @@ -318,21 +319,22 @@ class ProfileSettingsState extends State { // actionItem(AppAssets.permission, LocaleKeys.permissions.tr(context: context), () {}, trailingLabel: "Location, Camera"), // 1.divider, actionItem(AppAssets.rate, LocaleKeys.rateApp.tr(context: context), () async { - if (await inAppReview.isAvailable()) { - inAppReview.requestReview(); - } else { - inAppReview.openStoreListing(appStoreId: '6758851027'); - } - // if (Platform.isAndroid) { - // Utils.openWebView( - // url: 'https://play.google.com/store/apps/details?id=com.ejada.hmg', - // ); + // if (await inAppReview.isAvailable()) { + // inAppReview.requestReview(); // } else { - // Utils.openWebView( - // url: 'https://itunes.apple.com/app/id733503978', - // ); + // inAppReview.openStoreListing(appStoreId: '6758851027'); // } - // }, isExternalLink: true), + if (Platform.isAndroid) { + inAppReview.openStoreListing(appStoreId: '6758851027'); + // Utils.openWebView( + // url: 'https://play.google.com/store/apps/details?id=com.ejada.hmg', + // ); + } else { + if (await inAppReview.isAvailable()) { + inAppReview.requestReview(); + } + } + // }, isExternalLink: true), }), 1.divider, actionItem(AppAssets.privacy_terms, LocaleKeys.privacyPolicy.tr(context: context), () { diff --git a/lib/presentation/rate_appointment/rate_appointment_doctor.dart b/lib/presentation/rate_appointment/rate_appointment_doctor.dart index 9a3925a1..d78dc59e 100644 --- a/lib/presentation/rate_appointment/rate_appointment_doctor.dart +++ b/lib/presentation/rate_appointment/rate_appointment_doctor.dart @@ -192,7 +192,7 @@ class _RateAppointmentDoctorState extends State { SizedBox(width: 10), Expanded( child: CustomButton( - text: LocaleKeys.submit.tr(context: context), + text: LocaleKeys.submitRating.tr(context: context), onPressed: rating > 0 ? () { LoaderBottomSheet.showLoader(); diff --git a/lib/routes/app_routes.dart b/lib/routes/app_routes.dart index 861cf455..f4ddff9b 100644 --- a/lib/routes/app_routes.dart +++ b/lib/routes/app_routes.dart @@ -18,6 +18,7 @@ import 'package:hmg_patient_app_new/presentation/home/app_update_page.dart'; import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart'; import 'package:hmg_patient_app_new/presentation/home_health_care/hhc_procedures_page.dart'; import 'package:hmg_patient_app_new/presentation/medical_file/medical_file_page.dart'; +import 'package:hmg_patient_app_new/presentation/my_family/my_family.dart'; import 'package:hmg_patient_app_new/presentation/servicesPriceList/services_price_list_page.dart'; import 'package:hmg_patient_app_new/presentation/smartwatches/smartwatch_home_page.dart'; import 'package:hmg_patient_app_new/presentation/symptoms_checker/organ_selector_screen.dart'; @@ -97,6 +98,9 @@ class AppRoutes { // Weather static const String weatherDetailsPage = '/weatherDetailsPage'; + // Weather + static const String familyFilesPage = '/familyFilesPage'; + static Map get routes => { initialRoute: (context) => SplashPage(), loginScreen: (context) => LoginScreen(), @@ -134,6 +138,7 @@ class AppRoutes { emergencyServicesPage: (context) => EmergencyServicesPage(), servicesPriceListPage: (context) => ServicesPriceListPage(), weatherDetailsPage: (context) => WeatherDetailsPage(), + familyFilesPage: (context) => FamilyMedicalScreen(), addHealthTrackerEntryPage: (context) { final args = ModalRoute.of(context)?.settings.arguments as HealthTrackerTypeEnum?; return AddHealthTrackerEntryPage( diff --git a/lib/services/navigation_service.dart b/lib/services/navigation_service.dart index da4a75b9..3f0fb2a1 100644 --- a/lib/services/navigation_service.dart +++ b/lib/services/navigation_service.dart @@ -25,6 +25,7 @@ class NavigationService { navigatorKey.currentState?.popUntil(ModalRoute.withName(routeName)); } + void replaceAllRoutesAndNavigateToLanding() { AppState appState = getIt.get(); appState.isAuthenticated = false; @@ -34,6 +35,13 @@ class NavigationService { ); } + Future replaceAllRoutesAndNavigateToLandingWithMedicalAuth() async { + navigatorKey.currentState?.pushNamedAndRemoveUntil( + AppRoutes.landingScreen, + (Route route) => false, + ); + } + void replaceAllRoutesAndNavigateToLandingAuth() { navigatorKey.currentState?.pushNamedAndRemoveUntil( AppRoutes.landingScreen, @@ -50,17 +58,10 @@ class NavigationService { } Future pushToOtpScreen( - {required String phoneNumber, - required Function(int code) checkActivationCode, - required Function(String phoneNumber) onResendOTPPressed, - bool isFormFamilyFile = false}) { + {required String phoneNumber, required Function(int code) checkActivationCode, required Function(String phoneNumber) onResendOTPPressed, bool isFormFamilyFile = false}) { return navigatorKey.currentState!.push( MaterialPageRoute( - builder: (_) => OTPVerificationScreen( - phoneNumber: phoneNumber, - checkActivationCode: checkActivationCode, - onResendOTPPressed: onResendOTPPressed, - isFormFamilyFile: isFormFamilyFile)), + builder: (_) => OTPVerificationScreen(phoneNumber: phoneNumber, checkActivationCode: checkActivationCode, onResendOTPPressed: onResendOTPPressed, isFormFamilyFile: isFormFamilyFile)), ); } diff --git a/lib/widgets/family_files/family_file_add_widget.dart b/lib/widgets/family_files/family_file_add_widget.dart index 92a14fd8..429b7f4e 100644 --- a/lib/widgets/family_files/family_file_add_widget.dart +++ b/lib/widgets/family_files/family_file_add_widget.dart @@ -57,7 +57,7 @@ class _FamilyFileAddWidgetState extends State { isAllowRadius: true, isBorderAllowed: false, isAllowLeadingIcon: true, - autoFocus: true, + autoFocus: false, keyboardType: TextInputType.number, fontFamily: "Poppins", padding: EdgeInsets.symmetric(vertical: 8.h), @@ -76,7 +76,7 @@ class _FamilyFileAddWidgetState extends State { isAllowRadius: true, isBorderAllowed: false, isAllowLeadingIcon: true, - autoFocus: true, + autoFocus: false, keyboardType: TextInputType.number, fontFamily: "Poppins", padding: EdgeInsets.symmetric(vertical: 8.h), @@ -91,7 +91,9 @@ class _FamilyFileAddWidgetState extends State { CustomButton( text: LocaleKeys.add.tr(context: context), onPressed: () { - FocusScope.of(context).unfocus(); + // Unfocus all text fields and dismiss keyboard + FocusManager.instance.primaryFocus?.unfocus(); + if (ValidationUtils.isValidatedIdAndPhoneWithCountryValidation( nationalId: authVm.nationalIdController.text, selectedCountry: authVm.selectedCountrySignup, diff --git a/pubspec.yaml b/pubspec.yaml index 7cb61939..33ced45d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,8 +2,8 @@ name: hmg_patient_app_new description: "New HMG Patient App" publish_to: 'none' # Remove this line if you wish to publish to pub.dev -#version: 0.0.22+21 -version: 0.0.1+20 +version: 0.0.25+24 +#version: 0.0.1+23 environment: sdk: ">=3.6.0 <4.0.0"