Merge branch 'master' into dev_aamir

# Conflicts:
#	assets/langs/ar-SA.json
#	assets/langs/en-US.json
dev_aamir
aamir-csol 5 hours ago
commit baa9ebe7ea

@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.70711 1.29289C2.31658 0.902369 1.68342 0.902369 1.29289 1.29289C0.902369 1.68342 0.902369 2.31658 1.29289 2.70711L4.01381 5.42803C2.9068 6.9926 2.25 8.88897 2.25 10.9258C2.25 13.6482 3.40187 15.9241 5.01689 17.8025C6.62496 19.6728 8.71834 21.1811 10.6782 22.3944L10.6911 22.4024L10.7043 22.4098C11.0996 22.6329 11.546 22.75 12 22.75C12.454 22.75 12.9004 22.6329 13.2957 22.4098L13.3072 22.4033L13.3185 22.3964C14.7993 21.4903 16.352 20.4087 17.7149 19.1291L21.2929 22.7071C21.6834 23.0976 22.3166 23.0976 22.7071 22.7071C23.0976 22.3166 23.0976 21.6834 22.7071 21.2929L2.70711 1.29289ZM13.3517 14.7659L8.23413 9.64835C8.08257 10.0706 8 10.5256 8 11C8 13.2091 9.79086 15 12 15C12.4744 15 12.9294 14.9174 13.3517 14.7659Z" fill="#8F9AA3"/>
<path d="M12 1.25C17.2755 1.25 21.75 5.60954 21.75 10.9258C21.75 12.7582 21.2256 14.3937 20.3882 15.8424C20.2225 16.129 20.1397 16.2723 19.993 16.2916C19.8464 16.3109 19.7251 16.1896 19.4826 15.9471L16.0589 12.5234C15.9357 12.4002 15.8742 12.3386 15.8528 12.264C15.8314 12.1894 15.8533 12.0946 15.8972 11.9051C15.9644 11.6143 16 11.3113 16 11C16 8.79086 14.2091 7 12 7C11.6887 7 11.3857 7.03556 11.0949 7.10283C10.9054 7.14667 10.8106 7.16859 10.736 7.14721C10.6614 7.12584 10.5998 7.06426 10.4766 6.94111L7.01667 3.48113C6.77751 3.24197 6.65793 3.12239 6.67673 2.97621C6.69553 2.83003 6.83548 2.74811 7.11539 2.58426C8.56262 1.73712 10.2366 1.25 12 1.25Z" fill="#8F9AA3"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -0,0 +1,5 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="40" height="40" rx="10" fill="#EFEFF0"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.7071 9.29289C10.3166 8.90237 9.68342 8.90237 9.29289 9.29289C8.90237 9.68342 8.90237 10.3166 9.29289 10.7071L12.0138 13.428C10.9068 14.9926 10.25 16.889 10.25 18.9258C10.25 21.6482 11.4019 23.9241 13.0169 25.8025C14.625 27.6728 16.7183 29.1811 18.6782 30.3944L18.6911 30.4024L18.7043 30.4098C19.0996 30.6329 19.546 30.75 20 30.75C20.454 30.75 20.9004 30.6329 21.2957 30.4098L21.3072 30.4033L21.3185 30.3964C22.7993 29.4903 24.352 28.4087 25.7149 27.1291L29.2929 30.7071C29.6834 31.0976 30.3166 31.0976 30.7071 30.7071C31.0976 30.3166 31.0976 29.6834 30.7071 29.2929L10.7071 9.29289ZM21.3517 22.7659L16.2341 17.6483C16.0826 18.0706 16 18.5256 16 19C16 21.2091 17.7909 23 20 23C20.4744 23 20.9294 22.9174 21.3517 22.7659Z" fill="#8F9AA3"/>
<path d="M20 9.25C25.2755 9.25 29.75 13.6095 29.75 18.9258C29.75 20.7582 29.2256 22.3937 28.3882 23.8424C28.2225 24.129 28.1397 24.2723 27.993 24.2916C27.8464 24.3109 27.7251 24.1896 27.4826 23.9471L24.0589 20.5234C23.9357 20.4002 23.8742 20.3386 23.8528 20.264C23.8314 20.1894 23.8533 20.0946 23.8972 19.9051C23.9644 19.6143 24 19.3113 24 19C24 16.7909 22.2091 15 20 15C19.6887 15 19.3857 15.0356 19.0949 15.1028C18.9054 15.1467 18.8106 15.1686 18.736 15.1472C18.6614 15.1258 18.5998 15.0643 18.4766 14.9411L15.0167 11.4811C14.7775 11.242 14.6579 11.1224 14.6767 10.9762C14.6955 10.83 14.8355 10.7481 15.1154 10.5843C16.5626 9.73712 18.2366 9.25 20 9.25Z" fill="#8F9AA3"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -349,7 +349,7 @@
"askYourSubtitle": "طبيبك", "askYourSubtitle": "طبيبك",
"internet": "الإنترنت", "internet": "الإنترنت",
"internetSubtitle": "الاقتران", "internetSubtitle": "الاقتران",
"chatbot": "الدردة الآلية", "chatbot": "الدردشة الآلية",
"chatbotSubtitle": "", "chatbotSubtitle": "",
"timeLine": "الخط الزمني", "timeLine": "الخط الزمني",
"labOrders": "طلبات المختبر", "labOrders": "طلبات المختبر",
@ -1758,10 +1758,19 @@
"conformationCall": "سنتصل بك قريبًا لتأكيد الطلب", "conformationCall": "سنتصل بك قريبًا لتأكيد الطلب",
"radiologyLabResults": "نتائج الأشعة", "radiologyLabResults": "نتائج الأشعة",
"disclaimerRadiology": "تم تحليل نتائج الأشعة هذه بواسطة الذكاء الاصطناعي، وهي لا تُعدّ نصيحة طبية. استشر طبيبك المختص للتشخيص والعلاج.", "disclaimerRadiology": "تم تحليل نتائج الأشعة هذه بواسطة الذكاء الاصطناعي، وهي لا تُعدّ نصيحة طبية. استشر طبيبك المختص للتشخيص والعلاج.",
"enterIdentificationNumberWithNoStar": "أدخل رقم الهوية",
"enterReferralNumber": "أدخل رقم الإحالة",
"referralNumber": "رقم الإحالة",
"phoneHint": "5xxxxxxxx",
"selectSearchCriteria": "اختر معيار البحث",
"selectCriteria": "اختيار المعيار",
"locationServicesDisabled": "حالة الطقس غير متوفرة لتعطيل خدمات الموقع. يرجى تفعيل خدمات الموقع لتتمكن من رؤية معلومات الطقس.",
"selectDateTimeKey": "اختيار", "selectDateTimeKey": "اختيار",
"medicalKey": "الطبية", "medicalKey": "الطبية",
"doctors2": "أطباء", "doctors2": "أطباء",
"illurgyInfomation": "الحساسية", "illurgyInfomation": "الحساسية",
"vaccineInfomation": "التطعيمات", "vaccineInfomation": "التطعيمات",
"approvals1": "موافقات" "approvals1": "موافقات",
"convertBloodcholesterolInfo":"حول قيمة كوليسترول الدم بين ملجم/ديسيلتر و مليمول/لتر"
} }

