25-10-5/1
This commit is contained in:
@@ -201,6 +201,7 @@ import '../../../../constant/box_name.dart';
|
||||
import '../../../../constant/colors.dart';
|
||||
import '../../../../constant/style.dart';
|
||||
import '../../../../controller/firebase/firbase_messge.dart';
|
||||
import '../../../../controller/firebase/notification_service.dart';
|
||||
import '../../../../controller/functions/launch.dart';
|
||||
import '../../../../controller/home/captin/map_driver_controller.dart';
|
||||
import '../../../../main.dart';
|
||||
@@ -339,23 +340,39 @@ class SosConnect extends StatelessWidget {
|
||||
_buildMessageTile(
|
||||
text: "Where are you, sir?".tr,
|
||||
onTap: () {
|
||||
fcm.sendNotificationToDriverMAP(
|
||||
'message From Driver',
|
||||
"Where are you, sir?".tr,
|
||||
controller.tokenPassenger,
|
||||
[],
|
||||
'ding.wav');
|
||||
// fcm.sendNotificationToDriverMAP(
|
||||
// 'message From Driver',
|
||||
// "Where are you, sir?".tr,
|
||||
// controller.tokenPassenger,
|
||||
// [],
|
||||
// 'ding');
|
||||
NotificationService.sendNotification(
|
||||
target: controller.tokenPassenger.toString(),
|
||||
title: 'message From Driver'.tr,
|
||||
body: "Where are you, sir?".tr,
|
||||
isTopic: false, // Important: this is a token
|
||||
tone: 'ding',
|
||||
driverList: [],
|
||||
);
|
||||
Get.back();
|
||||
}),
|
||||
_buildMessageTile(
|
||||
text: "I've been trying to reach you but your phone is off.".tr,
|
||||
onTap: () {
|
||||
fcm.sendNotificationToDriverMAP(
|
||||
'message From Driver',
|
||||
"I've been trying to reach you but your phone is off.".tr,
|
||||
controller.tokenPassenger,
|
||||
[],
|
||||
'ding.wav');
|
||||
// fcm.sendNotificationToDriverMAP(
|
||||
// 'message From Driver',
|
||||
// "I've been trying to reach you but your phone is off.".tr,
|
||||
// controller.tokenPassenger,
|
||||
// [],
|
||||
// 'ding');
|
||||
NotificationService.sendNotification(
|
||||
target: controller.tokenPassenger.toString(),
|
||||
title: 'message From Driver'.tr,
|
||||
body: "I've been trying to reach you but your phone is off.".tr,
|
||||
isTopic: false, // Important: this is a token
|
||||
tone: 'ding',
|
||||
driverList: [],
|
||||
);
|
||||
Get.back();
|
||||
}),
|
||||
const SizedBox(height: 16),
|
||||
@@ -374,12 +391,20 @@ class SosConnect extends StatelessWidget {
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
fcm.sendNotificationToDriverMAP(
|
||||
'message From Driver',
|
||||
controller.messageToPassenger.text,
|
||||
controller.tokenPassenger,
|
||||
[],
|
||||
'ding.wav');
|
||||
// fcm.sendNotificationToDriverMAP(
|
||||
// 'message From Driver',
|
||||
// controller.messageToPassenger.text,
|
||||
// controller.tokenPassenger,
|
||||
// [],
|
||||
// 'ding');
|
||||
NotificationService.sendNotification(
|
||||
target: controller.tokenPassenger.toString(),
|
||||
title: 'message From Driver'.tr,
|
||||
body: 'change device'.tr,
|
||||
isTopic: false, // Important: this is a token
|
||||
tone: 'cancel',
|
||||
driverList: [],
|
||||
);
|
||||
controller.messageToPassenger.clear();
|
||||
Get.back();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user