Update: 2026-07-12 00:24:19

This commit is contained in:
Hamza-Ayed
2026-07-12 00:24:19 +03:00
parent 83f5bf516b
commit 8f4bb1631c
35 changed files with 212 additions and 160 deletions
+77 -72
View File
@@ -4,92 +4,67 @@ import 'package:intaleq_maps/intaleq_maps.dart';
class CountryPolygons { class CountryPolygons {
// ========================================================== // ==========================================================
// 1. الأردن: تغطية الممر الحضري الرئيسي (من إربد شمالاً حتى العقبة جنوباً) // 1. الأردن: عمان، الزرقاء، إربد، السلط ومساحة كبيرة داخل الأردن
// حوالي 12 نقطة
// ========================================================== // ==========================================================
static final List<LatLng> jordanBoundary = [ static final List<LatLng> jordanBoundary = [
// شمال إربد (قرب الحدود) const LatLng(32.70, 35.80), // شمال إربد
const LatLng(32.65, 35.80), const LatLng(32.35, 36.30), // المفرق
// شمال شرق المفرق const LatLng(32.10, 36.30), // الزرقاء
const LatLng(32.35, 37.00), const LatLng(31.85, 36.20), // شرق عمان
// شرق الزرقاء / الأزرق const LatLng(31.50, 36.00), // مادبا
const LatLng(31.85, 36.80), const LatLng(30.80, 35.80), // الكرك / الطفيلة
// جنوب شرق (نهاية الزحف السكاني) const LatLng(30.20, 35.60), // معان
const LatLng(31.00, 36.50), const LatLng(29.50, 35.00), // العقبة
// جنوب / معان const LatLng(29.50, 34.90), // الحدود الغربية للعقبة
const LatLng(30.30, 35.75), const LatLng(30.50, 35.20), // وادي عربة
// العقبة const LatLng(31.50, 35.50), // البحر الميت
const LatLng(29.50, 35.00), const LatLng(32.05, 35.60), // السلط
// البحر الأحمر / الحدود الغربية const LatLng(32.70, 35.60), // غرب إربد
const LatLng(29.50, 34.85),
// غرب وادي عربة
const LatLng(30.80, 35.25),
// منطقة البحر الميت / السلط
const LatLng(32.00, 35.50),
// العودة عبر وادي الأردن إلى الشمال
const LatLng(32.45, 35.60),
// العودة لنقطة إربد
const LatLng(32.65, 35.80),
]; ];
// ========================================================== // ==========================================================
// 2. سوريا: تغطية الممر الغربي والساحلي (درعا، دمشق، حمص، حماة، حلب، الساحل) // 2. سوريا: دمشق، ريف دمشق، حمص، حلب، اللاذقية (استثناء الصحراء)
// حوالي 14 نقطة
// ========================================================== // ==========================================================
static final List<LatLng> syriaBoundary = [ static final List<LatLng> syriaBoundary = [
// درعا / الجنوب const LatLng(32.60, 36.00), // درعا
const LatLng(32.65, 35.95), const LatLng(32.70, 36.60), // السويداء
// شرق السويداء (حدود المنطقة المأهولة) const LatLng(33.50, 36.50), // ريف دمشق الشرقي
const LatLng(32.85, 37.10), const LatLng(34.10, 36.80), // النبك
// أطراف دمشق الشرقية const LatLng(34.70, 36.80), // حمص
const LatLng(33.50, 36.65), const LatLng(35.10, 36.80), // حماة
// تدمر (أقصى امتداد شرقي للمضلع) const LatLng(36.20, 37.30), // حلب الشرقية
const LatLng(34.50, 38.30), const LatLng(36.60, 37.00), // شمال حلب
// الرقة (شمال شرق) const LatLng(36.00, 36.00), // إدلب / الجبال
const LatLng(35.95, 38.80), const LatLng(35.70, 35.80), // اللاذقية
// حلب (الشمال) const LatLng(34.80, 35.80), // طرطوس
const LatLng(36.45, 37.15), const LatLng(34.50, 36.20), // تلكلخ
// الحدود الشمالية الغربية (إدلب / تركيا) const LatLng(33.50, 36.00), // دمشق الغربية
const LatLng(36.50, 36.50),
// اللاذقية (الساحل)
const LatLng(35.50, 35.75),
// طرطوس (الساحل)
const LatLng(34.80, 35.85),
// حمص
const LatLng(34.70, 36.70),
// حماة
const LatLng(35.10, 36.70),
// العودة إلى منطقة دمشق
const LatLng(33.40, 36.30),
// العودة إلى درعا
const LatLng(32.65, 35.95),
]; ];
// ========================================================== // ==========================================================
// 3. مصر: تغطية القاهرة الكبرى، الدلتا، والإسكندرية والإسماعيلية // 3. مصر: القاهرة كاملة، الإسكندرية، ومراكز المحافظات
// حوالي 10 نقاط
// ========================================================== // ==========================================================
static final List<LatLng> egyptBoundary = [ static final List<LatLng> egyptBoundary = [
// جنوب الفيوم (أقصى امتداد جنوبي غربي) const LatLng(29.50, 30.80), // جنوب الفيوم
const LatLng(29.20, 30.60), const LatLng(29.80, 31.40), // شرق القاهرة الكبرى
// جنوب القاهرة (العياط) const LatLng(30.10, 31.80), // العاشر من رمضان
const LatLng(29.80, 31.30), const LatLng(30.60, 32.30), // الإسماعيلية
// شرق السويس const LatLng(31.30, 31.80), // بورسعيد
const LatLng(29.95, 32.70), const LatLng(31.50, 31.25), // دمياط
// الإسماعيلية / القناة const LatLng(31.30, 29.80), // الإسكندرية
const LatLng(30.60, 32.25), const LatLng(30.80, 29.80), // وادي النطرون
// بورسعيد / أطراف الدلتا الشمالية الشرقية const LatLng(30.00, 30.80), // 6 أكتوبر / غرب القاهرة
const LatLng(31.30, 31.80),
// دمياط / ساحل الدلتا
const LatLng(31.50, 31.25),
// الإسكندرية (أقصى الشمال الغربي)
const LatLng(31.20, 29.80),
// غرب الدلتا
const LatLng(30.50, 30.20),
// العودة لنقطة البداية
const LatLng(29.20, 30.60),
]; ];
/// دالة للتحقق مما إذا كان الموقع ضمن نطاق الخدمة المدعوم
static bool isServiceSupported(LatLng? point) {
if (point == null) return false;
if (_isPointInPolygon(point, jordanBoundary)) return true;
if (_isPointInPolygon(point, syriaBoundary)) return true;
if (_isPointInPolygon(point, egyptBoundary)) return true;
return false;
}
// دالة تُرجع رابط API بناءً على اسم الدولة // دالة تُرجع رابط API بناءً على اسم الدولة
static String getRoutingApiUrl(String countryName) { static String getRoutingApiUrl(String countryName) {
switch (countryName) { switch (countryName) {
@@ -104,4 +79,34 @@ class CountryPolygons {
return 'https://routec.intaleq.xyz/route'; return 'https://routec.intaleq.xyz/route';
} }
} }
/// دالة تحدد اسم الدولة (باللغة الإنجليزية للـ API) بناءً على الإحداثيات
static String getCountryName(LatLng? point) {
if (point == null) return "unsupported";
if (_isPointInPolygon(point, jordanBoundary)) return "Jordan";
if (_isPointInPolygon(point, syriaBoundary)) return "Syria";
if (_isPointInPolygon(point, egyptBoundary)) return "Egypt";
return "unsupported";
}
/// خوارزمية Ray Casting للتحقق من وقوع نقطة داخل مضلع
static bool _isPointInPolygon(LatLng p, List<LatLng> polygon) {
bool isInside = false;
int j = polygon.length - 1;
for (int i = 0; i < polygon.length; i++) {
if (((polygon[i].latitude > p.latitude) !=
(polygon[j].latitude > p.latitude)) &&
(p.longitude <
(polygon[j].longitude - polygon[i].longitude) *
(p.latitude - polygon[i].latitude) /
(polygon[j].latitude - polygon[i].latitude) +
polygon[i].longitude)) {
isInside = !isInside;
}
j = i;
}
return isInside;
}
} }
@@ -12,6 +12,7 @@ import 'dart:async';
import '../../../constant/links.dart'; import '../../../constant/links.dart';
import '../../../constant/style.dart'; import '../../../constant/style.dart';
import '../../../constant/table_names.dart'; import '../../../constant/table_names.dart';
import '../../../constant/country_polygons.dart';
import '../../../main.dart'; import '../../../main.dart';
import '../../../print.dart'; import '../../../print.dart';
import '../../../views/home/my_wallet/walet_captain.dart'; import '../../../views/home/my_wallet/walet_captain.dart';
@@ -724,6 +725,34 @@ class HomeCaptainController extends GetxController {
myLocation = LatLng(locData.latitude!, locData.longitude!); myLocation = LatLng(locData.latitude!, locData.longitude!);
print( print(
"📍 [HomeCaptain] Location updated: ${myLocation.latitude}, ${myLocation.longitude}"); "📍 [HomeCaptain] Location updated: ${myLocation.latitude}, ${myLocation.longitude}");
if (!CountryPolygons.isServiceSupported(myLocation)) {
Get.bottomSheet(
Container(
padding: const EdgeInsets.all(20),
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(Icons.location_off, size: 60, color: Colors.redAccent),
const SizedBox(height: 15),
Text(
'service_unavailable_area'.tr,
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
const SizedBox(height: 10),
],
),
),
isDismissible: false,
enableDrag: false,
);
}
} else { } else {
print( print(
"⚠️ [HomeCaptain] Could not get current location, using default."); "⚠️ [HomeCaptain] Could not get current location, using default.");
@@ -2676,4 +2676,5 @@ final Map<String, String> ar_eg = {
"Clear Destination": "مسح الوجهة", "Clear Destination": "مسح الوجهة",
"Destination cleared!": "تم مسح الوجهة الشخصية!", "Destination cleared!": "تم مسح الوجهة الشخصية!",
"Move map to select destination": "حرك الخريطة لتحديد الوجهة الشخصية", "Move map to select destination": "حرك الخريطة لتحديد الوجهة الشخصية",
"service_unavailable_area": "هذه الخدمة غير متوفرة حالياً في منطقتك",
}; };
@@ -2676,4 +2676,5 @@ final Map<String, String> ar_jo = {
"Clear Destination": "مسح الوجهة", "Clear Destination": "مسح الوجهة",
"Destination cleared!": "تم مسح الوجهة الشخصية!", "Destination cleared!": "تم مسح الوجهة الشخصية!",
"Move map to select destination": "حرك الخريطة لتحديد الوجهة الشخصية", "Move map to select destination": "حرك الخريطة لتحديد الوجهة الشخصية",
"service_unavailable_area": "هذه الخدمة غير متوفرة حالياً في منطقتك",
}; };
@@ -2678,4 +2678,5 @@ final Map<String, String> ar_sy = {
"🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'وصلت لأعلى مستوى!", "🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'وصلت لأعلى مستوى!",
"💰 Pay with Wallet": "💰 ادفع من المحفظة", "💰 Pay with Wallet": "💰 ادفع من المحفظة",
"💳 Pay with Credit Card": "💳 ادفع ببطاقة ائتمان", "💳 Pay with Credit Card": "💳 ادفع ببطاقة ائتمان",
"service_unavailable_area": "هذه الخدمة غير متوفرة حالياً في منطقتك",
}; };
+1
View File
@@ -2659,4 +2659,5 @@ final Map<String, String> de = {
"🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!", "🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!",
"💰 Pay with Wallet": "Mit Portemonnaie bezahlen", "💰 Pay with Wallet": "Mit Portemonnaie bezahlen",
"💳 Pay with Credit Card": "💳 Mit Kreditkarte bezahlen", "💳 Pay with Credit Card": "💳 Mit Kreditkarte bezahlen",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -2659,4 +2659,5 @@ final Map<String, String> el = {
"🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!", "🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!",
"💰 Pay with Wallet": "💰 Πληρωμή με Πορτοφόλι", "💰 Pay with Wallet": "💰 Πληρωμή με Πορτοφόλι",
"💳 Pay with Credit Card": "💳 Πληρωμή με Κάρτα", "💳 Pay with Credit Card": "💳 Πληρωμή με Κάρτα",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -2676,4 +2676,5 @@ final Map<String, String> en = {
"Clear Destination": "Clear Destination", "Clear Destination": "Clear Destination",
"Destination cleared!": "Destination cleared!", "Destination cleared!": "Destination cleared!",
"Move map to select destination": "Move map to select destination", "Move map to select destination": "Move map to select destination",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -2659,4 +2659,5 @@ final Map<String, String> es = {
"🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!", "🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!",
"💰 Pay with Wallet": "Pagar con billetera", "💰 Pay with Wallet": "Pagar con billetera",
"💳 Pay with Credit Card": "💳 Pagar con tarjeta de crédito", "💳 Pay with Credit Card": "💳 Pagar con tarjeta de crédito",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -2659,4 +2659,5 @@ final Map<String, String> fa = {
"🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!", "🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!",
"💰 Pay with Wallet": "💰 پرداخت با کیف پول", "💰 Pay with Wallet": "💰 پرداخت با کیف پول",
"💳 Pay with Credit Card": "💳 پرداخت با کارت اعتباری", "💳 Pay with Credit Card": "💳 پرداخت با کارت اعتباری",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -2659,4 +2659,5 @@ final Map<String, String> fr = {
"🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!", "🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!",
"💰 Pay with Wallet": "💰 Payer avec le portefeuille", "💰 Pay with Wallet": "💰 Payer avec le portefeuille",
"💳 Pay with Credit Card": "💳 Payer par carte de crédit", "💳 Pay with Credit Card": "💳 Payer par carte de crédit",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -2659,4 +2659,5 @@ final Map<String, String> hi = {
"🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!", "🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!",
"💰 Pay with Wallet": "💰 वॉलेट से भुगतान करें", "💰 Pay with Wallet": "💰 वॉलेट से भुगतान करें",
"💳 Pay with Credit Card": "💳 क्रेडिट कार्ड से भुगतान करें", "💳 Pay with Credit Card": "💳 क्रेडिट कार्ड से भुगतान करें",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -2659,4 +2659,5 @@ final Map<String, String> it = {
"🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!", "🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!",
"💰 Pay with Wallet": "💰 Paga con portafoglio", "💰 Pay with Wallet": "💰 Paga con portafoglio",
"💳 Pay with Credit Card": "💳 Paga con carta di credito", "💳 Pay with Credit Card": "💳 Paga con carta di credito",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -2659,4 +2659,5 @@ final Map<String, String> ru = {
"🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!", "🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!",
"💰 Pay with Wallet": "💰 Оплата кошельком", "💰 Pay with Wallet": "💰 Оплата кошельком",
"💳 Pay with Credit Card": "💳 Оплата картой", "💳 Pay with Credit Card": "💳 Оплата картой",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -2659,4 +2659,5 @@ final Map<String, String> tr = {
"🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!", "🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!",
"💰 Pay with Wallet": "💰 Cüzdan ile Öde", "💰 Pay with Wallet": "💰 Cüzdan ile Öde",
"💳 Pay with Credit Card": "💳 Kredi Kartı ile Öde", "💳 Pay with Credit Card": "💳 Kredi Kartı ile Öde",
"service_unavailable_area": "This service is not currently available in your area",
}; };
@@ -34,5 +34,6 @@ class MyTranslation extends Translations {
"tr": tr, "tr": tr,
"ur": ur, "ur": ur,
"zh": zh, "zh": zh,
"service_unavailable_area": "This service is not currently available in your area",
}; };
} }
+1
View File
@@ -2659,4 +2659,5 @@ final Map<String, String> ur = {
"🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!", "🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!",
"💰 Pay with Wallet": "💰 والٹ سے ادائیگی کریں", "💰 Pay with Wallet": "💰 والٹ سے ادائیگی کریں",
"💳 Pay with Credit Card": "💳 کریڈٹ کارڈ سے ادائیگی کریں", "💳 Pay with Credit Card": "💳 کریڈٹ کارڈ سے ادائیگی کریں",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -2659,4 +2659,5 @@ final Map<String, String> zh = {
"🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!", "🏆 \\\${'Maximum Level Reached!": "🏆 \\\${'Maximum Level Reached!",
"💰 Pay with Wallet": "💰 ادفع بالمحفظة", "💰 Pay with Wallet": "💰 ادفع بالمحفظة",
"💳 Pay with Credit Card": "💳 ادفع بالبطاقة", "💳 Pay with Credit Card": "💳 ادفع بالبطاقة",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+48 -88
View File
@@ -4,116 +4,76 @@ import 'package:intaleq_maps/intaleq_maps.dart';
class CountryPolygons { class CountryPolygons {
// ========================================================== // ==========================================================
// 1. الأردن: تغطية الممر الحضري الرئيسي (من إربد شمالاً حتى العقبة جنوباً) // 1. الأردن: عمان، الزرقاء، إربد، السلط ومساحة كبيرة داخل الأردن
// حوالي 12 نقطة
// ========================================================== // ==========================================================
static final List<LatLng> jordanBoundary = [ static final List<LatLng> jordanBoundary = [
// شمال إربد (قرب الحدود) const LatLng(32.70, 35.80), // شمال إربد
const LatLng(32.65, 35.80), const LatLng(32.35, 36.30), // المفرق
// شمال شرق المفرق const LatLng(32.10, 36.30), // الزرقاء
const LatLng(32.35, 37.00), const LatLng(31.85, 36.20), // شرق عمان
// شرق الزرقاء / الأزرق const LatLng(31.50, 36.00), // مادبا
const LatLng(31.85, 36.80), const LatLng(30.80, 35.80), // الكرك / الطفيلة
// جنوب شرق (نهاية الزحف السكاني) const LatLng(30.20, 35.60), // معان
const LatLng(31.00, 36.50), const LatLng(29.50, 35.00), // العقبة
// جنوب / معان const LatLng(29.50, 34.90), // الحدود الغربية للعقبة
const LatLng(30.30, 35.75), const LatLng(30.50, 35.20), // وادي عربة
// العقبة const LatLng(31.50, 35.50), // البحر الميت
const LatLng(29.50, 35.00), const LatLng(32.05, 35.60), // السلط
// البحر الأحمر / الحدود الغربية const LatLng(32.70, 35.60), // غرب إربد
const LatLng(29.50, 34.85),
// غرب وادي عربة
const LatLng(30.80, 35.25),
// منطقة البحر الميت / السلط
const LatLng(32.00, 35.50),
// العودة عبر وادي الأردن إلى الشمال
const LatLng(32.45, 35.60),
// العودة لنقطة إربد
const LatLng(32.65, 35.80),
]; ];
// ========================================================== // ==========================================================
// 2. سوريا: تغطية الممر الغربي والساحلي (درعا، دمشق، حمص، حماة، حلب، الساحل) // 2. سوريا: دمشق، ريف دمشق، حمص، حلب، اللاذقية (استثناء الصحراء)
// حوالي 14 نقطة
// ========================================================== // ==========================================================
static final List<LatLng> syriaBoundary = [ static final List<LatLng> syriaBoundary = [
// درعا / الجنوب const LatLng(32.60, 36.00), // درعا
const LatLng(32.65, 35.95), const LatLng(32.70, 36.60), // السويداء
// شرق السويداء (حدود المنطقة المأهولة) const LatLng(33.50, 36.50), // ريف دمشق الشرقي
const LatLng(32.85, 37.10), const LatLng(34.10, 36.80), // النبك
// أطراف دمشق الشرقية const LatLng(34.70, 36.80), // حمص
const LatLng(33.50, 36.65), const LatLng(35.10, 36.80), // حماة
// تدمر (أقصى امتداد شرقي للمضلع) const LatLng(36.20, 37.30), // حلب الشرقية
const LatLng(34.50, 38.30), const LatLng(36.60, 37.00), // شمال حلب
// الرقة (شمال شرق) const LatLng(36.00, 36.00), // إدلب / الجبال
const LatLng(35.95, 38.80), const LatLng(35.70, 35.80), // اللاذقية
// حلب (الشمال) const LatLng(34.80, 35.80), // طرطوس
const LatLng(36.45, 37.15), const LatLng(34.50, 36.20), // تلكلخ
// الحدود الشمالية الغربية (إدلب / تركيا) const LatLng(33.50, 36.00), // دمشق الغربية
const LatLng(36.50, 36.50),
// اللاذقية (الساحل)
const LatLng(35.50, 35.75),
// طرطوس (الساحل)
const LatLng(34.80, 35.85),
// حمص
const LatLng(34.70, 36.70),
// حماة
const LatLng(35.10, 36.70),
// العودة إلى منطقة دمشق
const LatLng(33.40, 36.30),
// العودة إلى درعا
const LatLng(32.65, 35.95),
]; ];
// ========================================================== // ==========================================================
// 3. مصر: تغطية القاهرة الكبرى، الدلتا، والإسكندرية والإسماعيلية // 3. مصر: القاهرة كاملة، الإسكندرية، ومراكز المحافظات
// حوالي 10 نقاط
// ========================================================== // ==========================================================
static final List<LatLng> egyptBoundary = [ static final List<LatLng> egyptBoundary = [
// جنوب الفيوم (أقصى امتداد جنوبي غربي) const LatLng(29.50, 30.80), // جنوب الفيوم
const LatLng(29.20, 30.60), const LatLng(29.80, 31.40), // شرق القاهرة الكبرى
// جنوب القاهرة (العياط) const LatLng(30.10, 31.80), // العاشر من رمضان
const LatLng(29.80, 31.30), const LatLng(30.60, 32.30), // الإسماعيلية
// شرق السويس const LatLng(31.30, 31.80), // بورسعيد
const LatLng(29.95, 32.70), const LatLng(31.50, 31.25), // دمياط
// الإسماعيلية / القناة const LatLng(31.30, 29.80), // الإسكندرية
const LatLng(30.60, 32.25), const LatLng(30.80, 29.80), // وادي النطرون
// بورسعيد / أطراف الدلتا الشمالية الشرقية const LatLng(30.00, 30.80), // 6 أكتوبر / غرب القاهرة
const LatLng(31.30, 31.80),
// دمياط / ساحل الدلتا
const LatLng(31.50, 31.25),
// الإسكندرية (أقصى الشمال الغربي)
const LatLng(31.20, 29.80),
// غرب الدلتا
const LatLng(30.50, 30.20),
// العودة لنقطة البداية
const LatLng(29.20, 30.60),
]; ];
// دالة تُرجع رابط API بناءً على اسم الدولة /// دالة للتحقق مما إذا كان الموقع ضمن نطاق الخدمة المدعوم
// static String getRoutingApiUrl(String countryName) { static bool isServiceSupported(LatLng? point) {
// switch (countryName) { if (point == null) return false;
// case 'Jordan': if (_isPointInPolygon(point, jordanBoundary)) return true;
// return 'https://routec.intaleq.xyz/route-jo'; if (_isPointInPolygon(point, syriaBoundary)) return true;
// case 'Syria': if (_isPointInPolygon(point, egyptBoundary)) return true;
// return 'https://routec.intaleq.xyz/route'; return false;
// case 'Egypt': }
// return 'https://routec.intaleq.xyz/route-eg';
// default:
// // الافتراضي في حالة لم يقع الموقع ضمن أي من المضلعات
// return 'https://routec.intaleq.xyz/route';
// }
// }
/// دالة تحدد اسم الدولة (باللغة الإنجليزية للـ API) بناءً على الإحداثيات /// دالة تحدد اسم الدولة (باللغة الإنجليزية للـ API) بناءً على الإحداثيات
static String getCountryName(LatLng? point) { static String getCountryName(LatLng? point) {
if (point == null) return "jordan"; if (point == null) return "unsupported";
if (_isPointInPolygon(point, jordanBoundary)) return "jordan"; if (_isPointInPolygon(point, jordanBoundary)) return "jordan";
if (_isPointInPolygon(point, syriaBoundary)) return "syria"; if (_isPointInPolygon(point, syriaBoundary)) return "syria";
if (_isPointInPolygon(point, egyptBoundary)) return "egypt"; if (_isPointInPolygon(point, egyptBoundary)) return "egypt";
return "jordan"; // الافتراضي return "unsupported";
} }
/// خوارزمية Ray Casting للتحقق من وقوع نقطة داخل مضلع /// خوارزمية Ray Casting للتحقق من وقوع نقطة داخل مضلع
@@ -296,6 +296,33 @@ class LocationSearchController extends GetxController {
newStartPointLocation = passengerLocation; newStartPointLocation = passengerLocation;
newMyLocation = passengerLocation; newMyLocation = passengerLocation;
if (!CountryPolygons.isServiceSupported(passengerLocation)) {
Get.bottomSheet(
Container(
padding: const EdgeInsets.all(20),
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(Icons.location_off, size: 60, color: Colors.redAccent),
const SizedBox(height: 15),
Text(
'service_unavailable_area'.tr,
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
const SizedBox(height: 10),
],
),
),
isDismissible: false,
enableDrag: false,
);
}
if (Get.isRegistered<RideLifecycleController>()) { if (Get.isRegistered<RideLifecycleController>()) {
final rideLifecycle = Get.find<RideLifecycleController>(); final rideLifecycle = Get.find<RideLifecycleController>();
rideLifecycle.getLocationArea( rideLifecycle.getLocationArea(
@@ -1753,4 +1753,5 @@ final Map<String, String> ar_eg = {
"Please top up your wallet to subscribe to Siro Prime.": "يرجى شحن محفظتك للاشتراك في سيرو برايم.", "Please top up your wallet to subscribe to Siro Prime.": "يرجى شحن محفظتك للاشتراك في سيرو برايم.",
"Top Up Wallet": "شحن المحفظة", "Top Up Wallet": "شحن المحفظة",
"• Subscription renews automatically every 30 days\n• Cancel anytime from your wallet page\n• Amount is deducted from your in-app wallet": "• يتجدد الاشتراك تلقائياً كل 30 يوماً\n• يمكن الإلغاء في أي وقت من صفحة المحفظة\n• يُخصم المبلغ من محفظتك داخل التطبيق", "• Subscription renews automatically every 30 days\n• Cancel anytime from your wallet page\n• Amount is deducted from your in-app wallet": "• يتجدد الاشتراك تلقائياً كل 30 يوماً\n• يمكن الإلغاء في أي وقت من صفحة المحفظة\n• يُخصم المبلغ من محفظتك داخل التطبيق",
"service_unavailable_area": "هذه الخدمة غير متوفرة حالياً في منطقتك",
}; };
@@ -1753,4 +1753,5 @@ final Map<String, String> ar_jo = {
"Please top up your wallet to subscribe to Siro Prime.": "يرجى شحن محفظتك للاشتراك في سيرو برايم.", "Please top up your wallet to subscribe to Siro Prime.": "يرجى شحن محفظتك للاشتراك في سيرو برايم.",
"Top Up Wallet": "شحن المحفظة", "Top Up Wallet": "شحن المحفظة",
"• Subscription renews automatically every 30 days\n• Cancel anytime from your wallet page\n• Amount is deducted from your in-app wallet": "• يتجدد الاشتراك تلقائياً كل 30 يوماً\n• يمكن الإلغاء في أي وقت من صفحة المحفظة\n• يُخصم المبلغ من محفظتك داخل التطبيق", "• Subscription renews automatically every 30 days\n• Cancel anytime from your wallet page\n• Amount is deducted from your in-app wallet": "• يتجدد الاشتراك تلقائياً كل 30 يوماً\n• يمكن الإلغاء في أي وقت من صفحة المحفظة\n• يُخصم المبلغ من محفظتك داخل التطبيق",
"service_unavailable_area": "هذه الخدمة غير متوفرة حالياً في منطقتك",
}; };
@@ -1753,4 +1753,5 @@ final Map<String, String> ar_sy = {
"Please top up your wallet to subscribe to Siro Prime.": "يرجى شحن محفظتك للاشتراك في سيرو برايم.", "Please top up your wallet to subscribe to Siro Prime.": "يرجى شحن محفظتك للاشتراك في سيرو برايم.",
"Top Up Wallet": "شحن المحفظة", "Top Up Wallet": "شحن المحفظة",
"• Subscription renews automatically every 30 days\n• Cancel anytime from your wallet page\n• Amount is deducted from your in-app wallet": "• يتجدد الاشتراك تلقائياً كل 30 يوماً\n• يمكن الإلغاء في أي وقت من صفحة المحفظة\n• يُخصم المبلغ من محفظتك داخل التطبيق", "• Subscription renews automatically every 30 days\n• Cancel anytime from your wallet page\n• Amount is deducted from your in-app wallet": "• يتجدد الاشتراك تلقائياً كل 30 يوماً\n• يمكن الإلغاء في أي وقت من صفحة المحفظة\n• يُخصم المبلغ من محفظتك داخل التطبيق",
"service_unavailable_area": "هذه الخدمة غير متوفرة حالياً في منطقتك",
}; };
+1
View File
@@ -1712,4 +1712,5 @@ final Map<String, String> de = {
"⚠️ You need to choose an amount!": "⚠️ Sie müssen einen Betrag auswählen!", "⚠️ You need to choose an amount!": "⚠️ Sie müssen einen Betrag auswählen!",
"💰 Pay with Wallet": "Mit Portemonnaie bezahlen", "💰 Pay with Wallet": "Mit Portemonnaie bezahlen",
"💳 Pay with Credit Card": "💳 Mit Kreditkarte bezahlen", "💳 Pay with Credit Card": "💳 Mit Kreditkarte bezahlen",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -1712,4 +1712,5 @@ final Map<String, String> el = {
"⚠️ You need to choose an amount!": "⚠️ Επιλέξτε ποσό!", "⚠️ You need to choose an amount!": "⚠️ Επιλέξτε ποσό!",
"💰 Pay with Wallet": "💰 Πληρωμή με Πορτοφόλι", "💰 Pay with Wallet": "💰 Πληρωμή με Πορτοφόλι",
"💳 Pay with Credit Card": "💳 Πληρωμή με Κάρτα", "💳 Pay with Credit Card": "💳 Πληρωμή με Κάρτα",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -1712,4 +1712,5 @@ final Map<String, String> es = {
"⚠️ You need to choose an amount!": "⚠️ ¡Necesitas elegir un monto!", "⚠️ You need to choose an amount!": "⚠️ ¡Necesitas elegir un monto!",
"💰 Pay with Wallet": "Pagar con billetera", "💰 Pay with Wallet": "Pagar con billetera",
"💳 Pay with Credit Card": "💳 Pagar con tarjeta de crédito", "💳 Pay with Credit Card": "💳 Pagar con tarjeta de crédito",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -1712,4 +1712,5 @@ final Map<String, String> fa = {
"⚠️ You need to choose an amount!": "⚠️ باید مبلغی را انتخاب کنید!", "⚠️ You need to choose an amount!": "⚠️ باید مبلغی را انتخاب کنید!",
"💰 Pay with Wallet": "💰 پرداخت با کیف پول", "💰 Pay with Wallet": "💰 پرداخت با کیف پول",
"💳 Pay with Credit Card": "💳 پرداخت با کارت اعتباری", "💳 Pay with Credit Card": "💳 پرداخت با کارت اعتباری",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -1712,4 +1712,5 @@ final Map<String, String> fr = {
"⚠️ You need to choose an amount!": "⚠️ Vous devez choisir un montant !", "⚠️ You need to choose an amount!": "⚠️ Vous devez choisir un montant !",
"💰 Pay with Wallet": "💰 Payer avec le portefeuille", "💰 Pay with Wallet": "💰 Payer avec le portefeuille",
"💳 Pay with Credit Card": "💳 Payer par carte de crédit", "💳 Pay with Credit Card": "💳 Payer par carte de crédit",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -1712,4 +1712,5 @@ final Map<String, String> hi = {
"⚠️ You need to choose an amount!": "⚠️ आपको एक राशि चुनने की आवश्यकता है!", "⚠️ You need to choose an amount!": "⚠️ आपको एक राशि चुनने की आवश्यकता है!",
"💰 Pay with Wallet": "💰 वॉलेट से भुगतान करें", "💰 Pay with Wallet": "💰 वॉलेट से भुगतान करें",
"💳 Pay with Credit Card": "💳 क्रेडिट कार्ड से भुगतान करें", "💳 Pay with Credit Card": "💳 क्रेडिट कार्ड से भुगतान करें",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -1712,4 +1712,5 @@ final Map<String, String> it = {
"⚠️ You need to choose an amount!": "⚠️ Devi scegliere un importo!", "⚠️ You need to choose an amount!": "⚠️ Devi scegliere un importo!",
"💰 Pay with Wallet": "💰 Paga con portafoglio", "💰 Pay with Wallet": "💰 Paga con portafoglio",
"💳 Pay with Credit Card": "💳 Paga con carta di credito", "💳 Pay with Credit Card": "💳 Paga con carta di credito",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -1712,4 +1712,5 @@ final Map<String, String> ru = {
"⚠️ You need to choose an amount!": "⚠️ Выберите сумму!", "⚠️ You need to choose an amount!": "⚠️ Выберите сумму!",
"💰 Pay with Wallet": "💰 Оплата кошельком", "💰 Pay with Wallet": "💰 Оплата кошельком",
"💳 Pay with Credit Card": "💳 Оплата картой", "💳 Pay with Credit Card": "💳 Оплата картой",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -1712,4 +1712,5 @@ final Map<String, String> tr = {
"⚠️ You need to choose an amount!": "⚠️ Bir tutar seçmelisiniz!", "⚠️ You need to choose an amount!": "⚠️ Bir tutar seçmelisiniz!",
"💰 Pay with Wallet": "💰 Cüzdan ile Öde", "💰 Pay with Wallet": "💰 Cüzdan ile Öde",
"💳 Pay with Credit Card": "💳 Kredi Kartı ile Öde", "💳 Pay with Credit Card": "💳 Kredi Kartı ile Öde",
"service_unavailable_area": "This service is not currently available in your area",
}; };
@@ -32,5 +32,6 @@ class MyTranslation extends Translations {
"tr": tr, "tr": tr,
"ur": ur, "ur": ur,
"zh": zh, "zh": zh,
"service_unavailable_area": "This service is not currently available in your area",
}; };
} }
+1
View File
@@ -1712,4 +1712,5 @@ final Map<String, String> ur = {
"⚠️ You need to choose an amount!": "⚠️ آپ کو ایک رقم منتخب کرنے کی ضرورت ہے!", "⚠️ You need to choose an amount!": "⚠️ آپ کو ایک رقم منتخب کرنے کی ضرورت ہے!",
"💰 Pay with Wallet": "💰 والٹ سے ادائیگی کریں", "💰 Pay with Wallet": "💰 والٹ سے ادائیگی کریں",
"💳 Pay with Credit Card": "💳 کریڈٹ کارڈ سے ادائیگی کریں", "💳 Pay with Credit Card": "💳 کریڈٹ کارڈ سے ادائیگی کریں",
"service_unavailable_area": "This service is not currently available in your area",
}; };
+1
View File
@@ -1712,4 +1712,5 @@ final Map<String, String> zh = {
"⚠️ You need to choose an amount!": "⚠️ لازم تختار مبلغ!", "⚠️ You need to choose an amount!": "⚠️ لازم تختار مبلغ!",
"💰 Pay with Wallet": "💰 ادفع بالمحفظة", "💰 Pay with Wallet": "💰 ادفع بالمحفظة",
"💳 Pay with Credit Card": "💳 ادفع بالبطاقة", "💳 Pay with Credit Card": "💳 ادفع بالبطاقة",
"service_unavailable_area": "This service is not currently available in your area",
}; };