|  |  |  | @ -7,10 +7,9 @@ import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/ | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | class DoctorMapper{ | 
		
	
		
			
				|  |  |  |  |   static Future<RegionList> getMappedDoctor(List<DoctorList> doctorList, | 
		
	
		
			
				|  |  |  |  |       {bool isArabic = false}) async { | 
		
	
		
			
				|  |  |  |  |       {bool isArabic = false,double lat = 0.0,double long = 0.0}) async { | 
		
	
		
			
				|  |  |  |  |     RegionList regionList = RegionList(); | 
		
	
		
			
				|  |  |  |  |     final lat = await Utils.getNumFromPrefs(CacheConst.userLat); | 
		
	
		
			
				|  |  |  |  |     final long = await Utils.getNumFromPrefs(CacheConst.userLat); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     for (var element in doctorList) { | 
		
	
		
			
				|  |  |  |  |       String? region = element.getRegionName(isArabic); | 
		
	
	
		
			
				
					|  |  |  | @ -126,11 +125,9 @@ class DoctorMapper{ | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   static Future<RegionList> getMappedHospitals( | 
		
	
		
			
				|  |  |  |  |     List<HospitalsModel> hospitalList, { | 
		
	
		
			
				|  |  |  |  |     bool isArabic = false, | 
		
	
		
			
				|  |  |  |  |     bool isArabic = false, double lat = 0.0,double lng = 0.0 | 
		
	
		
			
				|  |  |  |  |   }) async { | 
		
	
		
			
				|  |  |  |  |     final regionList = RegionList(); | 
		
	
		
			
				|  |  |  |  |     final lat = await Utils.getNumFromPrefs(CacheConst.userLat); | 
		
	
		
			
				|  |  |  |  |     final long = await Utils.getNumFromPrefs(CacheConst.userLat); | 
		
	
		
			
				|  |  |  |  |     for (final hospital in hospitalList) { | 
		
	
		
			
				|  |  |  |  |       final region = hospital.getRegionName(isArabic); | 
		
	
		
			
				|  |  |  |  |       if (region == null) continue; | 
		
	
	
		
			
				
					|  |  |  | @ -173,13 +170,13 @@ class DoctorMapper{ | 
		
	
		
			
				|  |  |  |  |           } else if (distance < regionData.hmgDistance) { | 
		
	
		
			
				|  |  |  |  |             regionData.hmgDistance = distance; | 
		
	
		
			
				|  |  |  |  |           } | 
		
	
		
			
				|  |  |  |  |         } else if ( lat != 0&& | 
		
	
		
			
				|  |  |  |  |             long != 0 && | 
		
	
		
			
				|  |  |  |  |         } else if ( lat != 0.0&& | 
		
	
		
			
				|  |  |  |  |             lng != 0.0 && | 
		
	
		
			
				|  |  |  |  |             hospital.latitude != null && | 
		
	
		
			
				|  |  |  |  |             hospital.longitude != null) { | 
		
	
		
			
				|  |  |  |  |           double calculatedDistance = calculateDistance( | 
		
	
		
			
				|  |  |  |  |             lat.toDouble(), | 
		
	
		
			
				|  |  |  |  |             long.toDouble(), | 
		
	
		
			
				|  |  |  |  |             lat, | 
		
	
		
			
				|  |  |  |  |             lng, | 
		
	
		
			
				|  |  |  |  |             double.parse(hospital.latitude!), | 
		
	
		
			
				|  |  |  |  |             double.parse(hospital.longitude!), | 
		
	
		
			
				|  |  |  |  |           ).abs(); | 
		
	
	
		
			
				
					|  |  |  | 
 |