feat: add service area restriction overlay and bump version to 1.0.3+8

This commit is contained in:
Hamza-Ayed
2026-08-11 00:14:03 +03:00
parent e52afa1863
commit bb9517826e
10 changed files with 128 additions and 55 deletions
@@ -139,6 +139,7 @@ class LocationController extends GetxController with WidgetsBindingObserver {
double totalDistance = 0.0;
bool _isReady = false;
bool _isPowerSavingMode = false;
bool isOutsideServiceArea = false; // Add flag to track if outside service area
/// هل خدمات جوجل متوفرة على الجهاز؟ (ج)
/// null = لم يُفحص بعد. على أجهزة هواوي بلا GMS يسقط الباكيج إلى
@@ -638,7 +639,12 @@ class LocationController extends GetxController with WidgetsBindingObserver {
final now = DateTime.now();
final pos = LatLng(loc.latitude!, loc.longitude!);
if (!CountryPolygons.isServiceSupported(pos)) {
bool isOutside = !CountryPolygons.isServiceSupported(pos);
if (isOutsideServiceArea != isOutside) {
isOutsideServiceArea = isOutside;
}
if (isOutside) {
myLocation = const LatLng(31.9539, 35.9106);
} else {
myLocation = pos;
@@ -683,7 +689,7 @@ class LocationController extends GetxController with WidgetsBindingObserver {
homeCtrl.isHomeMapActive &&
homeCtrl.isMapReadyForCommands) {
homeCtrl.mapHomeCaptainController?.animateCamera(
CameraUpdate.newLatLngZoom(pos, 17.5),
CameraUpdate.newLatLngZoom(myLocation, 17.5),
);
}
}