This commit is contained in:
Hamza-Ayed
2024-03-22 00:03:46 +03:00
parent 045f7e20f0
commit 5c702e7d06
8 changed files with 71 additions and 84 deletions

View File

@@ -243,6 +243,12 @@ class FirebaseMessagesController extends GetxController {
// 'PolylineJson': myPoints, // 'PolylineJson': myPoints,
'body': message.notification!.body 'body': message.notification!.body
}); });
} else if (message.notification!.title! == 'Order Applied') {
NotificationController().showNotification(
'The order Accepted by another Driver'.tr,
'We regret to inform you that another driver has accepted this order.'
.tr,
'order');
} }
} }

View File

@@ -650,8 +650,16 @@ update ui for totla results
// Add a new marker with the ID `MyLocation` at the current location of the user. // Add a new marker with the ID `MyLocation` at the current location of the user.
LocationController locationController = Get.find<LocationController>(); LocationController locationController = Get.find<LocationController>();
myLocation = locationController.myLocation; myLocation = locationController.myLocation;
final previousLocationOfDrivers = await sql.getCustomQuery( final previousLocationOfDrivers = await sql.getCustomQuery('''SELECT
'Select * from ${TableName.carLocations} where order_id =$rideId Order by created_at DESC limit 1'); *
FROM
${TableName.carLocations}
WHERE
order_id = $rideId
ORDER BY
created_at DESC
LIMIT
1''');
//get from sql //get from sql
if (previousLocationOfDrivers.isNotEmpty) { if (previousLocationOfDrivers.isNotEmpty) {

View File

@@ -924,20 +924,8 @@ class MapPassengerController extends GetxController {
} }
delayAndFetchRideStatus(rideId); delayAndFetchRideStatus(rideId);
// if (shouldFetch == false) {
// startTimer();
// update();
// }
update(); update();
// } else {
// Get.defaultDialog(
// title: 'No Car or Driver Found in your area.'.tr,
// titleStyle: AppStyle.title,
// middleText: 'Please Try anther time '.tr,
// middleTextStyle: AppStyle.title.copyWith(color: AppColor.yellowColor),
// confirm:
// MyElevatedButton(title: 'Ok'.tr, onPressed: () => Get.back()));
// }
} }
String statusRide = 'wait'; String statusRide = 'wait';
@@ -949,8 +937,8 @@ class MapPassengerController extends GetxController {
.get(link: AppLink.getRideStatus, payload: {'id': rideId}); .get(link: AppLink.getRideStatus, payload: {'id': rideId});
print(res); print(res);
var decod = jsonDecode(res); var decod = jsonDecode(res);
print(' 0000000000000000000000000000000000000000000000000'); // print(' 0000000000000000000000000000000000000000000000000');
print(decod['data']); // print(decod['data']);
if (decod['data'].toString() == 'Apply') { if (decod['data'].toString() == 'Apply') {
getUpdatedRideForDriverApply(rideId); getUpdatedRideForDriverApply(rideId);
shouldFetch = false; // Stop further fetches shouldFetch = false; // Stop further fetches
@@ -965,37 +953,12 @@ class MapPassengerController extends GetxController {
confirmRideForAllDriverAvailable(); confirmRideForAllDriverAvailable();
isDriversTokensSend = true; isDriversTokensSend = true;
} }
// else{
// j
// }
// else {
// Get.defaultDialog(
// barrierDismissible: false,
// title: 'There no Driver Aplly your order sorry for that '.tr,
// // middleText: 'try next time .'.tr,
// content: IconButton(
// onPressed: () {
// textToSpeechController.speakText(
// 'There no Driver Aplly your order sorry for that '.tr);
// },
// icon: const Icon(
// Icons.headphones,
// size: 40,
// ),
// ),
// titleStyle: AppStyle.title,
// confirm: MyElevatedButton(
// title: 'Back',
// onPressed: () => Get.offAll(const MapPagePassenger()),
// ));
// cancelRideAfterRejectFromAll();
// }
} else {
delayAndFetchRideStatus(
rideId); // Repeat the delay and fetch operation
update();
} }
// else if (isDriversTokensSend == false) {
// delayAndFetchRideStatus(
// rideId); // Repeat the delay and fetch operation
// update();
// }
} }
}); });
} }

View File

