Update: 2026-07-06 03:45:17

This commit is contained in:
Hamza-Ayed
2026-07-06 03:45:17 +03:00
parent 63440b07dc
commit ff49586d6d
2 changed files with 10 additions and 28 deletions
+1 -20
View File
@@ -8,10 +8,7 @@ $country = filterRequest('country') ?: filterRequest('country_code');
$distance = (float)(filterRequest('distance') ?: 0);
$siroPrice = (float)(filterRequest('siro_price') ?: 0);
file_put_contents('/tmp/competitor_debug.log', date('Y-m-d H:i:s') . " - Payload: lat=$lat, lng=$lng, country=$country, dist=$distance, price=$siroPrice\n", FILE_APPEND);
if (!$lat || !$lng || !$country) {
file_put_contents('/tmp/competitor_debug.log', date('Y-m-d H:i:s') . " - Error: Missing params\n", FILE_APPEND);
echo json_encode(["status" => "error", "message" => "Missing parameters"]);
exit;
}
@@ -86,23 +83,7 @@ if ($competitorTotalPrice > 0 && $siroPrice < $competitorTotalPrice) {
}
// Format the labels
$compNameAr = match(strtolower($topComp)) {
'careem' => 'كريم',
'uber' => 'أوبر',
'yallago' => 'يلا غو',
'jenny' => 'جيني',
'taxif' => 'تكسي إف',
'com.taxif.passenger' => 'تكسي إف',
'indrive' => 'إن درايف',
'yango' => 'يانغو',
'petra' => 'بترا رايد',
'petra ride' => 'بترا رايد',
'gojo' => 'جو جو',
'didi' => 'ديدي',
'zakin' => 'زاكن',
'tofaddal'=> 'تفضل',
default => $topComp
};
$compNameAr = 'التطبيقات الأخرى';
$savingsLabel = "أوفر بـ " . number_format($savingsPct, 1) . "% من $compNameAr ⚡";
@@ -138,7 +138,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
// ── Car Selection List ───────────────────────────────
SizedBox(
height: 134,
height: 115,
child: ListView.builder(
physics: const BouncingScrollPhysics(),
scrollDirection: Axis.horizontal,
@@ -161,9 +161,10 @@ class CarDetailsTypeToChoose extends StatelessWidget {
if (controller.savingsLabel != null &&
controller.savingsLabel!.isNotEmpty)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 4),
padding: const EdgeInsets.symmetric(
horizontal: 20, vertical: 4),
child: CompetitorPriceBadge(
badgeText: controller.savingsLabel,
savingsLabel: controller.savingsLabel,
savingsPercent: controller.savingsPercent ?? 0.0,
),
),
@@ -315,7 +316,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
child: AnimatedContainer(
duration: const Duration(milliseconds: 300),
curve: Curves.easeOutCubic,
width: 122,
width: 105,
decoration: BoxDecoration(
gradient: isSelected
? LinearGradient(
@@ -386,7 +387,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
duration: const Duration(milliseconds: 300),
child: Image.asset(
carType.image,
height: 54,
height: 44,
fit: BoxFit.contain,
),
),
@@ -429,8 +430,8 @@ class CarDetailsTypeToChoose extends StatelessWidget {
child: Text(
'${_getPassengerPriceText(carType, controller)} ${CurrencyHelper.currency}',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w700,
fontSize: 14.5,
fontWeight: FontWeight.w800,
color: isSelected
? Colors.white
: AppColor.writeColor.withOpacity(0.8),