Update: 2026-06-26 17:29:23

This commit is contained in:
Hamza-Ayed
2026-06-26 17:29:23 +03:00
parent a323da29aa
commit 9ded734e38
139 changed files with 1815 additions and 2676 deletions

View File

@@ -28,6 +28,7 @@ class MapEngineController extends GetxController {
Set<Marker> markers = {};
Set<Polyline> polyLines = {};
int markerRevision = 0;
List<LatLng> polylineCoordinates = [];
Set<Polygon> polygons = {};
Set<Circle> circles = {};

View File

@@ -1935,7 +1935,7 @@ class RideLifecycleController extends GetxController {
Get.back();
await Future.delayed(const Duration(milliseconds: 120));
} catch (e) {
mySnackeBarError(e.toString());
mySnackbarError(e.toString());
}
}
@@ -2734,7 +2734,7 @@ class RideLifecycleController extends GetxController {
throw Exception('Failed to save trip');
}
} catch (e) {
mySnackeBarError('Failed to book trip: $e'.tr);
mySnackbarError('Failed to book trip: $e'.tr);
}
}
@@ -3494,20 +3494,13 @@ class RideLifecycleController extends GetxController {
minutes = (durationToAdd.inMinutes % 60).round();
if (polyLines.isNotEmpty) {
mapEngine.clearPolyline();
await Future<void>.delayed(Duration.zero);
mapEngine.polyLines.clear();
}
rideConfirm = false;
isMarkersShown = true;
update();
await bottomSheet();
await mapEngine.playRouteAnimation(
mapEngine.polylineCoordinates, mapEngine.lastComputedBounds);
// بناء Set كاملة دفعة واحدة ثم تعيينها
// بناء الـ markers أولاً ثم وضعها معاً مع polylines في تحديث واحد
final Set<Marker> newMarkers = {
Marker(
markerId: const MarkerId('start'),
@@ -3542,11 +3535,33 @@ class RideLifecycleController extends GetxController {
}
}
// تعيين الـ markers مباشرة في mapEngine (بدون setter لتجنب update() مضاعف)
mapEngine.markers = newMarkers;
mapEngine.markerRevision++;
Log.print(
'✅ FIX P1 v2: ${newMarkers.length} markers placed — start: $startLoc, end: $endLoc');
mapEngine.update();
// إضافة الـ markers مباشرة عبر الـ controller لضمان ظهورها
try {
final ctrl = mapEngine.mapController;
if (ctrl != null) {
for (final m in newMarkers) {
await ctrl.addMarker(m);
}
Log.print('✅ Added ${newMarkers.length} markers via controller.addMarker()');
} else {
Log.print('⚠️ mapController is null, relying on declarative markers');
}
} catch (e) {
Log.print('⚠️ addMarker via controller failed: $e');
}
await bottomSheet();
await mapEngine.playRouteAnimation(
mapEngine.polylineCoordinates, mapEngine.lastComputedBounds);
update();
} catch (e, stackTrace) {
if (isDrawingRoute) {
isDrawingRoute = false;

View File

@@ -41,7 +41,7 @@ class ComplaintController extends GetxController {
void _showCustomSnackbar(String title, String message,
{bool isError = false}) {
if (isError) {
mySnackeBarError(message.tr);
mySnackbarError(message.tr);
} else {
mySnackbarSuccess(message.tr);
}

View File

@@ -171,7 +171,7 @@ ${AppLink.inviteRedirectUrl}?code=$couponCode&app=rider
}
} catch (e) {
Log.print('Error picking contacts: $e');
mySnackeBarError('An error occurred while picking contacts: $e'.tr);
mySnackbarError('An error occurred while picking contacts: $e'.tr);
}
}
@@ -189,7 +189,7 @@ ${AppLink.inviteRedirectUrl}?code=$couponCode&app=rider
void sendInviteToPassenger() async {
if (invitePhoneController.text.isEmpty ||
invitePhoneController.text.length < 9) {
mySnackeBarError('Please enter a correct phone'.tr);
mySnackbarError('Please enter a correct phone'.tr);
return;
}
@@ -234,7 +234,7 @@ ${AppLink.inviteRedirectUrl}?code=$couponCode&app=rider
}
} catch (e) {
Log.print("Error sending invite: $e");
mySnackeBarError('An unexpected error occurred. Please try again.'.tr);
mySnackbarError('An unexpected error occurred. Please try again.'.tr);
}
}
@@ -290,7 +290,7 @@ ${AppLink.inviteRedirectUrl}?code=$couponCode&app=rider
);
fetchDriverStatsPassengers(); // Refresh list
} else {
mySnackeBarError(response['message'] ?? 'Claim failed'.tr);
mySnackbarError(response['message'] ?? 'Claim failed'.tr);
}
}
},

View File

@@ -80,11 +80,11 @@ class InvitesRewardsController extends GetxController {
mySnackbarWarning(response['message'] ?? "Could not add invite".tr);
}
} else {
mySnackeBarError("Network error occurred".tr);
mySnackbarError("Network error occurred".tr);
}
} catch (e) {
Navigator.maybeOf(Get.context!)?.pop(); // close loading dialog only
mySnackeBarError("Network error occurred".tr);
mySnackbarError("Network error occurred".tr);
}
}
}

View File

@@ -57,15 +57,15 @@ class VipOrderController extends GetxController {
tripData.value = res['message'];
} else {
tripData.clear(); // Ensure empty list if no data
// mySnackeBarError('No trip data found');
// mySnackbarError('No trip data found');
}
} else {
tripData.clear();
// mySnackeBarError('Failed to fetch trip data');
// mySnackbarError('Failed to fetch trip data');
}
} catch (e) {
tripData.clear();
// mySnackeBarError('An error occurred: $e');
// mySnackbarError('An error occurred: $e');
} finally {
isLoading.value = false;
}