Fixes & Updates - 2026-06-01: Integrate Back-End v3 updates, fix call/connection issues across apps
This commit is contained in:
@@ -104,6 +104,7 @@ class NotificationController extends GetxController {
|
||||
String endLoc = _getVal(data, 30);
|
||||
String paxName = _getVal(data, 8);
|
||||
// String rating = _getVal(data, 33);
|
||||
String isHaveSteps = _getVal(data, 20);
|
||||
|
||||
// تنسيق النص ليكون 4 أسطر واضحة
|
||||
formattedBigText = "👤 $paxName\n"
|
||||
@@ -111,6 +112,10 @@ class NotificationController extends GetxController {
|
||||
"🟢 من: $startLoc\n"
|
||||
"🏁 إلى: $endLoc";
|
||||
|
||||
if (isHaveSteps == 'true') {
|
||||
formattedBigText += "\n🛑 هذه الرحلة تحتوي على نقاط توقف!";
|
||||
}
|
||||
|
||||
summaryText = 'سعر الرحلة: $price';
|
||||
} catch (e) {
|
||||
print("Error formatting notification text: $e");
|
||||
@@ -181,11 +186,16 @@ class NotificationController extends GetxController {
|
||||
final details =
|
||||
NotificationDetails(android: androidDetails, iOS: iosDetails);
|
||||
|
||||
String briefBody = "$price - مسافة $formattedBigText";
|
||||
if (_getVal(jsonDecode(myListString), 20) == 'true') {
|
||||
briefBody = "🛑 (متعددة التوقفات) $price - مسافة $formattedBigText";
|
||||
}
|
||||
|
||||
// عرض الإشعار
|
||||
await _flutterLocalNotificationsPlugin.show(
|
||||
id: 1001, // ID ثابت لاستبدال الإشعار القديم
|
||||
title: title,
|
||||
body: "$price - مسافة $formattedBigText", // نص مختصر يظهر في البار العلوي
|
||||
body: briefBody, // نص مختصر يظهر في البار العلوي
|
||||
notificationDetails: details,
|
||||
payload: jsonEncode({
|
||||
'type': 'Order',
|
||||
@@ -298,7 +308,7 @@ class NotificationController extends GetxController {
|
||||
// حماية من الكراش: التأكد من وجود HomeCaptainController
|
||||
if (!Get.isRegistered<HomeCaptainController>()) {
|
||||
print("♻️ Reviving HomeCaptainController...");
|
||||
Get.put(HomeCaptainController());
|
||||
Get.put(HomeCaptainController(), permanent: true);
|
||||
} else {
|
||||
Get.find<HomeCaptainController>().changeRideId();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user