pre map passenger splitting
This commit is contained in:
@@ -74,6 +74,20 @@
|
||||
<data android:scheme="geo" />
|
||||
</intent-filter>
|
||||
|
||||
<!-- Navigation Intents -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="google.navigation" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data android:mimeType="vnd.android.cursor.item/map" />
|
||||
</intent-filter>
|
||||
|
||||
</activity>
|
||||
|
||||
<meta-data
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -3015,6 +3015,23 @@ class MapPassengerController extends GetxController {
|
||||
Future<Map<String, double>?> extractCoordinatesFromLinkAsync(
|
||||
String link) async {
|
||||
try {
|
||||
// 1. معالجة روابط الخرائط المباشرة (geo: و google.navigation:)
|
||||
if (link.startsWith('geo:') || link.startsWith('google.navigation:')) {
|
||||
RegExp regex = RegExp(r'(-?\d+\.\d+)[,/~=](-?\d+\.\d+)');
|
||||
var match = regex.firstMatch(link);
|
||||
if (match != null) {
|
||||
double lat = double.parse(match.group(1)!);
|
||||
double lng = double.parse(match.group(2)!);
|
||||
if (lat > 40 && lat > lng) {
|
||||
double temp = lat;
|
||||
lat = lng;
|
||||
lng = temp;
|
||||
}
|
||||
return {'latitude': lat, 'longitude': lng};
|
||||
}
|
||||
}
|
||||
|
||||
// 2. معالجة الروابط العادية (http/https)
|
||||
int urlStartIndex = link.indexOf(RegExp(r'https?://'));
|
||||
if (urlStartIndex == -1) return null;
|
||||
String cleanLink = link.substring(urlStartIndex).trim();
|
||||
|
||||
Reference in New Issue
Block a user