25-10-5/1
This commit is contained in:
@@ -8,6 +8,7 @@ import '../../../../constant/box_name.dart';
|
||||
import '../../../../constant/links.dart';
|
||||
import '../../../../controller/firebase/firbase_messge.dart';
|
||||
import '../../../../controller/firebase/local_notification.dart';
|
||||
import '../../../../controller/firebase/notification_service.dart';
|
||||
import '../../../../controller/functions/crud.dart';
|
||||
import '../../../../main.dart';
|
||||
import '../../../../models/model/order_data.dart';
|
||||
@@ -228,12 +229,20 @@ class _OrderOverlayState extends State<OrderOverlay>
|
||||
? Get.find<FirebaseMessagesController>()
|
||||
: Get.put(FirebaseMessagesController());
|
||||
|
||||
fmc.sendNotificationToDriverMAP(
|
||||
"Accepted Ride",
|
||||
'your ride is Accepted'.tr,
|
||||
_getData(9).toString(),
|
||||
bodyToPassenger,
|
||||
'start.wav',
|
||||
// fmc.sendNotificationToDriverMAP(
|
||||
// "Accepted Ride",
|
||||
// 'your ride is Accepted'.tr,
|
||||
// _getData(9).toString(),
|
||||
// bodyToPassenger,
|
||||
// 'start.wav',
|
||||
// );
|
||||
NotificationService.sendNotification(
|
||||
target: _getData(9).toString(),
|
||||
title: "Accepted Ride",
|
||||
body: 'your ride is Accepted'.tr,
|
||||
isTopic: false, // Important: this is a token
|
||||
tone: 'start',
|
||||
driverList: [],
|
||||
);
|
||||
final payload = {
|
||||
// بيانات أساسية
|
||||
|
||||
@@ -13,10 +13,12 @@ import 'dart:math' as math;
|
||||
import '../../../../constant/colors.dart';
|
||||
import '../../../../constant/links.dart';
|
||||
import '../../../../constant/style.dart';
|
||||
import '../../../../controller/firebase/notification_service.dart';
|
||||
import '../../../../controller/functions/crud.dart';
|
||||
import '../../../../controller/functions/encrypt_decrypt.dart';
|
||||
import '../../../../controller/functions/launch.dart';
|
||||
import '../../../../controller/home/captin/order_request_controller.dart';
|
||||
import '../../../../print.dart';
|
||||
import '../../../widgets/elevated_btn.dart';
|
||||
|
||||
class OrderRequestPage extends StatefulWidget {
|
||||
@@ -279,12 +281,20 @@ class _OrderRequestPageState extends State<OrderRequestPage> {
|
||||
? Get.find<FirebaseMessagesController>()
|
||||
: Get.put(FirebaseMessagesController());
|
||||
|
||||
fmc.sendNotificationToDriverMAP(
|
||||
"Accepted Ride",
|
||||
'your ride is Accepted'.tr,
|
||||
controller.myList[9].toString(),
|
||||
bodyToPassenger,
|
||||
'start.wav',
|
||||
// fmc.sendNotificationToDriverMAP(
|
||||
// "Accepted Ride",
|
||||
// 'your ride is Accepted'.tr,
|
||||
// controller.myList[9].toString(),
|
||||
// bodyToPassenger,
|
||||
// 'start',
|
||||
// );
|
||||
NotificationService.sendNotification(
|
||||
target: controller.myList[9].toString(),
|
||||
title: "Accepted Ride",
|
||||
body: 'your ride is Accepted'.tr,
|
||||
isTopic: false, // Important: this is a token
|
||||
tone: 'start',
|
||||
driverList: [],
|
||||
);
|
||||
Get.back();
|
||||
box.write(BoxName.rideArguments, {
|
||||
@@ -338,6 +348,8 @@ class _OrderRequestPageState extends State<OrderRequestPage> {
|
||||
});
|
||||
Get.to(() => PassengerLocationMapPage(),
|
||||
arguments: box.read(BoxName.rideArguments));
|
||||
Log.print(
|
||||
'box.read(BoxName.rideArguments): ${box.read(BoxName.rideArguments)}');
|
||||
}
|
||||
},
|
||||
),
|
||||
@@ -372,13 +384,22 @@ class _OrderRequestPageState extends State<OrderRequestPage> {
|
||||
box.read(BoxName.tokenDriver).toString(),
|
||||
];
|
||||
|
||||
FirebaseMessagesController()
|
||||
.sendNotificationToPassengerToken(
|
||||
'Order Under Review'.tr,
|
||||
'${box.read(BoxName.nameDriver)} ${'is reviewing your order. They may need more information or a higher price.'.tr}',
|
||||
controller.myList[9].toString(),
|
||||
bodyToPassenger,
|
||||
'notification.wav');
|
||||
// FirebaseMessagesController()
|
||||
// .sendNotificationToPassengerToken(
|
||||
// 'Order Under Review'.tr,
|
||||
// '${box.read(BoxName.nameDriver)} ${'is reviewing your order. They may need more information or a higher price.'.tr}',
|
||||
// controller.myList[9].toString(),
|
||||
// bodyToPassenger,
|
||||
// 'notification');
|
||||
NotificationService.sendNotification(
|
||||
target: controller.myList[9].toString(),
|
||||
title: 'Order Under Review'.tr,
|
||||
body:
|
||||
'${box.read(BoxName.nameDriver)} ${'is reviewing your order. They may need more information or a higher price.'.tr}',
|
||||
isTopic: false, // Important: this is a token
|
||||
tone: 'start',
|
||||
driverList: [],
|
||||
);
|
||||
|
||||
controller.refuseOrder(
|
||||
EncryptionHelper.instance.encryptData(
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import '../../../../constant/colors.dart'; // Your AppColor
|
||||
import '../../../../constant/links.dart'; // Your AppLink
|
||||
import '../../../../constant/style.dart'; // Your AppStyle
|
||||
import '../../../../controller/firebase/notification_service.dart';
|
||||
import '../../../../controller/functions/crud.dart';
|
||||
import '../../../../controller/functions/launch.dart';
|
||||
import '../../../../controller/home/captin/order_request_controller.dart';
|
||||
@@ -385,16 +386,28 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
box.read(BoxName.tokenDriver).toString(),
|
||||
rideId.toString(),
|
||||
];
|
||||
Get.put(FirebaseMessagesController())
|
||||
.sendNotificationToDriverMAP(
|
||||
'Accepted Ride',
|
||||
'your ride is applied'.tr,
|
||||
controller.arguments?['DriverList']
|
||||
?[9]
|
||||
?.toString() ??
|
||||
_getData(9), // Safer access
|
||||
bodyToPassenger,
|
||||
'start.wav');
|
||||
// Get.put(FirebaseMessagesController())
|
||||
// .sendNotificationToDriverMAP(
|
||||
// 'Accepted Ride',
|
||||
// 'your ride is applied'.tr,
|
||||
// controller.arguments?['DriverList']
|
||||
// ?[9]
|
||||
// ?.toString() ??
|
||||
// _getData(9), // Safer access
|
||||
// bodyToPassenger,
|
||||
// 'start.wav');
|
||||
NotificationService.sendNotification(
|
||||
target: controller.arguments?['DriverList']
|
||||
?[9]
|
||||
?.toString() ??
|
||||
_getData(9),
|
||||
title: 'Accepted Ride',
|
||||
body: 'your ride is applied'.tr,
|
||||
isTopic:
|
||||
false, // Important: this is a token
|
||||
tone: 'start',
|
||||
driverList: [],
|
||||
);
|
||||
|
||||
// Using rideId (_getData(16)) for order_id consistently
|
||||
CRUD().postFromDialogue(
|
||||
|
||||
Reference in New Issue
Block a user