This commit is contained in:
Hamza-Ayed
2023-11-06 18:25:23 +03:00
parent 942fa97a31
commit 8238323dd3
18 changed files with 5817 additions and 326 deletions

View File

@@ -61,33 +61,33 @@ class TimerToPassengerFromDriver extends StatelessWidget {
)
],
),
controller.remainingTimeToPassengerFromDriverAfterApplied < 60
? MyElevatedButton(
title: 'If you in Car Now. Press Start The Ride'.tr,
onPressed: () async {
//todo start the trip and rest all counter ,start new counter of the trip time
await CRUD()
.post(link: AppLink.updateRides, payload: {
'id': controller.rideId,
'rideTimeStart': DateTime.now().toString(),
'status': 'Applied'
});
controller.driverArrivePassenger();
// Send notification to driver to alert him that trip is begin
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
'BeginTrip',
box.read(BoxName.name).toString(),
controller.driverToken.toString(),
);
print(controller.driverToken.toString());
// Get.defaultDialog(
// title: 'The Ride is Begin'.tr,
// backgroundColor: AppColor.greenColor,
// );
})
: const SizedBox()
// controller.remainingTimeToPassengerFromDriverAfterApplied < 60
// ? MyElevatedButton(
// title: 'If you in Car Now. Press Start The Ride'.tr,
// onPressed: () async {
// //todo start the trip and rest all counter ,start new counter of the trip time
//
// await CRUD()
// .post(link: AppLink.updateRides, payload: {
// 'id': controller.rideId,
// 'rideTimeStart': DateTime.now().toString(),
// 'status': 'Applied'
// });
// controller.driverArrivePassenger();
// // Send notification to driver to alert him that trip is begin
// FirebaseMessagesController()
// .sendNotificationToAnyWithoutData(
// 'BeginTrip',
// box.read(BoxName.name).toString(),
// controller.driverToken.toString(),
// );
// print(controller.driverToken.toString());
// // Get.defaultDialog(
// // title: 'The Ride is Begin'.tr,
// // backgroundColor: AppColor.greenColor,
// // );
// })
// : const SizedBox()
],
),
),