From 04db9918514ca58580b618540b0092dfc83aad21 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Fri, 17 Apr 2026 09:07:03 +0300 Subject: [PATCH 1/2] updates --- android/app/src/main/AndroidManifest.xml | 5 +++-- .../health_calculators_page.dart | 1 + lib/presentation/my_family/widget/family_cards.dart | 11 ++++++++++- pubspec.yaml | 4 ++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index fef05b1a..dec59139 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -14,7 +14,8 @@ tools:node="remove" /> + tools:node="remove" /> + @@ -42,7 +43,7 @@ - + diff --git a/lib/presentation/health_calculators_and_converts/health_calculators_page.dart b/lib/presentation/health_calculators_and_converts/health_calculators_page.dart index aff34461..4d685dbe 100644 --- a/lib/presentation/health_calculators_and_converts/health_calculators_page.dart +++ b/lib/presentation/health_calculators_and_converts/health_calculators_page.dart @@ -36,6 +36,7 @@ class _HealthCalculatorsPageState extends State { Widget build(BuildContext context) { DialogService dialogService = getIt.get(); return CollapsingListView( + isLeading: Navigator.canPop(context), title: widget.type == HealthCalConEnum.calculator ? LocaleKeys.healthCalculators.tr(context: context) : LocaleKeys.healthConverters.tr(), child: widget.type == HealthCalConEnum.calculator ? CustomExpandableList( diff --git a/lib/presentation/my_family/widget/family_cards.dart b/lib/presentation/my_family/widget/family_cards.dart index 84406aad..672e4c3e 100644 --- a/lib/presentation/my_family/widget/family_cards.dart +++ b/lib/presentation/my_family/widget/family_cards.dart @@ -437,7 +437,16 @@ class _FamilyCardsState extends State { ); }), SizedBox(width: 4.h), - Utils.buildSvgWithAssets(icon: AppAssets.arrowRight), + Transform.flip( + flipX: getIt.get().isArabic(), + child: Utils.buildSvgWithAssets( + icon: AppAssets.arrowRight, + iconColor: AppColors.blackColor, + width: 22.w, + height: 22.h, + fit: BoxFit.contain, + ) + ), ], ), SizedBox(height: 24.h), diff --git a/pubspec.yaml b/pubspec.yaml index 4d853184..34e04a02 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.16+13 -#version: 0.0.1+16 +version: 0.0.19+18 +#version: 0.0.1+18 environment: sdk: ">=3.6.0 <4.0.0" From 333f702f80fc6a635dbe065a7c0b0dc6730bb3a8 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Fri, 17 Apr 2026 18:07:51 +0300 Subject: [PATCH 2/2] updates & fixes --- assets/langs/ar-SA.json | 2 +- lib/core/utils/calender_utils_new.dart | 53 +++--- .../hmg_services/hmg_services_view_model.dart | 2 +- .../e_referral/new_e_referral.dart | 10 +- .../hmg_services/services_page.dart | 11 +- .../medical_file/medical_file_page.dart | 3 - .../widgets/medical_report_card.dart | 3 +- lib/widgets/scroll_wheel_time_picker.dart | 171 +++++++++--------- 8 files changed, 134 insertions(+), 121 deletions(-) diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 6f97fbbe..302c188e 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -382,7 +382,7 @@ "myWallet": "محفظتي", "balanceAmount": "مبلغ المحفظة", "totalBalance": "إجمالي الرصيد", - "createAdvancedPayment": "إعادة شحن المحفظة", + "createAdvancedPayment": "شحن المحفظة", "advancePayment": "دفع مسبق", "advancePaymentLabel": "يمكنك إنشاء وإضافة دفعة مقدمة لحسابك أو حسابات أخرى.", "fileNumber": "رقم الملف", diff --git a/lib/core/utils/calender_utils_new.dart b/lib/core/utils/calender_utils_new.dart index bbf69119..441214b5 100644 --- a/lib/core/utils/calender_utils_new.dart +++ b/lib/core/utils/calender_utils_new.dart @@ -43,37 +43,36 @@ class CalenderUtilsNew { } Future _loadCalendars() async { - print("the get calenders is called"); CalendarPermissionStatus result = await DeviceCalendar.instance.hasPermissions(); if (result != CalendarPermissionStatus.granted) { await DeviceCalendar.instance.requestPermissions(); result = await DeviceCalendar.instance.hasPermissions(); - // if (result != CalendarPermissionStatus.granted) { - // print("the permission is not granted"); - // showCommonBottomSheetWithoutHeight( - // title: LocaleKeys.notice.tr(context: GetIt - // .instance() - // .navigatorKey - // .currentContext!), - // GetIt - // .instance() - // .navigatorKey - // .currentContext!, - // child: Utils.getWarningWidget( - // loadingText: LocaleKeys.calendarPermissionAlert.tr(), - // isShowActionButtons: true, - // onCancelTap: () { - // GetIt.instance().pop(); - // }, - // onConfirmTap: () async { - // GetIt.instance().pop(); - // openAppSettings(); - // }), - // callBackFunc: () {}, - // isFullScreen: false, - // isCloseButtonVisible: true, - // ); - // } + if (result != CalendarPermissionStatus.granted) { + print("the permission is not granted"); + showCommonBottomSheetWithoutHeight( + title: LocaleKeys.notice.tr(context: GetIt + .instance() + .navigatorKey + .currentContext!), + GetIt + .instance() + .navigatorKey + .currentContext!, + child: Utils.getWarningWidget( + loadingText: LocaleKeys.calendarPermissionAlert.tr(), + isShowActionButtons: true, + onCancelTap: () { + GetIt.instance().pop(); + }, + onConfirmTap: () async { + GetIt.instance().pop(); + openAppSettings(); + }), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); + } } var calenders = await calender.listCalendars(); calenders.forEach((calender) { diff --git a/lib/features/hmg_services/hmg_services_view_model.dart b/lib/features/hmg_services/hmg_services_view_model.dart index 10b340fd..9f468f76 100644 --- a/lib/features/hmg_services/hmg_services_view_model.dart +++ b/lib/features/hmg_services/hmg_services_view_model.dart @@ -718,7 +718,7 @@ class HmgServicesViewModel extends ChangeNotifier { result.fold( (failure) async { notifyListeners(); - await errorHandlerService.handleError(failure: failure); + // await errorHandlerService.handleError(failure: failure); if (onError != null) { onError(failure.toString()); } diff --git a/lib/presentation/e_referral/new_e_referral.dart b/lib/presentation/e_referral/new_e_referral.dart index b9d54942..53c91680 100644 --- a/lib/presentation/e_referral/new_e_referral.dart +++ b/lib/presentation/e_referral/new_e_referral.dart @@ -134,11 +134,17 @@ class _NewReferralPageState extends State { onSuccess: (GenericApiModel response) { LoaderBottomSheet.hideLoader(); showSuccessBottomSheet(int.parse(response.data), hmgServicesVM); - - }, onError: (errorMessage) { // Handle error (e.g., show error message) + LoaderBottomSheet.hideLoader(); + showCommonBottomSheetWithoutHeight(context, + title: LocaleKeys.error.tr(context: context), + child: Utils.getErrorWidget( + loadingText: errorMessage.toString(), + ), callBackFunc: () { + Navigator.of(context).pop(); + }, isFullScreen: false); print(errorMessage); }, ); diff --git a/lib/presentation/hmg_services/services_page.dart b/lib/presentation/hmg_services/services_page.dart index 827ff8c7..9ad0fa31 100644 --- a/lib/presentation/hmg_services/services_page.dart +++ b/lib/presentation/hmg_services/services_page.dart @@ -34,6 +34,7 @@ import 'package:hmg_patient_app_new/presentation/home/service_info_page.dart'; import 'package:hmg_patient_app_new/presentation/home/widgets/large_service_card.dart'; import 'package:hmg_patient_app_new/presentation/hmg_services/widgets/weather_widget.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/parking/paking_page.dart'; import 'package:hmg_patient_app_new/presentation/servicesPriceList/services_price_list_page.dart'; import 'package:hmg_patient_app_new/services/dialog_service.dart'; @@ -586,7 +587,7 @@ class _ServicesPageState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Utils.buildSvgWithAssets(icon: AppAssets.services_medical_file_icon, width: 40.w, height: 40.h, applyThemeColor: false), - LocaleKeys.medicalFile.tr().toText16(isBold: true, maxlines: 2).expanded, + LocaleKeys.familyTitle.tr().toText16(isBold: true, maxlines: 2).expanded, Utils.buildSvgWithAssets(icon: getIt.get().isArabic() ? AppAssets.arrow_back : AppAssets.arrow_forward), ], ), @@ -653,9 +654,15 @@ class _ServicesPageState extends State { ], ).onPress(() async { if (getIt.get().isAuthenticated) { + // Navigator.of(context).push( + // CustomPageRoute( + // page: MedicalFilePage(), + // ), + // ); Navigator.of(context).push( CustomPageRoute( - page: MedicalFilePage(), + direction: AxisDirection.down, + page: FamilyMedicalScreen(), ), ); } else { diff --git a/lib/presentation/medical_file/medical_file_page.dart b/lib/presentation/medical_file/medical_file_page.dart index 9d8c6cc1..6c1e74c2 100644 --- a/lib/presentation/medical_file/medical_file_page.dart +++ b/lib/presentation/medical_file/medical_file_page.dart @@ -1292,9 +1292,6 @@ class _MedicalFilePageState extends State { Selector listRequest, List listReady})>( selector: (context, vm) => (isLoading: vm.isPatientMedicalReportsListLoading, listRequest: vm.patientMedicalReportRequestedList, listReady: vm.patientMedicalReportReadyList), builder: (context, data, _){ - print("isloading are ${data.isLoading}"); - print("listRequest are ${data.listRequest}"); - print("listReady are ${data.listReady}"); return MedicalReportCard( isLoading: data.isLoading, listRequest: data.listRequest, listReady: data.listReady ); diff --git a/lib/presentation/medical_file/widgets/medical_report_card.dart b/lib/presentation/medical_file/widgets/medical_report_card.dart index 4759a65b..f5f0d40d 100644 --- a/lib/presentation/medical_file/widgets/medical_report_card.dart +++ b/lib/presentation/medical_file/widgets/medical_report_card.dart @@ -89,7 +89,8 @@ class MedicalReportCard extends StatelessWidget { textColor: AppColors.primaryRedColor, iconColor: AppColors.primaryRedColor, fontSize: 14.f, - fontWeight: FontWeight.w600, + // fontWeight: FontWeight.w600, + isBold: true, borderRadius: 12.r, height: 48.h, ).toShimmer2(isShow: isLoading), diff --git a/lib/widgets/scroll_wheel_time_picker.dart b/lib/widgets/scroll_wheel_time_picker.dart index e1a35d6f..9029ca15 100644 --- a/lib/widgets/scroll_wheel_time_picker.dart +++ b/lib/widgets/scroll_wheel_time_picker.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; +import 'dart:ui' as ui; class ScrollWheelTimePicker extends StatefulWidget { @@ -87,97 +88,99 @@ class _ScrollWheelTimePickerState extends State { final digitStyle = widget.digitTextStyle ?? _defaultDigitStyle; final separatorStyle = widget.separatorTextStyle ?? _defaultSeparatorStyle; - return SizedBox( - height: widget.pickerHeight, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - SizedBox( - width: 150.w, - child: ListWheelScrollView.useDelegate( - controller: _hourController, - itemExtent: widget.itemExtent, - physics: const FixedExtentScrollPhysics(), - perspective: 0.005, - diameterRatio: 1.2, - onSelectedItemChanged: (index) { - setState(() { - _selectedHour = - widget.use24HourFormat ? index : index + 1; - }); - _notifyChange(); - }, - childDelegate: ListWheelChildBuilderDelegate( - childCount: _maxHour, - builder: (context, index) { - final hour = - widget.use24HourFormat ? index : index + 1; - final isSelected = hour == _selectedHour; - return Visibility( - visible: true, - child: Center( - child: AnimatedDefaultTextStyle( - duration: const Duration(milliseconds: 200), - style: digitStyle.copyWith( - color: isSelected - ? AppColors.textColor - : AppColors.textColor.withValues(alpha: 0.3), - ), - child: Text( - hour.toString().padLeft(2, '0'), + return Directionality( + textDirection: ui.TextDirection.ltr, + child: SizedBox( + height: widget.pickerHeight, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox( + width: 150.w, + child: ListWheelScrollView.useDelegate( + controller: _hourController, + itemExtent: widget.itemExtent, + physics: const FixedExtentScrollPhysics(), + perspective: 0.005, + diameterRatio: 1.2, + onSelectedItemChanged: (index) { + setState(() { + _selectedHour = + widget.use24HourFormat ? index : index + 1; + }); + _notifyChange(); + }, + childDelegate: ListWheelChildBuilderDelegate( + childCount: _maxHour, + builder: (context, index) { + final hour = + widget.use24HourFormat ? index : index + 1; + final isSelected = hour == _selectedHour; + return Visibility( + visible: true, + child: Center( + child: AnimatedDefaultTextStyle( + duration: const Duration(milliseconds: 200), + style: digitStyle.copyWith( + color: isSelected + ? AppColors.textColor + : AppColors.textColor.withValues(alpha: 0.3), + ), + child: Text( + hour.toString().padLeft(2, '0'), + ), ), ), - ), - ); - }, + ); + }, + ), ), ), - ), - - Padding( - padding: EdgeInsets.symmetric(horizontal: 2.w), - child: Text(':', style: separatorStyle), - ), - - SizedBox( - width: 150.w, - child: ListWheelScrollView.useDelegate( - controller: _minuteController, - itemExtent: widget.itemExtent, - physics: const FixedExtentScrollPhysics(), - perspective: 0.005, - diameterRatio: 1.2, - onSelectedItemChanged: (index) { - setState(() { - _selectedMinute = index; - }); - _notifyChange(); - }, - childDelegate: ListWheelChildBuilderDelegate( - childCount: 60, - - builder: (context, index) { - final isSelected = index == _selectedMinute; - return Visibility( - visible: true, - child: - Center( - child: AnimatedDefaultTextStyle( - duration: const Duration(milliseconds: 200), - style: digitStyle.copyWith( - color: isSelected - ? AppColors.textColor - : AppColors.transparent.withValues(alpha: 0.3), - ), - child: Text(index.toString().padLeft(2, '0')), - ), - )); + + Padding( + padding: EdgeInsets.symmetric(horizontal: 2.w), + child: Text(':', style: separatorStyle), + ), + + SizedBox( + width: 150.w, + child: ListWheelScrollView.useDelegate( + controller: _minuteController, + itemExtent: widget.itemExtent, + physics: const FixedExtentScrollPhysics(), + perspective: 0.005, + diameterRatio: 1.2, + onSelectedItemChanged: (index) { + setState(() { + _selectedMinute = index; + }); + _notifyChange(); }, + childDelegate: ListWheelChildBuilderDelegate( + childCount: 60, + builder: (context, index) { + final isSelected = index == _selectedMinute; + return Visibility( + visible: true, + child: + Center( + child: AnimatedDefaultTextStyle( + duration: const Duration(milliseconds: 200), + style: digitStyle.copyWith( + color: isSelected + ? AppColors.textColor + : AppColors.transparent.withValues(alpha: 0.3), + ), + child: Text(index.toString().padLeft(2, '0')), + ), + )); + }, + ), ), ), - ), - ], + ], + ), ), ); }