From 8a41b5716fccd7a4c9ee92af65bf5e7ce1480546 Mon Sep 17 00:00:00 2001 From: Sultan khan Date: Thu, 16 Apr 2026 11:39:59 +0300 Subject: [PATCH 1/3] updates --- lib/core/utils/push_notification_handler.dart | 9 ++++++ .../authentication_view_model.dart | 2 +- lib/generated/locale_keys.g.dart | 8 ++--- lib/splashPage.dart | 31 ++++++++++++++----- 4 files changed, 37 insertions(+), 13 deletions(-) diff --git a/lib/core/utils/push_notification_handler.dart b/lib/core/utils/push_notification_handler.dart index c82c608d..23cb4f51 100644 --- a/lib/core/utils/push_notification_handler.dart +++ b/lib/core/utils/push_notification_handler.dart @@ -58,6 +58,10 @@ _incomingCall(Map data) async { String roomID = data['session_id'] ?? ''; String callTypeID = data['AppointmentNo'] ?? ''; + print('🔍 Extracted from notification data:'); + print(' - roomID (session_id): "$roomID"'); + print(' - callTypeID (AppointmentNo): "$callTypeID"'); + // Generate unique call ID var _currentUuid = Uuid().v4(); _currentCallId = _currentUuid; @@ -70,6 +74,11 @@ _incomingCall(Map data) async { await Utils.saveStringFromPrefs(CacheConst.callTypeID, callTypeID); await Utils.saveBoolFromPrefs(CacheConst.isAppOpenedFromCall, true); + print('💾 Saved to cache:'); + print(' - CacheConst.zoomRoomID: "$roomID"'); + print(' - CacheConst.callTypeID: "$callTypeID"'); + print(' - CacheConst.isAppOpenedFromCall: true'); + WidgetsFlutterBinding.ensureInitialized(); int callKitType = callTypeID == '2' ? 0 : 1; diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index eb922652..31618918 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -1120,7 +1120,7 @@ class AuthenticationViewModel extends ChangeNotifier { _dialogService.showPhoneNumberPickerSheet( // label: "Where would you like to receive OTP?", label: LocaleKeys.receiveOtpToast.tr(), - message: _appState.isArabic() ? "يرجى الاختيار من الخيارات أدناه لاستلام رمز التحقق." "Please select from the below options to receive OTP.", + message: _appState.isArabic() ? "يرجى الاختيار من الخيارات أدناه لاستلام رمز التحقق.": "Please select from the below options to receive OTP.", onSMSPress: () { checkUserAuthentication(otpTypeEnum: OTPTypeEnum.sms); }, diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 22cca7e4..61eff14b 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1767,6 +1767,10 @@ abstract class LocaleKeys { static const locationServicesDisabled = 'locationServicesDisabled'; static const selectDateTimeKey = 'selectDateTimeKey'; static const medicalKey = 'medicalKey'; + static const doctors2 = 'doctors2'; + static const illurgyInfomation = 'illurgyInfomation'; + static const vaccineInfomation = 'vaccineInfomation'; + static const approvals1 = 'approvals1'; static const convertBloodcholesterolInfo = 'convertBloodcholesterolInfo'; static const carbsAlert = 'carbsAlert'; static const bodyFatAlert = 'bodyFatAlert'; @@ -1783,9 +1787,5 @@ abstract class LocaleKeys { static const selectBloodDonationCity = 'selectBloodDonationCity'; static const selectBloodDonationGender = 'selectBloodDonationGender'; static const selectBloodType = 'selectBloodType'; - static const doctors2 = 'doctors2'; - static const illurgyInfomation = 'illurgyInfomation'; - static const vaccineInfomation = 'vaccineInfomation'; - static const approvals1 = 'approvals1'; } diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 7fe97e6f..cf1ca7f4 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -185,13 +185,28 @@ class _SplashScreenState extends State { case Event.actionCallDecline: print('actionCallDecline Event Received: ------->'); - // Get session ID from cache - String sessionId = await Utils.getStringFromPrefs(CacheConst.zoomRoomID); - // - // // Update session status to 3 (declined by patient) - // if (sessionId.isNotEmpty) { + // Try to get session ID from event data first + String? sessionIdFromEvent = event.body['extra']?['roomID']; + + // Get session ID from cache as backup + String sessionIdFromCache = await Utils.getStringFromPrefs(CacheConst.zoomRoomID); + + // Use event data if available, otherwise use cache + String sessionId = (sessionIdFromEvent != null && sessionIdFromEvent.isNotEmpty) + ? sessionIdFromEvent + : sessionIdFromCache; + + print('🔍 Session ID from event: "$sessionIdFromEvent"'); + print('🔍 Session ID from cache: "$sessionIdFromCache"'); + print('🔍 Final session ID to use: "$sessionId"'); + + // Update session status to 3 (declined by patient) + if (sessionId.isNotEmpty) { + print('✅ Session ID found, calling API...'); await _updateSessionStatus(sessionId, 3, 'Patient'); - // } + } else { + print('⚠️ Session ID is empty, skipping API call'); + } await FlutterCallkitIncoming.endAllCalls(); GetIt.instance().remove(key: CacheConst.isAppOpenedFromCall); @@ -243,9 +258,9 @@ class _SplashScreenState extends State { print('📡 Updating session status - SessionID: $sessionId, Status: $sessionStatus, EndedBy: $sessionEndedBy'); final apiClient = getIt.get(); - String sessionID = await Utils.getStringFromPrefs(CacheConst.zoomRoomID); + Map requestBody = { - "Open_SessionID": sessionID, + "Open_SessionID": sessionId, "SessionStatus": sessionStatus, "SessionEndedBy": sessionEndedBy }; From 1366518ce1677d444f1d20af83c399eef50cd5a5 Mon Sep 17 00:00:00 2001 From: Sultan khan Date: Thu, 16 Apr 2026 12:45:18 +0300 Subject: [PATCH 2/3] fixes and updates --- .../weather/models/waether_cities_model.dart | 8 +++-- lib/generated/locale_keys.g.dart | 4 +++ ...mediate_livecare_pending_request_page.dart | 3 +- lib/presentation/home/landing_page.dart | 3 +- .../weather/weather_details_page.dart | 34 ++++++++++++++----- 5 files changed, 40 insertions(+), 12 deletions(-) diff --git a/lib/features/weather/models/waether_cities_model.dart b/lib/features/weather/models/waether_cities_model.dart index 6a434bff..be08cc99 100644 --- a/lib/features/weather/models/waether_cities_model.dart +++ b/lib/features/weather/models/waether_cities_model.dart @@ -234,14 +234,18 @@ final category5Values = EnumValues({ enum ColorName { GREEN, + LIGHTGREEN, ORANGE, - RED + RED, + YELLOW } final colorNameValues = EnumValues({ "green": ColorName.GREEN, + "lightgreen": ColorName.LIGHTGREEN, "orange": ColorName.ORANGE, - "red": ColorName.RED + "red": ColorName.RED, + "yellow": ColorName.YELLOW }); class EnumValues { diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 3759ebaf..b3478629 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -1767,6 +1767,10 @@ abstract class LocaleKeys { static const locationServicesDisabled = 'locationServicesDisabled'; static const selectDateTimeKey = 'selectDateTimeKey'; static const medicalKey = 'medicalKey'; + static const doctors2 = 'doctors2'; + static const illurgyInfomation = 'illurgyInfomation'; + static const vaccineInfomation = 'vaccineInfomation'; + static const approvals1 = 'approvals1'; static const convertBloodcholesterolInfo = 'convertBloodcholesterolInfo'; static const carbsAlert = 'carbsAlert'; static const bodyFatAlert = 'bodyFatAlert'; 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 5e0b5fa5..99cd0dec 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 @@ -163,7 +163,7 @@ class _ImmediateLiveCarePendingRequestPageState extends State { SizedBox(height: 10.h), SizedBox(height: 8.h), _buildLiveCareQueueInfo(liveCareData.patCount), - SizedBox(height: 25.h), + SizedBox(height: 14.h), ], ), CustomButton( @@ -1169,6 +1169,7 @@ class _LandingPageState extends State { height: 40.h, iconColor: AppColors.whiteColor, iconSize: 18.h, + ), // _buildLiveCareWaitingTime(), ], diff --git a/lib/presentation/weather/weather_details_page.dart b/lib/presentation/weather/weather_details_page.dart index 6943b3ee..261eab22 100644 --- a/lib/presentation/weather/weather_details_page.dart +++ b/lib/presentation/weather/weather_details_page.dart @@ -1,8 +1,6 @@ import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_export.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/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/features/weather/models/waether_cities_model.dart'; @@ -21,7 +19,10 @@ class WeatherDetailsPage extends StatelessWidget { switch (colorName) { case ColorName.GREEN: + case ColorName.LIGHTGREEN: return AppColors.successColor; + case ColorName.YELLOW: + return AppColors.warningColorYellow; case ColorName.ORANGE: return AppColors.warningColor; case ColorName.RED: @@ -34,7 +35,10 @@ class WeatherDetailsPage extends StatelessWidget { switch (colorName) { case ColorName.GREEN: + case ColorName.LIGHTGREEN: return AppColors.successLightColor.withValues(alpha: 0.1); + case ColorName.YELLOW: + return AppColors.warningColorYellow.withValues(alpha: 0.1); case ColorName.ORANGE: return AppColors.warningLightColor.withValues(alpha: 0.1); case ColorName.RED: @@ -42,8 +46,14 @@ class WeatherDetailsPage extends StatelessWidget { } } - /// Get color based on category label - Color _getColorFromCategory(String? categoryLabel) { + /// Get color based on colorName from API (language-independent) + Color _getColorFromColorNameOrCategory(ColorName? colorName, String? categoryLabel) { + // First priority: Use the colorName from API if available + if (colorName != null) { + return _getColorFromColorName(colorName); + } + + // Fallback: Try to parse category label (for English) if (categoryLabel == null) return AppColors.successColor; final category = categoryLabel.toLowerCase().trim(); @@ -68,8 +78,14 @@ class WeatherDetailsPage extends StatelessWidget { return AppColors.successColor; // Default to green } - /// Get background color based on category label - Color _getBackgroundFromCategory(String? categoryLabel) { + /// Get background color based on colorName from API (language-independent) + Color _getBackgroundFromColorNameOrCategory(ColorName? colorName, String? categoryLabel) { + // First priority: Use the colorName from API if available + if (colorName != null) { + return _getBackgroundColorFromColorName(colorName); + } + + // Fallback: Try to parse category label (for English) if (categoryLabel == null) return AppColors.successLightColor.withValues(alpha: 0.1); final category = categoryLabel.toLowerCase().trim(); @@ -136,8 +152,9 @@ class WeatherDetailsPage extends StatelessWidget { return _buildCategoryCard( description: cityInfo.name ?? '', categoryLabel: cityInfo.category ?? '', - color: _getColorFromCategory(cityInfo.category), - backgroundColor: _getBackgroundFromCategory(cityInfo.category), + colorName: cityInfo.colorName, + color: _getColorFromColorNameOrCategory(cityInfo.colorName, cityInfo.category), + backgroundColor: _getBackgroundFromColorNameOrCategory(cityInfo.colorName, cityInfo.category), icon: _getIconFromCategory(cityInfo.category), ); }), @@ -154,6 +171,7 @@ class WeatherDetailsPage extends StatelessWidget { Widget _buildCategoryCard({ required String description, required String categoryLabel, + required ColorName? colorName, required Color color, required Color backgroundColor, required IconData icon, From dfc2e21e8ce33d37b885edbfd1338adde2d43b51 Mon Sep 17 00:00:00 2001 From: Sultan khan Date: Thu, 16 Apr 2026 12:45:49 +0300 Subject: [PATCH 3/3] no message --- assets/images/svg/invoices_list_icon.svg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/images/svg/invoices_list_icon.svg b/assets/images/svg/invoices_list_icon.svg index f1230960..5f653ced 100644 --- a/assets/images/svg/invoices_list_icon.svg +++ b/assets/images/svg/invoices_list_icon.svg @@ -1,4 +1,4 @@ - - + +