This commit is contained in:
Hamza-Ayed
2023-10-03 16:00:33 +03:00
parent ca59d9e3b7
commit edc3a4348d
12 changed files with 238 additions and 105 deletions

View File

@@ -67,37 +67,27 @@ class TimerToPassengerFromDriver extends StatelessWidget {
? MyElevatedButton(
title: 'If you in Car Now. Press Start The Ride',
onPressed: () async {
MapController mapController =
Get.find<MapController>();
final firebasMessagesController =
Get.put(FirebasMessagesController());
//todo start the trip and rest all counter ,start new counter of the trip time
await CRUD()
.post(link: AppLink.updateRides, payload: {
'id': mapController.rideId,
'id': controller.rideId,
'rideTimeStart': DateTime.now().toString(),
'status': 'Applied'
});
mapController.driverArrivePassenger();
controller.driverArrivePassenger();
// Send notification to driver to alert him that trip is begin
firebasMessagesController
FirebaseMessagesController()
.sendNotificationToDriverId(
'Ride Begin',
'BeginTrip',
box.read(BoxName.name).toString(),
mapController
.dataCarsLocationByPassenger['message'][0]
['token']
.toString(),
);
print(mapController
.dataCarsLocationByPassenger['message'][0]
['token']
.toString());
Get.snackbar(
'The Ride is Begin'.tr,
'',
backgroundColor: AppColor.greenColor,
controller.driverToken.toString(),
);
print(controller.driverToken.toString());
// Get.defaultDialog(
// title: 'The Ride is Begin'.tr,
// backgroundColor: AppColor.greenColor,
// );
})
: const SizedBox()
],