@@ -386,6 +386,8 @@ class MyTranslation extends Translations {
'Total price from ': 'المبلغ المطلوب من ', 'Total price from ': 'المبلغ المطلوب من ',
'Order Details Speed': 'طلب سريع', 'Order Details Speed': 'طلب سريع',
'Order Applied': "نفذ الطلب", 'Order Applied': "نفذ الطلب",
'We regret to inform you that another driver has accepted this order.':
'نأسف لإبلاغك بأن سائقًا آخر قد قبل هذا الطلب',
"The order has been accepted by another driver.": "The order has been accepted by another driver.":
'الطلب اتاخد من سواق تاني.', 'الطلب اتاخد من سواق تاني.',
"Be more mindful next time to avoid dropping orders.": "Be more mindful next time to avoid dropping orders.":

View File

@@ -49,10 +49,10 @@ class CustomSliderOnBoarding extends GetView<OnBoardingControllerImp> {
Image.asset( Image.asset(
onBoardingList[i].image!, onBoardingList[i].image!,
// width: , // width: ,
height: Get.width / 1.3, height: Get.width / 2,
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
const SizedBox(height: 60), const SizedBox(height: 20),
Text(onBoardingList[i].title!, Text(onBoardingList[i].title!,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: const TextStyle( style: const TextStyle(

View File

@@ -27,35 +27,35 @@ class RatePassenger extends StatelessWidget {
decoration: AppStyle.boxDecoration, decoration: AppStyle.boxDecoration,
child: Column( child: Column(
children: [ children: [
Padding( // Padding(
padding: const EdgeInsets.all(4), // padding: const EdgeInsets.all(4),
child: Container( // child: Container(
height: Get.height * .25, // height: Get.height * .25,
decoration: AppStyle.boxDecoration1, // decoration: AppStyle.boxDecoration1,
child: Column( // child: Column(
children: [ // children: [
Text( // Text(
'${'Total price from '.tr}${Get.find<MapDriverController>().passengerName}', // '${'Total price from '.tr}${Get.find<MapDriverController>().passengerName}',
style: AppStyle.title, // style: AppStyle.title,
), // ),
Container( // Container(
decoration: BoxDecoration( // decoration: BoxDecoration(
border: Border.all( // border: Border.all(
width: 2, // width: 2,
color: AppColor.greenColor, // color: AppColor.greenColor,
)), // )),
child: Padding( // child: Padding(
padding: const EdgeInsets.all(4), // padding: const EdgeInsets.all(4),
child: Text( // child: Text(
Get.find<MapDriverController>() // Get.find<MapDriverController>()
.totalPassenger, // .totalPassenger,
style: AppStyle.number, // style: AppStyle.number,
), // ),
), // ),
), // ),
], // ],
)), // )),
), // ),
Center( Center(
child: RatingBar.builder( child: RatingBar.builder(
initialRating: 0, initialRating: 0,

View File

@@ -18,7 +18,7 @@ GetBuilder<MapDriverController> driverEndRideBar() {
height: mapDriverController.remainingTimeTimerRideBegin < 60 height: mapDriverController.remainingTimeTimerRideBegin < 60
? mapDriverController.driverEndPage = 160 ? mapDriverController.driverEndPage = 160
: 100, : 100,
width: 200, width: 240,
child: Column( child: Column(
children: [ children: [
Row( Row(
@@ -53,6 +53,14 @@ GetBuilder<MapDriverController> driverEndRideBar() {
), ),
], ],
), ),
Row(
children: [
Text(mapDriverController.recentAngelToMarker
.toStringAsFixed(0)),
Text(mapDriverController.recentDistanceToDash
.toStringAsFixed(0))
],
),
mapDriverController.remainingTimeTimerRideBegin < 60 mapDriverController.remainingTimeTimerRideBegin < 60
? Row( ? Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,

View File

@@ -320,15 +320,15 @@ class CountryPicker extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GetBuilder<ProfileController>(builder: (controller) { return GetBuilder<ProfileController>(builder: (controller) {
return Column( return ListView(
children: [ children: [
const SizedBox( const SizedBox(
height: 20, height: 20,
), ),
Text("Select Your Country".tr), Text("Select Your Country".tr),
const SizedBox( // const SizedBox(
height: 20, // height: 20,
), // ),
Padding( Padding(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: Text( child: Text(
@@ -336,7 +336,7 @@ class CountryPicker extends StatelessWidget {
.tr), .tr),
), ),
SizedBox( SizedBox(
height: 300, height: 200,
child: CupertinoPicker( child: CupertinoPicker(
itemExtent: 32, itemExtent: 32,
onSelectedItemChanged: (int index) { onSelectedItemChanged: (int index) {