This commit is contained in:
Hamza-Ayed
2024-07-07 12:25:20 +03:00
parent 819a32eec1
commit 9925e12447
8 changed files with 189 additions and 164 deletions

View File

@@ -894,8 +894,9 @@ class MapPassengerController extends GetxController {
try {
Uri uri = Uri.parse(link);
if (uri.host == 'maps.google.com') {
if (uri.host == 'maps.google.com' || uri.host == 'www.google.com') {
String? query = uri.queryParameters['q'];
query ??= uri.queryParameters['ll'];
if (query != null) {
List<String> coordinates = query.split(',');
@@ -910,6 +911,9 @@ class MapPassengerController extends GetxController {
};
}
}
} else if (uri.host == 'goo.gl') {
// Shortened URLs might need to be expanded first
// Implement additional logic to expand the URL here if necessary
}
} catch (e) {
print('Error parsing WhatsApp location link: $e');
@@ -1164,7 +1168,7 @@ class MapPassengerController extends GetxController {
}
void delayAndFetchRideStatus(String rideId) {
Timer(const Duration(milliseconds: 200), () async {
Timer(const Duration(seconds: 1), () async {
if (shouldFetch) {
if (remainingTimeToPassengerFromDriverAfterApplied > 0) {
var res = await getRideStatus(rideId);
@@ -1197,7 +1201,7 @@ class MapPassengerController extends GetxController {
}
void delayAndFetchRideStatusForAllDriverAvailable(String rideId) {
Timer(const Duration(milliseconds: 200), () async {
Timer(const Duration(milliseconds: 1000), () async {
if (shouldFetch) {
var res = await getRideStatus(rideId);
// var decod = jsonDecode(res);
@@ -1532,8 +1536,8 @@ class MapPassengerController extends GetxController {
await Future.delayed(const Duration(seconds: 4));
if (rideTimerBegin == true || statusRide == 'Apply') {
await getDriverCarsLocationToPassengerAfterApplied();
reloadMarkerDriverCarsLocationToPassengerAfterApplied();
}
reloadMarkerDriverCarsLocationToPassengerAfterApplied();
}
}
@@ -2107,6 +2111,7 @@ class MapPassengerController extends GetxController {
reloadMarkers() async {
if (statusRide == 'wait') {
clearMarkersExceptStartEnd();
await getCarsLocationByPassengerAndReloadMarker();
await getNearestDriverByPassengerLocation();
}