@ -1532,7 +1532,7 @@
"route": "Route", "route": "Route",
"frequency": "Frequency", "frequency": "Frequency",
"reminders": "Reminders", "reminders": "Reminders",
"reminderAddedToCalendar": "Reminder added to calendar", "reminderAddedToCalendar": "Reminder added to calendar",
"errorWhileSettingCalendar": "Error while setting calendar: {error}", "errorWhileSettingCalendar": "Error while setting calendar: {error}",
"instructions": "Instructions", "instructions": "Instructions",
"requests": "Requests", "requests": "Requests",
@ -1747,10 +1747,17 @@
"insurance2": "Insurance", "insurance2": "Insurance",
"conformationCall": "You will receive a call from HMG for confirmation ", "conformationCall": "You will receive a call from HMG for confirmation ",
"radiologyLabResults": "Radiology Results", "radiologyLabResults": "Radiology Results",
"disclaimerRadiology": "This radiology result was analyzed by AI, and it is not medical advice. Consult your healthcare provider for diagnosis and treatment." "disclaimerRadiology": "This radiology result was analyzed by AI, and it is not medical advice. Consult your healthcare provider for diagnosis and treatment.",
, "enterIdentificationNumberWithNoStar": "Enter Identification Number",
"enterReferralNumber": "Enter Referral Number",
"referralNumber": "Referral Number",
"phoneHint": "5xxxxxxxx",
"selectSearchCriteria": "Select the Search Criteria",
"selectCriteria": "Select Criteria",
"locationServicesDisabled": "Weather is unavailable because location services are disabled. Please enable location services to see the weather information.",
"selectDateTimeKey": "Select", "selectDateTimeKey": "Select",
"medicalKey": "Medical", "medicalKey": "Medical",
"convertBloodcholesterolInfo": "Convert blood cholesterol values between mg/dL and mmol/L. "
"doctors2": "Doctor", "doctors2": "Doctor",
"illurgyInfomation": "Allergy", "illurgyInfomation": "Allergy",
"vaccineInfomation": "Vaccine", "vaccineInfomation": "Vaccine",

