25-10-5/1

This commit is contained in:
Hamza-Ayed
2025-10-08 13:14:07 +03:00
parent 1cc66029a3
commit 482c1296bc
22 changed files with 770 additions and 559 deletions

View File

@@ -9,7 +9,9 @@ import 'package:sefer_driver/views/widgets/elevated_btn.dart';
import '../../../../constant/box_name.dart';
import '../../../../constant/style.dart';
import '../../../../controller/firebase/notification_service.dart';
import '../../../../main.dart';
import '../../../../print.dart';
// Changed: إعادة تصميم كاملة لتصبح شريط معلومات علوي مدمج
class PassengerInfoWindow extends StatelessWidget {
@@ -154,12 +156,23 @@ class PassengerInfoWindow extends StatelessWidget {
if (await controller
.calculateDistanceBetweenDriverAndPassengerLocation() <
140) {
fcm.sendNotificationToDriverMAP(
'Hi ,I Arrive your site',
'I Arrive at your site'.tr,
controller.tokenPassenger,
[],
'ding.wav',
// fcm.sendNotificationToDriverMAP(
// 'Hi ,I Arrive your site',
// 'I Arrive at your site'.tr,
// controller.tokenPassenger,
// [],
// 'ding.wav',
// );
Log.print(
'controller.tokenPassenger: ${controller.tokenPassenger}');
NotificationService.sendNotification(
target: controller.tokenPassenger.toString(),
title: 'Hi ,I Arrive your site'.tr,
body: 'I Arrive at your site'.tr,
isTopic: false, // Important: this is a token
tone: 'ding',
driverList: [],
);
controller.startTimerToShowDriverWaitPassengerDuration();
controller.isArrivedSend = false;
@@ -239,13 +252,22 @@ class PassengerInfoWindow extends StatelessWidget {
kolor: AppColor.deepPurpleAccent,
onPressed: () {
MyDialog().getDialog('Are you sure to cancel?'.tr, '', () async {
fcm.sendNotificationToDriverMAP(
'Driver Cancelled Your Trip',
'You will need to pay the cost to the driver, or it will be deducted from your next trip'
.tr,
controller.tokenPassenger,
[],
'cancel.wav');
// fcm.sendNotificationToDriverMAP(
// 'Driver Cancelled Your Trip',
// 'You will need to pay the cost to the driver, or it will be deducted from your next trip'
// .tr,
// controller.tokenPassenger,
// [],
// 'cancel.wav');
NotificationService.sendNotification(
target: controller.tokenPassenger.toString(),
title: 'Driver Cancelled Your Trip',
body:
'You will need to pay the cost to the driver, or it will be deducted from your next trip',
isTopic: false, // Important: this is a token
tone: 'cancel',
driverList: [],
);
box.write(BoxName.rideStatus, 'Cancel');
await controller.addWaitingTimeCostFromPassengerToDriverWallet();
controller.isdriverWaitTimeEnd = false;