2026-04-03-pre map libra
This commit is contained in:
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user