2026-04-03-pre map libra

This commit is contained in:
Hamza-Ayed
2026-04-04 00:12:33 +03:00
parent 0376a835ce
commit cbb1620874
70 changed files with 933 additions and 787 deletions

View File

@@ -65,9 +65,9 @@ class NotificationController extends GetxController {
print('✅ Notifications initialized with Action Buttons Support');
await _flutterLocalNotificationsPlugin.initialize(
initializationSettings,
onDidReceiveNotificationResponse: onDidReceiveNotificationResponse,
onDidReceiveBackgroundNotificationResponse: notificationTapBackground,
settings: initializationSettings,
);
// إنشاء قناة الأندرويد ذات الأهمية القصوى
@@ -183,10 +183,10 @@ class NotificationController extends GetxController {
// عرض الإشعار
await _flutterLocalNotificationsPlugin.show(
1001, // ID ثابت لاستبدال الإشعار القديم
title,
"$price - مسافة $formattedBigText", // نص مختصر يظهر في البار العلوي
details,
id: 1001, // ID ثابت لاستبدال الإشعار القديم
title: title,
body: "$price - مسافة $formattedBigText", // نص مختصر يظهر في البار العلوي
notificationDetails: details,
payload: jsonEncode({
'type': 'Order',
'data': myListString,
@@ -215,7 +215,7 @@ class NotificationController extends GetxController {
// أ) زر القبول
if (response.actionId == 'ACCEPT_ORDER') {
await _flutterLocalNotificationsPlugin.cancel(1001); // حذف الإشعار
await _flutterLocalNotificationsPlugin.cancel(id: 1001); // حذف الإشعار
_processAcceptOrder(listData);
}
@@ -227,7 +227,7 @@ class NotificationController extends GetxController {
// ج) زر الرفض
else if (response.actionId == 'REJECT_ORDER') {
await _flutterLocalNotificationsPlugin.cancel(1001); // حذف الإشعار
await _flutterLocalNotificationsPlugin.cancel(id: 1001); // حذف الإشعار
_processRejectOrder(listData);
}
@@ -428,7 +428,11 @@ class NotificationController extends GetxController {
NotificationDetails details =
NotificationDetails(android: android, iOS: ios);
await _flutterLocalNotificationsPlugin.show(0, title, message, details,
await _flutterLocalNotificationsPlugin.show(
id: 0,
title: title,
body: message,
notificationDetails: details,
payload: jsonEncode({'title': title, 'data': payLoad}));
}
@@ -490,7 +494,7 @@ class NotificationController extends GetxController {
// ==============================================================================
Future<void> cancelOrderNotification() async {
// 1001 هو نفس الآيدي الذي استخدمناه عند عرض الإشعار
await _flutterLocalNotificationsPlugin.cancel(1001);
await _flutterLocalNotificationsPlugin.cancel(id: 1001);
print("🗑️ Order Notification Cancelled (Taken by another driver)");
}
@@ -522,14 +526,12 @@ class NotificationController extends GetxController {
}
await _flutterLocalNotificationsPlugin.zonedSchedule(
notificationId,
title,
message,
scheduledDate,
details,
androidScheduleMode: AndroidScheduleMode.exact,
uiLocalNotificationDateInterpretation:
UILocalNotificationDateInterpretation.absoluteTime,
id: notificationId,
title: title,
body: message,
scheduledDate: scheduledDate,
notificationDetails: details,
androidScheduleMode: AndroidScheduleMode.exact, // أو exactAllowWhileIdle
matchDateTimeComponents: null,
);
}