From 9d8744ec17a4bcbc01f421e42e69a0cbfca3a97a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 8 Jul 2026 16:27:34 +0300 Subject: [PATCH 1/2] Updates --- lib/core/api/api_client.dart | 2 +- lib/core/api_consts.dart | 4 ++-- lib/core/utils/date_util.dart | 3 ++- .../medical_file/medical_file_view_model.dart | 19 ++++++++++--------- .../my_appointments_view_model.dart | 5 ++++- .../prescriptions_view_model.dart | 10 +++++----- lib/main.dart | 6 +----- .../medical_file/medical_file_page.dart | 2 +- .../widgets/medical_report_card.dart | 2 +- .../medical_report/medical_reports_page.dart | 2 +- 10 files changed, 28 insertions(+), 27 deletions(-) diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index 6a44cb0e..5537b8b4 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -211,8 +211,8 @@ class ApiClientImp implements ApiClient { } // body['TokenID'] = "@dm!n"; + // body['PatientID'] = 53320; // body['PatientID'] = 4769748; - // body['PatientID'] = 89754444; // body['PatientTypeID'] = 1; // body['PatientOutSA'] = 0; // body['SessionID'] = "45786230487560q"; diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 089f371b..c4feec0b 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -5,7 +5,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.uat; // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT @@ -301,7 +301,7 @@ class ApiConsts { static String googleCloudStorageENTranslationFileBaseURL = "https://storage.googleapis.com/hmg-patientapp-translations"; // ************ static values for Api **************** - static final double appVersionID = 21.4; + static final double appVersionID = 21.5; // static final double appVersionID = 50.7; static final int appChannelId = 3; diff --git a/lib/core/utils/date_util.dart b/lib/core/utils/date_util.dart index 0994171f..97c8dad0 100644 --- a/lib/core/utils/date_util.dart +++ b/lib/core/utils/date_util.dart @@ -18,7 +18,8 @@ class DateUtil { final endIndex = date.indexOf(end, startIndex + start.length); return DateTime.fromMillisecondsSinceEpoch(int.parse( date.substring(startIndex + start.length, endIndex), - ), isUtc: true).add(Duration(hours: 3)); + // ), isUtc: true).add(Duration(hours: 3)); + ), isUtc: true).toLocal(); } static DateTime convertStringToDateSaudiTimezone(String date, int projectId) { diff --git a/lib/features/medical_file/medical_file_view_model.dart b/lib/features/medical_file/medical_file_view_model.dart index 41a726d9..e0abd9d7 100644 --- a/lib/features/medical_file/medical_file_view_model.dart +++ b/lib/features/medical_file/medical_file_view_model.dart @@ -42,7 +42,7 @@ class MedicalFileViewModel extends ChangeNotifier { bool isSickLeavesSortByClinic = true; - // bool isSickLeavesDataNeedsReloading = true; + bool isSickLeavesDataNeedsReloading = true; List patientAllergiesList = []; @@ -165,15 +165,15 @@ class MedicalFileViewModel extends ChangeNotifier { } setIsPatientSickLeaveListLoading(bool val) { - // if (val && isSickLeavesDataNeedsReloading) { - patientSickLeaveList.clear(); - patientSickLeavesByClinic.clear(); + if (val && isSickLeavesDataNeedsReloading) { + patientSickLeaveList.clear(); + patientSickLeavesByClinic.clear(); patientSickLeavesByHospital.clear(); patientSickLeavesViewList.clear(); patientSickLeavePDFBase64 = ""; isSickLeavesSortByClinic = true; isPatientSickLeaveListLoading = val; - // } + } notifyListeners(); } @@ -282,9 +282,9 @@ class MedicalFileViewModel extends ChangeNotifier { } Future getPatientSickLeaveList({Function(dynamic)? onSuccess, Function(String)? onError}) async { - // if (!isSickLeavesDataNeedsReloading) { - // return; - // } + if (!isSickLeavesDataNeedsReloading) { + return; + } patientSickLeaveList.clear(); notifyListeners(); @@ -300,6 +300,7 @@ class MedicalFileViewModel extends ChangeNotifier { // ), (failure) async { isPatientSickLeaveListLoading = false; + isSickLeavesDataNeedsReloading = true; notifyListeners(); }, (apiResponse) { @@ -330,7 +331,7 @@ class MedicalFileViewModel extends ChangeNotifier { } } patientSickLeavesViewList = patientSickLeavesByClinic; - // isSickLeavesDataNeedsReloading = false; + isSickLeavesDataNeedsReloading = false; notifyListeners(); if (onSuccess != null) { diff --git a/lib/features/my_appointments/my_appointments_view_model.dart b/lib/features/my_appointments/my_appointments_view_model.dart index 9182f9e7..f28eb49b 100644 --- a/lib/features/my_appointments/my_appointments_view_model.dart +++ b/lib/features/my_appointments/my_appointments_view_model.dart @@ -54,6 +54,7 @@ class MyAppointmentsViewModel extends ChangeNotifier { bool isFavouriteDoctorsDataFetched = false; bool isAppointmentDataToBeLoaded = true; + bool isMyDoctorsDataToBeLoaded = true; bool isEyeMeasurementsAppointmentsLoading = false; @@ -213,6 +214,7 @@ class MyAppointmentsViewModel extends ChangeNotifier { setIsAppointmentDataToBeLoaded(bool val) { if (val) { isMyAppointmentsLoading = true; + isMyDoctorsDataToBeLoaded = true; } isAppointmentDataToBeLoaded = val; notifyListeners(); @@ -674,7 +676,7 @@ class MyAppointmentsViewModel extends ChangeNotifier { } Future getPatientMyDoctors({Function(dynamic)? onSuccess, Function(String)? onError}) async { - // if (!isAppointmentDataToBeLoaded) return; + if (!isMyDoctorsDataToBeLoaded) return; isPatientMyDoctorsLoading = true; patientMyDoctorsList.clear(); notifyListeners(); @@ -692,6 +694,7 @@ class MyAppointmentsViewModel extends ChangeNotifier { } else if (apiResponse.messageStatus == 1) { patientMyDoctorsList = apiResponse.data!; isPatientMyDoctorsLoading = false; + isMyDoctorsDataToBeLoaded = false; notifyListeners(); if (onSuccess != null) { onSuccess(apiResponse); diff --git a/lib/features/prescriptions/prescriptions_view_model.dart b/lib/features/prescriptions/prescriptions_view_model.dart index bfb83a2c..5354daad 100644 --- a/lib/features/prescriptions/prescriptions_view_model.dart +++ b/lib/features/prescriptions/prescriptions_view_model.dart @@ -64,7 +64,7 @@ class PrescriptionsViewModel extends ChangeNotifier { PrescriptionsViewModel({required this.prescriptionsRepo, required this.errorHandlerService, required this.navServices}); initPrescriptionsViewModel() { - // if (isPrescriptionsDataNeedsReloading) { + if (isPrescriptionsDataNeedsReloading) { patientPrescriptionOrders.clear(); patientPrescriptionOrdersByClinic.clear(); patientPrescriptionOrdersByHospital.clear(); @@ -72,7 +72,7 @@ class PrescriptionsViewModel extends ChangeNotifier { prescriptionsOrderList.clear(); isPrescriptionsOrdersLoading = true; getPatientPrescriptionOrders(); - // } + } isSortByClinic = true; isPrescriptionsDeliveryOrdersLoading = true; notifyListeners(); @@ -138,9 +138,9 @@ class PrescriptionsViewModel extends ChangeNotifier { } Future getPatientPrescriptionOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async { - // if (!isPrescriptionsDataNeedsReloading) { - // return; - // } + if (!isPrescriptionsDataNeedsReloading) { + return; + } final result = await prescriptionsRepo.getPatientPrescriptionOrders(patientId: "1231755"); diff --git a/lib/main.dart b/lib/main.dart index 6e3ef8cc..aa266871 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -63,6 +63,7 @@ import 'core/utils/size_utils.dart'; import 'features/monthly_reports/terms_conditions_view_model.dart'; import 'firebase_options.dart'; + @pragma('vm:entry-point') Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); @@ -109,11 +110,6 @@ Future callInitializations() async { WidgetsFlutterBinding.ensureInitialized(); await EasyLocalization.ensureInitialized(); - // Download the latest JSONs from your server - // await TranslationService.downloadTranslations(); - - // await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); - try { // Attempt to get the default app. If it exists, this avoids the error. await Firebase.app(); diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index 66135dda..a6a335fc 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -1099,7 +1099,7 @@ class _MedicalFilePageState extends State { itemBuilder: (context, index) { return AnimationConfiguration.staggeredList( position: index, - duration: const Duration(milliseconds: 1000), + duration: const Duration(milliseconds: 250), child: SlideAnimation( horizontalOffset: 100.0, child: FadeInAnimation( diff --git a/lib/presentation/medical_file/widgets/medical_report_card.dart b/lib/presentation/medical_file/widgets/medical_report_card.dart index 1dc080c7..1a43b83b 100644 --- a/lib/presentation/medical_file/widgets/medical_report_card.dart +++ b/lib/presentation/medical_file/widgets/medical_report_card.dart @@ -92,7 +92,7 @@ class MedicalReportCard extends StatelessWidget { // fontWeight: FontWeight.w600, isBold: true, borderRadius: 12.r, - height: 48.h, + height: 40.h, ).toShimmer2(isShow: isLoading), ], ), diff --git a/lib/presentation/medical_report/medical_reports_page.dart b/lib/presentation/medical_report/medical_reports_page.dart index e03a53a0..9463debe 100644 --- a/lib/presentation/medical_report/medical_reports_page.dart +++ b/lib/presentation/medical_report/medical_reports_page.dart @@ -242,7 +242,7 @@ class _MedicalReportsPageState extends State { mainAxisSize: MainAxisSize.min, children: [ Utils.buildImgWithNetwork( - url: report.doctorImageURL!, + url: report.doctorImageURL ?? "", iconColor: AppColors.transparent, width: 24.h, height: 24.h, From 4972295606b1bfa83c3060580599606cac028d6e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 8 Jul 2026 16:41:02 +0300 Subject: [PATCH 2/2] update --- lib/presentation/appointments/widgets/appointment_card.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/presentation/appointments/widgets/appointment_card.dart b/lib/presentation/appointments/widgets/appointment_card.dart index 39251cd6..e98eda82 100644 --- a/lib/presentation/appointments/widgets/appointment_card.dart +++ b/lib/presentation/appointments/widgets/appointment_card.dart @@ -277,7 +277,7 @@ class _AppointmentCardState extends State { (widget.isLoading ? 'Dr' : "${widget.patientAppointmentHistoryResponseModel.doctorTitle}").toText16(isBold: true, maxlines: 1), Expanded( child: (widget.isLoading ? 'John Doe' : " ${widget.patientAppointmentHistoryResponseModel.doctorNameObj!.truncate(30)}").toText16( - isBold: true, maxlines: 2, textOverflow: TextOverflow.ellipsis, isEnglishOnly: !Utils.isArabicText(widget.patientAppointmentHistoryResponseModel.doctorNameObj ?? "John Doe")), + isBold: true, maxlines: 1, textOverflow: TextOverflow.ellipsis, isEnglishOnly: !Utils.isArabicText(widget.patientAppointmentHistoryResponseModel.doctorNameObj ?? "John Doe")), ), SizedBox(width: 12.w), (widget.patientAppointmentHistoryResponseModel.doctorNationalityFlagURL != null &&