Update: 2026-08-07 06:00:56
This commit is contained in:
@@ -25,6 +25,10 @@ class TripData {
|
||||
/// من نفسها — النافذة لا تُغلق، فالسائق يظل قادراً على القبول.
|
||||
final int offerExpiresIn;
|
||||
|
||||
/// رحلة محجوزة مسبقاً وموعدها. السائق يجب أن يعرف أنها ليست طلباً فورياً.
|
||||
final bool isScheduled;
|
||||
final String scheduledAt;
|
||||
|
||||
TripData({
|
||||
required this.tripId,
|
||||
required this.passengerName,
|
||||
@@ -38,6 +42,8 @@ class TripData {
|
||||
this.passengerAvatarUrl,
|
||||
this.offerType,
|
||||
this.offerExpiresIn = 0,
|
||||
this.isScheduled = false,
|
||||
this.scheduledAt = '',
|
||||
});
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
@@ -53,6 +59,8 @@ class TripData {
|
||||
'passengerAvatarUrl': passengerAvatarUrl ?? '',
|
||||
'offerType': offerType ?? '',
|
||||
'offerExpiresIn': offerExpiresIn,
|
||||
'isScheduled': isScheduled,
|
||||
'scheduledAt': scheduledAt,
|
||||
};
|
||||
|
||||
factory TripData.fromMap(Map<String, dynamic> map) => TripData(
|
||||
@@ -67,6 +75,8 @@ class TripData {
|
||||
? null
|
||||
: map['offerType'].toString(),
|
||||
offerExpiresIn: int.tryParse('${map['offerExpiresIn'] ?? 0}') ?? 0,
|
||||
isScheduled: map['isScheduled'] == true || '${map['isScheduled']}' == '1',
|
||||
scheduledAt: (map['scheduledAt'] ?? '').toString(),
|
||||
pickupLat: (map['pickupLat'] ?? 0.0).toDouble(),
|
||||
pickupLng: (map['pickupLng'] ?? 0.0).toDouble(),
|
||||
passengerAvatarUrl: map['passengerAvatarUrl'],
|
||||
|
||||
Reference in New Issue
Block a user