@ -119,6 +119,8 @@ class AppAssets {
static const String search_by_region_icon = '$svgBasePath/search_by_region_icon.svg'; static const String search_by_region_icon = '$svgBasePath/search_by_region_icon.svg';
static const String location_red = '$svgBasePath/location_red.svg'; static const String location_red = '$svgBasePath/location_red.svg';
static const String location_unavailable = '$svgBasePath/location_unavailable.svg'; static const String location_unavailable = '$svgBasePath/location_unavailable.svg';
static const String location_unavailable_filled = '$svgBasePath/location_unavailable_filled.svg';
static const String location_unavailable_filled_background = '$svgBasePath/location_unavailable_filled_background.svg';
static const String livecare_clinic_icon = '$svgBasePath/livecare_clinic_icon.svg'; static const String livecare_clinic_icon = '$svgBasePath/livecare_clinic_icon.svg';
static const String immediate_service_icon = '$svgBasePath/immediate_service_icon.svg'; static const String immediate_service_icon = '$svgBasePath/immediate_service_icon.svg';
static const String no_visit_icon = '$svgBasePath/no_visit_icon.svg'; static const String no_visit_icon = '$svgBasePath/no_visit_icon.svg';

@ -89,7 +89,7 @@ class LocationUtils {
} }
} }
LocationPermission permissionGranted = await Geolocator.checkPermission(); LocationPermission permissionGranted = await Geolocator.checkPermission();
if (permissionGranted == LocationPermission.denied) { if (permissionGranted == LocationPermission.denied) {
permissionGranted = await Geolocator.requestPermission(); permissionGranted = await Geolocator.requestPermission();
if (permissionGranted != LocationPermission.whileInUse && permissionGranted != LocationPermission.always) { if (permissionGranted != LocationPermission.whileInUse && permissionGranted != LocationPermission.always) {
@ -257,6 +257,30 @@ class LocationUtils {
appState.userLong = locationData.longitude; appState.userLong = locationData.longitude;
} }
Future<bool> isLocationPermissionEnabled() async {
if (Platform.isIOS || (await isGMSDevice ?? true)) {
return await _isGMSLocationPermissionEnabled();
} else {
return await _isHMSLocationPermissionEnabled();
}
}
Future<bool> _isGMSLocationPermissionEnabled() async {
bool serviceEnabled = await Geolocator.isLocationServiceEnabled();
if (!serviceEnabled) return false;
LocationPermission permission = await Geolocator.checkPermission();
return permission == LocationPermission.whileInUse || permission == LocationPermission.always;
}
Future<bool> _isHMSLocationPermissionEnabled() async {
bool serviceEnabled = await Geolocator.isLocationServiceEnabled();
if (!serviceEnabled) return false;
LocationPermission permission = await Geolocator.checkPermission();
return permission == LocationPermission.whileInUse || permission == LocationPermission.always;
}
void getHMSLocation({VoidCallback? onFailure, Function(LatLng p1)? onSuccess, VoidCallback? onLocationDeniedForever}) async { void getHMSLocation({VoidCallback? onFailure, Function(LatLng p1)? onSuccess, VoidCallback? onLocationDeniedForever}) async {
try { try {
var location = Location(); var location = Location();

@ -599,6 +599,17 @@ class DateUtil {
return '${hours} hr ${minutes} min'; return '${hours} hr ${minutes} min';
} }
/// Parses an ISO 8601 date string that may have more than 6 fractional-second digits.
/// e.g. '2026-04-12T12:07:35.4226413' truncates to 6 digits before parsing.
static DateTime? parseISODate(String? date) {
if (date == null || date.isEmpty) return null;
final truncated = date.replaceFirstMapped(
RegExp(r'(\.\d{6})\d+'),
(m) => m.group(1)!,
);
return DateTime.tryParse(truncated);
}
} }
extension OnlyDate on DateTime { extension OnlyDate on DateTime {

@ -54,6 +54,7 @@ import 'package:hmg_patient_app_new/widgets/map/map_utility_screen.dart';
import 'package:hmg_patient_app_new/widgets/order_tracking/order_tracking_state.dart'; import 'package:hmg_patient_app_new/widgets/order_tracking/order_tracking_state.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:huawei_map/huawei_map.dart' as HMSCameraServices; import 'package:huawei_map/huawei_map.dart' as HMSCameraServices;
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../location/GeocodeResponse.dart'; import '../location/GeocodeResponse.dart';
@ -792,7 +793,6 @@ class EmergencyServicesViewModel extends ChangeNotifier {
allOrders.clear(); allOrders.clear();
allOrders.addAll(ambulanceOrders ?? []); allOrders.addAll(ambulanceOrders ?? []);
allOrders.addAll(ordersRRT?.completedOrders ?? []); allOrders.addAll(ordersRRT?.completedOrders ?? []);
_sortOrdersByDate(allOrders);
changeOrderDisplayItems(OrderDislpay.ALL); changeOrderDisplayItems(OrderDislpay.ALL);
notifyListeners(); notifyListeners();
}, },
@ -967,7 +967,6 @@ class EmergencyServicesViewModel extends ChangeNotifier {
allOrders.clear(); allOrders.clear();
allOrders.addAll(ambulanceOrders ?? []); allOrders.addAll(ambulanceOrders ?? []);
allOrders.addAll(ordersRRT?.completedOrders ?? []); allOrders.addAll(ordersRRT?.completedOrders ?? []);
_sortOrdersByDate(allOrders);
changeOrderDisplayItems(OrderDislpay.ALL); changeOrderDisplayItems(OrderDislpay.ALL);
notifyListeners(); notifyListeners();
}, },
@ -996,32 +995,38 @@ class EmergencyServicesViewModel extends ChangeNotifier {
this.currentlyDisplayedOrder = currentlyDisplayedOrder; this.currentlyDisplayedOrder = currentlyDisplayedOrder;
switch (currentlyDisplayedOrder) { switch (currentlyDisplayedOrder) {
case OrderDislpay.ALL: case OrderDislpay.ALL:
orderDisplayList = allOrders; orderDisplayList = List.from(allOrders);
break; break;
case OrderDislpay.RRT: case OrderDislpay.RRT:
orderDisplayList = ordersRRT?.completedOrders ?? []; orderDisplayList = List.from(ordersRRT?.completedOrders ?? []);
break; break;
case OrderDislpay.AMBULANCE: case OrderDislpay.AMBULANCE:
orderDisplayList = ambulanceOrders ?? []; orderDisplayList = List.from(ambulanceOrders ?? []);
break; break;
} }
_sortOrdersByDate(orderDisplayList);
orderDisplayList = _sortOrdersByDate(orderDisplayList);
notifyListeners(); notifyListeners();
} }
void _sortOrdersByDate(List list) { List _sortOrdersByDate(List list) {
list.sort((a, b) { list.sort((a, b) {
final String? dateA = _getCreatedDate(a); final int? dateA = _parseCreatedDate(a)?.millisecondsSinceEpoch;
final String? dateB = _getCreatedDate(b); final int? dateB = _parseCreatedDate(b)?.millisecondsSinceEpoch;
final bool hasDateA = dateA != null && dateA.contains('/Date('); print("the dateA is $dateA and dateB is $dateB");
final bool hasDateB = dateB != null && dateB.contains('/Date('); if (dateA == null && dateB == null) return 0;
if (!hasDateA && !hasDateB) return 0; if (dateA == null) return 1;
if (!hasDateA) return 1; if (dateB == null) return -1;
if (!hasDateB) return -1; return dateB.compareTo(dateA);
final parsedA = DateUtil.convertStringToDate(dateA);
final parsedB = DateUtil.convertStringToDate(dateB);
return parsedB.compareTo(parsedA);
}); });
return list;
}
DateTime? _parseCreatedDate(dynamic order) {
final String? raw = _getCreatedDate(order);
return DateTime.tryParse(raw??"");
} }
String? _getCreatedDate(dynamic order) { String? _getCreatedDate(dynamic order) {
@ -1030,7 +1035,7 @@ class EmergencyServicesViewModel extends ChangeNotifier {
return null; return null;
} }
void openRRT() { void openRRT(BuildContext context) {
if (appState.isAuthenticated) { if (appState.isAuthenticated) {
if (agreedToTermsAndCondition == false) { if (agreedToTermsAndCondition == false) {
dialogService.showErrorBottomSheet( dialogService.showErrorBottomSheet(
@ -1064,6 +1069,7 @@ class EmergencyServicesViewModel extends ChangeNotifier {
return; return;
} }
placeValueInController(); placeValueInController();
context.read<LocationViewModel>().placeValueInController();
locationUtils!.getLocation( locationUtils!.getLocation(
isShowConfirmDialog: true, isShowConfirmDialog: true,
onSuccess: (position) async { onSuccess: (position) async {

@ -18,7 +18,6 @@ class LocationViewModel extends ChangeNotifier {
final ErrorHandlerService errorHandlerService; final ErrorHandlerService errorHandlerService;
LocationViewModel({required this.locationRepo, required this.errorHandlerService}) { LocationViewModel({required this.locationRepo, required this.errorHandlerService}) {
placeValueInController();
} }
List<PlacePrediction> predictions = []; List<PlacePrediction> predictions = [];
@ -31,7 +30,9 @@ class LocationViewModel extends ChangeNotifier {
Completer<GMSMapServices.GoogleMapController>? gmsController; Completer<GMSMapServices.GoogleMapController>? gmsController;
Completer<HMSCameraServices.HuaweiMapController>? hmsController; Completer<HMSCameraServices.HuaweiMapController>? hmsController;
get isGMSAvailable {
return getIt.get<AppState>().isGMSAvailable;
}
HMSCameraServices.CameraPosition getHMSLocation() { HMSCameraServices.CameraPosition getHMSLocation() {
return HMSCameraServices.CameraPosition(target: HMSCameraServices.LatLng(getIt<AppState>().userLat, getIt<AppState>().userLong), zoom: 18); return HMSCameraServices.CameraPosition(target: HMSCameraServices.LatLng(getIt<AppState>().userLat, getIt<AppState>().userLong), zoom: 18);
} }
@ -43,7 +44,7 @@ class LocationViewModel extends ChangeNotifier {
} }
void placeValueInController() async { void placeValueInController() async {
if (await getIt<AppState>().isGMSAvailable) { if (isGMSAvailable) {
gmsController = Completer<GMSMapServices.GoogleMapController>(); gmsController = Completer<GMSMapServices.GoogleMapController>();
} else { } else {
hmsController = Completer<HMSCameraServices.HuaweiMapController>(); hmsController = Completer<HMSCameraServices.HuaweiMapController>();

@ -20,6 +20,7 @@ import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/widgets/map/map_utility_screen.dart'; import 'package:hmg_patient_app_new/widgets/map/map_utility_screen.dart';
import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
class PrescriptionsViewModel extends ChangeNotifier { class PrescriptionsViewModel extends ChangeNotifier {
bool isPrescriptionsOrdersLoading = false; bool isPrescriptionsOrdersLoading = false;
@ -255,7 +256,9 @@ class PrescriptionsViewModel extends ChangeNotifier {
); );
} }
void initiatePrescriptionDelivery() async { void initiatePrescriptionDelivery(BuildContext context) async {
context.read<LocationViewModel>().placeValueInController();
getIt.get<LocationUtils>().getLocation( getIt.get<LocationUtils>().getLocation(
isShowConfirmDialog: true, isShowConfirmDialog: true,
onSuccess: (position) async { onSuccess: (position) async {

@ -1,13 +1,17 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/core/location_util.dart'; import 'package:hmg_patient_app_new/core/location_util.dart';
import 'package:hmg_patient_app_new/features/weather/models/waether_cities_model.dart'; import 'package:hmg_patient_app_new/features/weather/models/waether_cities_model.dart';
import 'package:hmg_patient_app_new/features/weather/weather_repo.dart'; import 'package:hmg_patient_app_new/features/weather/weather_repo.dart';
import 'package:hmg_patient_app_new/services/error_handler_service.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart';
import '../../core/app_state.dart' show AppState;
class WeatherMonitorViewModel extends ChangeNotifier { class WeatherMonitorViewModel extends ChangeNotifier {
WeatherRepo weatherRepo; WeatherRepo weatherRepo;
ErrorHandlerService errorHandlerService; ErrorHandlerService errorHandlerService;
LocationUtils locationUtils; LocationUtils locationUtils;
bool isLocationAvailable = false;
WeatherMonitorViewModel({required this.weatherRepo, required this.errorHandlerService, required this.locationUtils}); WeatherMonitorViewModel({required this.weatherRepo, required this.errorHandlerService, required this.locationUtils});
@ -18,11 +22,12 @@ class WeatherMonitorViewModel extends ChangeNotifier {
Future<void> fetchCityInfoList({Function(dynamic)? onSuccess, Function(String)? onError}) async { Future<void> fetchCityInfoList({Function(dynamic)? onSuccess, Function(String)? onError}) async {
isLoading = true; isLoading = true;
notifyListeners();
_cityInfoList.clear(); _cityInfoList.clear();
locationUtils.getLocation( locationUtils.getLocation(
isShowConfirmDialog: true, isShowConfirmDialog: true,
onSuccess: (position) async { onSuccess: (position) async {
isLocationAvailable = true;
final result = await weatherRepo.getCityInfo(); final result = await weatherRepo.getCityInfo();
result.fold( result.fold(
(failure) async { (failure) async {
@ -52,4 +57,18 @@ class WeatherMonitorViewModel extends ChangeNotifier {
); );
}); });
} }
Future<bool> checkIfTheLocationIsEnabledOrNot() async {
bool value = await locationUtils.isLocationPermissionEnabled();
isLocationAvailable = value;
notifyListeners();
return value;
}
void initiateFetchWeather() async {
if(await checkIfTheLocationIsEnabledOrNot()){
fetchCityInfoList();
}
}
} }

@ -1750,6 +1750,13 @@ abstract class LocaleKeys {
static const conformationCall = 'conformationCall'; static const conformationCall = 'conformationCall';
static const radiologyLabResults = 'radiologyLabResults'; static const radiologyLabResults = 'radiologyLabResults';
static const disclaimerRadiology = 'disclaimerRadiology'; static const disclaimerRadiology = 'disclaimerRadiology';
static const enterIdentificationNumberWithNoStar = 'enterIdentificationNumberWithNoStar';
static const enterReferralNumber = 'enterReferralNumber';
static const referralNumber = 'referralNumber';
static const phoneHint = 'phoneHint';
static const selectSearchCriteria = 'selectSearchCriteria';
static const selectCriteria = 'selectCriteria';
static const locationServicesDisabled = 'locationServicesDisabled';
static const selectDateTimeKey = 'selectDateTimeKey'; static const selectDateTimeKey = 'selectDateTimeKey';
static const medicalKey = 'medicalKey'; static const medicalKey = 'medicalKey';
static const doctors2 = 'doctors2'; static const doctors2 = 'doctors2';

@ -193,7 +193,7 @@ class _NewReferralPageState extends State<NewReferralPage> {
children: List.generate(3, (index) { children: List.generate(3, (index) {
// Fill current step and all previous completed steps // Fill current step and all previous completed steps
if (index <= _currentStep) { if (index <= _currentStep) {
return StepperWidget(widthOfOneState, AppColors.primaryRedColor, true, 4.h); return StepperWidget(widthOfOneState, AppColors.primaryRedColor, index == _currentStep, 4.h);
} else { } else {
return StepperWidget(widthOfOneState, AppColors.greyLightColor, false, 4.h); return StepperWidget(widthOfOneState, AppColors.greyLightColor, false, 4.h);
} }

@ -142,8 +142,8 @@ class _OtherDetailsStepState extends State<OtherDetailsStep> {
Widget _buildBranchField(BuildContext context, ReferralFormManager formManager) { Widget _buildBranchField(BuildContext context, ReferralFormManager formManager) {
return DropdownWidget( return DropdownWidget(
labelText: 'Branch', labelText: LocaleKeys.branch.tr(),
hintText: formManager.formData.branch?.desciption ?? "Select Branch", hintText: formManager.formData.branch?.desciption ?? LocaleKeys.selectBranch.tr(),
isEnable: false, isEnable: false,
hasSelectionCustomIcon: true, hasSelectionCustomIcon: true,
labelColor: Colors.black, labelColor: Colors.black,

@ -2,9 +2,11 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:ui' as ui; import 'dart:ui' as ui;
import 'package:hmg_patient_app_new/core/app_export.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/utils/validation_utils.dart'; import 'package:hmg_patient_app_new/core/utils/validation_utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.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/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/get_all_cities_resp_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/e_referral/e_referral_form_manager.dart'; import 'package:hmg_patient_app_new/presentation/e_referral/e_referral_form_manager.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -14,6 +16,8 @@ import 'package:hmg_patient_app_new/widgets/dropdown/dropdown_widget.dart';
import 'package:hmg_patient_app_new/widgets/input_widget.dart'; import 'package:hmg_patient_app_new/widgets/input_widget.dart';
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart'; import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
import '../../../core/dependencies.dart' show getIt;
class PatientInformationStep extends StatefulWidget { class PatientInformationStep extends StatefulWidget {
const PatientInformationStep({super.key}); const PatientInformationStep({super.key});
@ -171,8 +175,8 @@ class PatientInformationStepState extends State<PatientInformationStep> {
Widget _buildPatientCityField(BuildContext context, ReferralFormManager formManager) { Widget _buildPatientCityField(BuildContext context, ReferralFormManager formManager) {
return DropdownWidget( return DropdownWidget(
labelText: 'City', labelText: LocaleKeys.city.tr(),
hintText: formManager.formData.patientCity?.description ?? LocaleKeys.selectCity.tr(context: context), hintText: getLocaleDescription(formManager.formData.patientCity) ?? LocaleKeys.selectCity.tr(context: context),
isEnable: false, isEnable: false,
hasSelectionCustomIcon: true, hasSelectionCustomIcon: true,
labelColor: Colors.black, labelColor: Colors.black,
@ -187,6 +191,10 @@ class PatientInformationStepState extends State<PatientInformationStep> {
}); });
} }
String? getLocaleDescription(GetAllCitiesResponseModel? patientCity){
return getIt.get<AppState>().isArabic() ? patientCity?.descriptionN: patientCity?.description;
}
void _showCityBottomSheet(BuildContext context, ReferralFormManager formManager) { void _showCityBottomSheet(BuildContext context, ReferralFormManager formManager) {
@ -217,7 +225,7 @@ class PatientInformationStepState extends State<PatientInformationStep> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
final city = cities[index]; final city = cities[index];
return ListTile( return ListTile(
title: (city.description ?? 'Unknown').toText14(), title: (getLocaleDescription(city) ?? 'Unknown').toText14(),
onTap: () { onTap: () {
formManager.updatePatientCity(city); formManager.updatePatientCity(city);
Navigator.pop(context); Navigator.pop(context);

@ -116,9 +116,9 @@ class RequesterFormStepState extends State<RequesterFormStep> {
Widget _buildRelationshipField(BuildContext context, ReferralFormManager formManager) { Widget _buildRelationshipField(BuildContext context, ReferralFormManager formManager) {
return DropdownWidget( return DropdownWidget(
labelText: LocaleKeys.relationship.tr(context: context), labelText: LocaleKeys.relationship.tr(context: context),
hintText: formManager.formData.relationship?.textEn ?? LocaleKeys.selectRelation.tr(context: context), hintText: formManager.formData.relationship?.text ?? LocaleKeys.selectRelation.tr(context: context),
isEnable: false, isEnable: false,
selectedValue: formManager.formData.relationship?.textEn ?? LocaleKeys.selectRelation.tr(context: context), selectedValue: formManager.formData.relationship?.text ?? LocaleKeys.selectRelation.tr(context: context),
errorMessage: formManager.errors.relationship, errorMessage: formManager.errors.relationship,
hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.relationship), hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.relationship),
hasSelectionCustomIcon: false, hasSelectionCustomIcon: false,
@ -182,7 +182,7 @@ class RequesterFormStepState extends State<RequesterFormStep> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
final relationship = hmgServicesVM.relationTypes[index]; final relationship = hmgServicesVM.relationTypes[index];
return ListTile( return ListTile(
title:relationship.textEn?.toText14(), title:relationship.text?.toText14(),
onTap: () { onTap: () {
formManager.updateRelationship(relationship); formManager.updateRelationship(relationship);
Navigator.pop(context); Navigator.pop(context);

@ -1,6 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/core/utils/validation_utils.dart'; import 'package:hmg_patient_app_new/core/utils/validation_utils.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/e_referral/e_referral_form_manager.dart'; import 'package:hmg_patient_app_new/presentation/e_referral/e_referral_form_manager.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
@ -69,12 +72,13 @@ class SearchEReferralFormFormState extends State<SearchEReferralFormForm> {
autofocus: true, autofocus: true,
child: TextInputWidget( child: TextInputWidget(
controller: _searchController, controller: _searchController,
padding: const EdgeInsets.symmetric(horizontal: 16.0), hintText: formManager.searchCriteria == 0 ? LocaleKeys.enterIdentificationNumber.tr() : LocaleKeys.enterReferralNumber.tr(),
hintText: formManager.searchCriteria == 0 ? "Enter Identification Number" : "Enter Referral Number", labelText: formManager.searchCriteria == 0 ? LocaleKeys.identificationNumber.tr() : LocaleKeys.referralNumber.tr(),
labelText: formManager.searchCriteria == 0 ? "Identification Number" : "Referral Number",
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
fontFamily: "Poppins", fontFamily: "Poppins",
errorMessage: formManager.errors.searchValue, errorMessage: formManager.errors.searchValue,
padding: EdgeInsets.symmetric(vertical: 14.h, horizontal: 16.h),
hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.searchValue), hasError: !ValidationUtils.isNullOrEmpty(formManager.errors.searchValue),
onChange: (value) { onChange: (value) {
formManager.updateSearchValue(value ?? ''); formManager.updateSearchValue(value ?? '');
@ -90,10 +94,10 @@ class SearchEReferralFormFormState extends State<SearchEReferralFormForm> {
autofocus: false, autofocus: false,
child: TextInputWidget( child: TextInputWidget(
autoFocus: false, autoFocus: false,
labelText: 'Phone Number', labelText: LocaleKeys.phoneNumber.tr(),
hintText: "5xxxxxxxx", hintText: LocaleKeys.phoneHint.tr(),
controller: _phoneController, controller: _phoneController,
padding: const EdgeInsets.all(8), padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
fontFamily: "Poppins", fontFamily: "Poppins",
onChange: (value) { onChange: (value) {
@ -122,8 +126,8 @@ class SearchEReferralFormFormState extends State<SearchEReferralFormForm> {
Widget _buildSelectionField(BuildContext context, ReferralFormManager formManager) { Widget _buildSelectionField(BuildContext context, ReferralFormManager formManager) {
return DropdownWidget( return DropdownWidget(
labelText: "Select the Search Criteria", labelText: LocaleKeys.selectCriteria.tr(),
hintText: formManager.searchCriteria == 0 ? "Identification Number" : "Referral Number", hintText: formManager.searchCriteria == 0 ? LocaleKeys.identificationNumber.tr() : LocaleKeys.referralNumber.tr(),
isEnable: false, isEnable: false,
hasSelectionCustomIcon: false, hasSelectionCustomIcon: false,
labelColor: Colors.black, labelColor: Colors.black,
@ -137,13 +141,13 @@ class SearchEReferralFormFormState extends State<SearchEReferralFormForm> {
void _showCriteriaBottomSheet(BuildContext context, ReferralFormManager formManager) { void _showCriteriaBottomSheet(BuildContext context, ReferralFormManager formManager) {
final criteriaList = [ final criteriaList = [
{0: 'Identification Number'}, {0: LocaleKeys.identificationNumber.tr()},
{1: 'Referral Number'}, {1: LocaleKeys.referralNumber.tr()},
]; ];
showCommonBottomSheetWithoutHeight( showCommonBottomSheetWithoutHeight(
context, context,
title: "Select Criteria", title: LocaleKeys.selectCriteria.tr(),
child: ListView.separated( child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: const BouncingScrollPhysics(), physics: const BouncingScrollPhysics(),

@ -559,7 +559,9 @@ class RrtMapScreen extends StatelessWidget {
context, context,
child: SizedBox( child: SizedBox(
height: MediaQuery.sizeOf(context).height * .8, height: MediaQuery.sizeOf(context).height * .8,
child: LocationInputBottomSheet(), child: LocationInputBottomSheet(
moveCameraController:(location) => context.read<LocationViewModel>().moveController(location) ,
),
), ),
isFullScreen: false, isFullScreen: false,
isCloseButtonVisible: true, isCloseButtonVisible: true,

@ -140,7 +140,7 @@ class RrtRequestTypeSelect extends StatelessWidget {
), ),
CustomButton(text: LocaleKeys.next.tr(), onPressed: () { CustomButton(text: LocaleKeys.next.tr(), onPressed: () {
Navigator.pop(context); Navigator.pop(context);
emergencyServicesVM.openRRT(); emergencyServicesVM.openRRT(context);
}, },
isDisabled: !emergencyServicesVM.agreedToTermsAndCondition, isDisabled: !emergencyServicesVM.agreedToTermsAndCondition,
) )

@ -577,7 +577,9 @@ class CallAmbulancePage extends StatelessWidget {
context, context,
child: SizedBox( child: SizedBox(
height: MediaQuery.sizeOf(context).height * .8, height: MediaQuery.sizeOf(context).height * .8,
child: LocationInputBottomSheet(), child: LocationInputBottomSheet(
moveCameraController:(location) => context.read<EmergencyServicesViewModel>().moveController(location) ,
),
), ),
isFullScreen: false, isFullScreen: false,
isCloseButtonVisible: true, isCloseButtonVisible: true,

@ -42,7 +42,7 @@ class AmbulanceHistoryItem extends StatelessWidget {
Row( Row(
spacing: 4.w, spacing: 4.w,
children: [ children: [
chip(Utils.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.time)), AppAssets.calendar, AppColors.blackBgColor), chip(Utils.getDayMonthYearDateFormatted(DateUtil.parseISODate(order.created)), AppAssets.calendar, AppColors.blackBgColor),
chip(LocaleKeys.ambulancerequest.tr(context: context), AppAssets.ambulance, AppColors.blackBgColor), chip(LocaleKeys.ambulancerequest.tr(context: context), AppAssets.ambulance, AppColors.blackBgColor),
], ],
), ),

@ -42,7 +42,7 @@ class RRTItem extends StatelessWidget {
Row( Row(
spacing: 4.w, spacing: 4.w,
children: [ children: [
chip(Utils.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.time)), AppAssets.calendar, AppColors.blackBgColor), chip(Utils.getDayMonthYearDateFormatted(DateUtil.parseISODate(order.created)), AppAssets.calendar, AppColors.blackBgColor),
chip(LocaleKeys.rapidResponseTeam.tr(context: context), AppAssets.ic_rrt_vehicle, AppColors.blackBgColor), chip(LocaleKeys.rapidResponseTeam.tr(context: context), AppAssets.ic_rrt_vehicle, AppColors.blackBgColor),
], ],
), ),

@ -23,8 +23,9 @@ import '../../../theme/colors.dart';
class LocationInputBottomSheet extends StatelessWidget { class LocationInputBottomSheet extends StatelessWidget {
final Debouncer debouncer = Debouncer(milliseconds: 500); final Debouncer debouncer = Debouncer(milliseconds: 500);
final Function(Location)? moveCameraController;
LocationInputBottomSheet({super.key}); LocationInputBottomSheet({super.key, this.moveCameraController});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -106,7 +107,7 @@ class LocationInputBottomSheet extends StatelessWidget {
Navigator.of(context).pop(); Navigator.of(context).pop();
var location = context.read<LocationViewModel>().placeDetails; var location = context.read<LocationViewModel>().placeDetails;
if(location != null) { if(location != null) {
context.read<EmergencyServicesViewModel>().moveController( moveCameraController?.call(
Location(lat: location.lat, lng: location.lng)); Location(lat: location.lat, lng: location.lng));
} }
}); });

@ -1,4 +1,6 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
@ -121,7 +123,7 @@ class _BloodCholesterolWidgetState extends State<BloodCholesterolWidget> {
Utils.buildSvgWithAssets(icon: AppAssets.globe, width: 18.w, height: 18.w), Utils.buildSvgWithAssets(icon: AppAssets.globe, width: 18.w, height: 18.w),
SizedBox(width: 12.w), SizedBox(width: 12.w),
Expanded( Expanded(
child: "Convert blood cholesterol values between mg/dL and mmol/L. ".toText12(isBold: true, color: AppColors.inputLabelTextColor), child:LocaleKeys.convertBloodcholesterolInfo.tr(context: context).toText12(isBold: true, color: AppColors.inputLabelTextColor),
), ),
], ],
).paddingSymmetrical(0.w, 16.w), ).paddingSymmetrical(0.w, 16.w),

@ -380,7 +380,7 @@ class _ServicesPageState extends State<ServicesPage> {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
weatherVM = getIt<WeatherMonitorViewModel>(); weatherVM = getIt<WeatherMonitorViewModel>();
weatherVM.fetchCityInfoList(); weatherVM.initiateFetchWeather();
} }

@ -1,10 +1,12 @@
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/core/utils/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/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/features/weather/weather_view_model.dart'; import 'package:hmg_patient_app_new/features/weather/weather_view_model.dart';
import 'package:hmg_patient_app_new/features/weather/models/waether_cities_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/weather/weather_details_page.dart'; import 'package:hmg_patient_app_new/presentation/weather/weather_details_page.dart';
import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/theme/colors.dart';
@ -39,15 +41,20 @@ class WeatherWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Consumer<WeatherMonitorViewModel>( return Selector<WeatherMonitorViewModel, ({bool isLoading, bool isLocationAvailable, List<GetCityInfoList> cityInfoList})>(
builder: (context, weatherVM, child) { selector: (_, vm) => (isLoading: vm.isLoading, isLocationAvailable: vm.isLocationAvailable, cityInfoList: vm.cityInfoList),
final currentCity = weatherVM.cityInfoList.isNotEmpty builder: (context, state, child) {
? weatherVM.cityInfoList.first if (state.isLoading) {
: null; return _buildLoadingState().paddingSymmetrical(24.w, 0.w);
}
if (!state.isLocationAvailable) {
return noWeatherWidget(context).paddingSymmetrical(24.w, 0.w);
}
final currentCity = state.cityInfoList.isNotEmpty ? state.cityInfoList.first : null;
final now = DateTime.now(); final now = DateTime.now();
final temperature = currentCity?.temperature; final temperature = currentCity?.temperature;
final healthTip = LocaleKeys.healthTipsBasedOnCurrentWeather.tr(); final healthTip = LocaleKeys.healthTipsBasedOnCurrentWeather.tr();
return Row( return Row(
children: [ children: [
@ -59,69 +66,66 @@ class WeatherWidget extends StatelessWidget {
borderRadius: 24.r, borderRadius: 24.r,
hasShadow: false, hasShadow: false,
), ),
child: weatherVM.isLoading child: Column(
? _buildLoadingState() children: [
: Column( Row(
children: [ children: [
Row( Utils.buildSvgWithAssets(
icon: _getWeatherIcon(currentCity?.categoryValue),
width: 64.w,
height: 64.w,
),
SizedBox(width: 12.w),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Utils.buildSvgWithAssets( _formatDateTime(now).toText12(
icon: _getWeatherIcon(currentCity?.categoryValue), fontWeight: FontWeight.w500,
width: 64.w, color: AppColors.greyTextColor,
height: 64.w,
), ),
SizedBox(width: 12.w), SizedBox(height: 4.w),
Expanded( "$temperature°C".toText16(
child: Column( isBold: true,
crossAxisAlignment: CrossAxisAlignment.start, weight: FontWeight.w600,
children: [ ),
_formatDateTime(now).toText12( SizedBox(height: 4.w),
fontWeight: FontWeight.w500, healthTip.toText12(
color: AppColors.greyTextColor, color: AppColors.greyTextColor,
), fontWeight: FontWeight.w500,
SizedBox(height: 4.w), maxLine: 2,
"$temperature°C"
.toText16(
isBold: true,
weight: FontWeight.w600,
),
SizedBox(height: 4.w),
healthTip.toText12(
color: AppColors.greyTextColor,
fontWeight: FontWeight.w500,
maxLine: 2,
),
],
),
), ),
], ],
), ),
if (showButton) ...[ ),
SizedBox(height: 16.w), ],
CustomButton( ),
text: LocaleKeys.viewDetails.tr(context: context), if (showButton) ...[
onPressed: () { SizedBox(height: 16.w),
Navigator.of(context).push( CustomButton(
CustomPageRoute( text: LocaleKeys.viewDetails.tr(context: context),
page: ChangeNotifierProvider.value( onPressed: () {
value: weatherVM, Navigator.of(context).push(
child: const WeatherDetailsPage(), CustomPageRoute(
), page: ChangeNotifierProvider.value(
), value: context.read<WeatherMonitorViewModel>(),
); child: const WeatherDetailsPage(),
}, ),
padding: EdgeInsets.zero,
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
fontSize: 14.f,
fontWeight: FontWeight.w600,
borderRadius: 10.r,
height: 40.h,
), ),
], );
], },
padding: EdgeInsets.zero,
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
fontSize: 14.f,
fontWeight: FontWeight.w600,
borderRadius: 10.r,
height: 40.h,
), ),
],
],
),
), ),
), ),
], ],
@ -130,6 +134,70 @@ class WeatherWidget extends StatelessWidget {
); );
} }
Widget noWeatherWidget(BuildContext context){
return Container(
padding: EdgeInsets.all(16.w),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.r,
hasShadow: false,
),
child:Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
height: 48.h,
width: 48.h,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.greyColor,
borderRadius: 12.r,
hasShadow: false,
),
child: Padding(
padding: EdgeInsets.all(12.h),
child: Utils.buildSvgWithAssets(
icon: AppAssets.location_unavailable_filled,
fit: BoxFit.contain,
applyThemeColor: false
),
),
),
SizedBox(width: 12.w),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
_formatDateTime(DateTime.now()).toText12(
fontWeight: FontWeight.w500,
color: AppColors.greyTextColor,
),
SizedBox(height: 4.w),
"--".toText16(
isBold: true,
weight: FontWeight.w600,
),
SizedBox(height: 4.w),
LocaleKeys.locationServicesDisabled.tr().toText12(
color: AppColors.greyTextColor,
fontWeight: FontWeight.w500,
maxLine: 2,
),
],
),
),
],
)).onPress((){
context.read<WeatherMonitorViewModel>().fetchCityInfoList();
});
}
Widget _buildLoadingState() { Widget _buildLoadingState() {
return Column( return Column(
children: [ children: [

@ -12,6 +12,7 @@ import 'package:hmg_patient_app_new/features/authentication/authentication_view_
import 'package:hmg_patient_app_new/features/hmg_services/hmg_services_view_model.dart'; import 'package:hmg_patient_app_new/features/hmg_services/hmg_services_view_model.dart';
import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/get_cmc_all_orders_resp_model.dart'; import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/get_cmc_all_orders_resp_model.dart';
import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/get_cmc_services_resp_model.dart'; import 'package:hmg_patient_app_new/features/hmg_services/models/resq_models/get_cmc_services_resp_model.dart';
import 'package:hmg_patient_app_new/features/location/location_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/home_health_care/hhc_order_detail_page.dart'; import 'package:hmg_patient_app_new/presentation/home_health_care/hhc_order_detail_page.dart';
import 'package:hmg_patient_app_new/presentation/home_health_care/hhc_selection_review_page.dart'; import 'package:hmg_patient_app_new/presentation/home_health_care/hhc_selection_review_page.dart';
@ -395,9 +396,11 @@ class _HhcProceduresPageState extends State<HhcProceduresPage> {
final navigationServices = getIt.get<NavigationService>(); final navigationServices = getIt.get<NavigationService>();
final appState = getIt.get<AppState>(); final appState = getIt.get<AppState>();
final hmgServicesViewModel = context.read<HmgServicesViewModel>(); final hmgServicesViewModel = context.read<HmgServicesViewModel>();
if (hmgServicesViewModel.selectedHhcServices.isNotEmpty) { if (hmgServicesViewModel.selectedHhcServices.isNotEmpty) {
hmgServicesViewModel.setSelectedServiceForHhcOrder(hmgServicesViewModel.selectedHhcServices.first); context.read<LocationViewModel>().placeValueInController();
hmgServicesViewModel.setSelectedServiceForHhcOrder(hmgServicesViewModel.selectedHhcServices.first);
bool result = await navigationServices.push( bool result = await navigationServices.push(
CustomPageRoute( CustomPageRoute(
page: MapUtilityScreen( page: MapUtilityScreen(

@ -250,7 +250,7 @@ class _PrescriptionDetailPageState extends State<PrescriptionDetailPage> {
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.fetchingPrescriptionDetails.tr(context: context)); LoaderBottomSheet.showLoader(loadingText: LocaleKeys.fetchingPrescriptionDetails.tr(context: context));
await prescriptionsViewModel.getPrescriptionDetails(widget.prescriptionsResponseModel, onSuccess: (val) { await prescriptionsViewModel.getPrescriptionDetails(widget.prescriptionsResponseModel, onSuccess: (val) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
prescriptionsViewModel.initiatePrescriptionDelivery(); prescriptionsViewModel.initiatePrescriptionDelivery(context);
}, onError: (err) { }, onError: (err) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
print(err); print(err);

@ -195,7 +195,7 @@ class _PrescriptionsListPageState extends State<PrescriptionsListPage> {
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.fetchingPrescriptionDetails.tr(context: context)); LoaderBottomSheet.showLoader(loadingText: LocaleKeys.fetchingPrescriptionDetails.tr(context: context));
await prescriptionsViewModel.getPrescriptionDetails(prescriptionsViewModel.patientPrescriptionOrders[index], onSuccess: (val) { await prescriptionsViewModel.getPrescriptionDetails(prescriptionsViewModel.patientPrescriptionOrders[index], onSuccess: (val) {
LoaderBottomSheet.hideLoader(); LoaderBottomSheet.hideLoader();
prescriptionsViewModel.initiatePrescriptionDelivery(); prescriptionsViewModel.initiatePrescriptionDelivery(context);
}); });
} }
}, },

@ -211,7 +211,9 @@ class MapUtilityScreen extends StatelessWidget {
context, context,
child: SizedBox( child: SizedBox(
height: MediaQuery.sizeOf(context).height * .8, height: MediaQuery.sizeOf(context).height * .8,
child: LocationInputBottomSheet(), child: LocationInputBottomSheet(
moveCameraController:(location) => context.read<LocationViewModel>().moveController(location) ,
),
), ),
isFullScreen: false, isFullScreen: false,
isCloseButtonVisible: true, isCloseButtonVisible: true,

Loading…
Cancel
Save