Food: single-source tracking, mode exclusivity, in-app navigation
This commit is contained in:
@@ -98,6 +98,25 @@ class FoodDeliveryService {
|
||||
return FoodDeliveryApiResult(false, null, _errMsg(res));
|
||||
}
|
||||
|
||||
/// بثّ موقع السائق للزبون أثناء المهمة. الخادم يرفضه بعد التسليم،
|
||||
/// وينتهي آخر موقع من Redis تلقائياً — لا تتبّع خارج نافذة العمل.
|
||||
static Future<void> sendLocation({
|
||||
required int orderId,
|
||||
required double lat,
|
||||
required double lng,
|
||||
double? heading,
|
||||
}) async {
|
||||
await CRUD().post(
|
||||
link: '$_base/courier/location.php',
|
||||
payload: {
|
||||
'order_id': orderId.toString(),
|
||||
'lat': lat.toString(),
|
||||
'lng': lng.toString(),
|
||||
if (heading != null) 'heading': heading.toStringAsFixed(0),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
static Future<FoodDeliveryApiResult<void>> markPickedUp(int orderId) async {
|
||||
final res = await CRUD().post(
|
||||
link: '$_base/courier/picked_up.php',
|
||||
|
||||
Reference in New Issue
Block a user