Update: 2026-08-07 06:00:56

This commit is contained in:
Hamza-Ayed
2026-08-07 06:00:56 +03:00
parent 67465df000
commit 92a6aa5c0f
11 changed files with 443 additions and 15 deletions
@@ -65,7 +65,7 @@ class OrderRequestController extends GetxController
};
}
/// معلومات الحجز المسبق إن كانت الرحلة مؤجلة.
/// معلومات الحجز المسبق إن كانت الرحلة مجدولة.
///
/// يصل الحقلان من buildMarketPayload عبر السوكِت (خريطة)، أو من الفهرسين
/// 39/40 عبر FCM (قائمة). _getValueAt يوحّد الشكلين.
@@ -35,9 +35,17 @@ class OrderData {
/// ثواني السبق الحصري كما حددها الخادم (DISPATCH_HEAD_START_SECONDS).
final int offerExpiresIn;
/// رحلة محجوزة مسبقاً — موعد مضبوط لا طلب فوري.
final bool isScheduled;
/// موعد الانطلاق كما حجزه الراكب. فارغ في الرحلات العادية.
final String scheduledAt;
OrderData({
this.offerType,
this.offerExpiresIn = 0,
this.isScheduled = false,
this.scheduledAt = '',
required this.customerName,
required this.customerToken,
required this.tripDistanceKm,
@@ -151,6 +159,11 @@ class OrderData {
: null,
offerExpiresIn:
list.length > 38 ? (int.tryParse(list[38].toString()) ?? 0) : 0,
// ‏الفهرسان 39/40 — يضيفهما add_ride.php للرحلات المحجوزة.
isScheduled: list.length > 39 &&
(list[39].toString() == '1' || list[39].toString() == 'true'),
scheduledAt: list.length > 40 ? list[40].toString() : '',
);
}
@@ -197,6 +210,8 @@ class OrderData {
: null,
offerType: str('offer_type').isNotEmpty ? str('offer_type') : null,
offerExpiresIn: int.tryParse(str('offer_expires_in', '0')) ?? 0,
isScheduled: str('is_scheduled') == '1' || str('is_scheduled') == 'true',
scheduledAt: str('scheduled_at'),
);
}
@@ -475,21 +475,36 @@ class _OrderOverlayState extends State<OrderOverlay>
Row(
children: [
Icon(
isExclusive ? Icons.star_rounded : Icons.drive_eta_rounded,
color: isExclusive ? const Color(0xFFFFD54F) : AppColors.white,
orderData?.isScheduled == true
? Icons.schedule
: isExclusive
? Icons.star_rounded
: Icons.drive_eta_rounded,
color: orderData?.isScheduled == true
? const Color(0xFFB39DDB)
: isExclusive
? const Color(0xFFFFD54F)
: AppColors.white,
size: 24,
),
const SizedBox(width: 8),
// ‏العنوان يحمل حالة العرض: خاص خلال السبق، عام بعده، و"طلب
// ‏جديد" في البثّ الحر حيث لا معنى للتمييز.
Text(
orderData?.offerType == null
? "طلب جديد".tr
: (isExclusive ? "⭐ طلب خاص لك".tr : "🌐 طلب عام".tr),
orderData?.isScheduled == true
// ‏الأولوية للمجدولة: معلومة دائمة عن الرحلة تسبق حالة
// ‏العرض المؤقتة، والسائق يحتاجها ليقرر إن كان يستطيع
// ‏الالتزام بالموعد.
? "🗓️ رحلة مجدولة".tr
: orderData?.offerType == null
? "طلب جديد".tr
: (isExclusive ? "⭐ طلب خاص لك".tr : "🌐 طلب عام".tr),
style: TextStyle(
color: isExclusive
? const Color(0xFFFFD54F)
: AppColors.white,
color: orderData?.isScheduled == true
? const Color(0xFFB39DDB)
: isExclusive
? const Color(0xFFFFD54F)
: AppColors.white,
fontSize: 18,
fontWeight: FontWeight.w600),
),
@@ -116,7 +116,7 @@ class OrderRequestPage extends StatelessWidget {
OfferTypeBadge(rideInfo: controller.offerInfo!),
const SizedBox(width: 10),
],
// شارة الرحلة المؤجلة — موعد مضبوط لا طلب فوري
// شارة الرحلة المجدولة — موعد مضبوط لا طلب فوري
if (ScheduledRideBadge.isScheduled(
controller.scheduleInfo)) ...[
ScheduledRideBadge(
@@ -189,7 +189,7 @@ class RideAvailableCard extends StatelessWidget {
.copyWith(color: AppColor.greenColor, fontSize: 13),
),
),
// شارة الرحلة المؤجلة — معلومة دائمة عن الرحلة، تظهر هنا
// شارة الرحلة المجدولة — معلومة دائمة عن الرحلة، تظهر هنا
// وفي نافذة الطلب والأوفرلي معاً.
if (ScheduledRideBadge.isScheduled(rideInfo)) ...[
const SizedBox(height: 8),
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
/// شارة «رحلة مؤجلة».
/// شارة «رحلة مجدولة».
///
/// السائق يجب أن يعرف أن هذه ليست رحلة لحظية بل موعد مضبوط: الراكب
/// ينتظره في وقت محدد، والتأخر عليه يختلف عن التأخر على طلب فوري.
@@ -73,7 +73,7 @@ class ScheduledRideBadge extends StatelessWidget {
Icon(Icons.schedule, color: color, size: compact ? 14 : 16),
const SizedBox(width: 4),
Text(
t.isEmpty ? 'رحلة مؤجلة'.tr : '${'رحلة مؤجلة'.tr} · $t',
t.isEmpty ? 'رحلة مجدولة'.tr : '${'رحلة مجدولة'.tr} · $t',
style: TextStyle(
color: color,
fontSize: compact ? 11 : 13,