This commit is contained in:
Hamza-Ayed
2024-05-10 14:53:16 +03:00
parent c5ac5c2b22
commit 4192c1e471
9 changed files with 166 additions and 77 deletions

View File

@@ -110,6 +110,20 @@ class FirebaseMessagesController extends GetxController {
fireBaseTitles(message);
}
});
FirebaseMessaging.onBackgroundMessage((RemoteMessage message) async {
// Handle background message
if (message.data.isNotEmpty && message.notification != null) {
print(message.notification?.title);
fireBaseTitles(message);
}
});
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
if (message.data.isNotEmpty && message.notification != null) {
print(message.notification?.title);
fireBaseTitles(message);
}
});
}
void fireBaseTitles(RemoteMessage message) {

View File

@@ -215,6 +215,7 @@ class MapPassengerController extends GetxController {
late double totalCostPassenger = 0;
late double totalPassengerComfort = 0;
late double totalPassengerComfortDiscount = 0;
late double totalPassengerLadyDiscount = 0;
late double totalPassengerSpeedDiscount = 0;
late double totalPassengerMotoDelivery = 0;
late double totalDriver = 0;
@@ -1215,14 +1216,24 @@ class MapPassengerController extends GetxController {
carsLocationByPassenger = [];
LatLngBounds bounds = calculateBounds(
passengerLocation.latitude, passengerLocation.longitude, 7000);
var res =
await CRUD().get(link: AppLink.getCarsLocationByPassenger, payload: {
'southwestLat': bounds.southwest.latitude.toString(),
'southwestLon': bounds.southwest.longitude.toString(),
'northeastLat': bounds.northeast.latitude.toString(),
'northeastLon': bounds.northeast.longitude.toString(),
});
var res;
if (box.read(BoxName.carType) == 'Lady') {
res = await CRUD()
.get(link: AppLink.getFemalDriverLocationByPassenger, payload: {
'southwestLat': bounds.southwest.latitude.toString(),
'southwestLon': bounds.southwest.longitude.toString(),
'northeastLat': bounds.northeast.latitude.toString(),
'northeastLon': bounds.northeast.longitude.toString(),
});
} else {
res = await CRUD()
.get(link: AppLink.getCarsLocationByPassenger, payload: {
'southwestLat': bounds.southwest.latitude.toString(),
'southwestLon': bounds.southwest.longitude.toString(),
'northeastLat': bounds.northeast.latitude.toString(),
'northeastLon': bounds.northeast.longitude.toString(),
});
}
if (res == 'failure') {
noCarString = true;
dataCarsLocationByPassenger = res;
@@ -2358,6 +2369,7 @@ class MapPassengerController extends GetxController {
double costForDriver = 0;
double totalPassengerSpeed = 0;
double totalPassengerLady = 0;
Future bottomSheet() async {
if (data.isNotEmpty) {
durationToAdd = Duration(seconds: durationToRide);
@@ -2374,7 +2386,7 @@ class MapPassengerController extends GetxController {
print('costDistance----- $costDistance');
print(
'passengerWalletTotal----- ${box.read(BoxName.passengerWalletTotal)}');
double costComfort, costSpeed, costDelivery, costMashwari = 0;
double costComfort, costSpeed, costDelivery, costMashwari, costLady = 0;
update();
if (currentTime.hour >= 22 && currentTime.hour < 5) {
// costDistance = distance * latePrice;
@@ -2382,6 +2394,7 @@ class MapPassengerController extends GetxController {
costMashwari = (distance * mashwariPrice) + costDuration * latePrice;
costSpeed = (distance * speedPrice) + costDuration * latePrice;
costDelivery = (distance * deliveryPrice) + costDuration * latePrice;
costLady = (distance * comfortPrice + 2) + costDuration * latePrice;
update();
} else if (currentTime.hour >= 13 && currentTime.hour <= 16) {
@@ -2391,6 +2404,7 @@ class MapPassengerController extends GetxController {
costMashwari = (distance * mashwariPrice) + costDuration * heavyPrice;
costSpeed = (distance * speedPrice) + costDuration * heavyPrice;
costDelivery = (distance * deliveryPrice) + costDuration * heavyPrice;
costLady = (distance * comfortPrice + 2) + costDuration * heavyPrice;
update();
// } /
@@ -2400,6 +2414,7 @@ class MapPassengerController extends GetxController {
costMashwari = (distance * mashwariPrice) + costDuration;
costSpeed = (distance * speedPrice) + costDuration;
costDelivery = (distance * deliveryPrice) + costDuration;
costLady = (distance * comfortPrice + 2) + costDuration;
update();
}
//print('cost $cost');
@@ -2409,14 +2424,23 @@ class MapPassengerController extends GetxController {
totalPassenger = costSpeed + (costSpeed * kazan / 100);
totalPassengerComfort =
(costComfort + (costComfort * kazan / 100)).ceilToDouble();
totalPassengerLady = (costLady + (costLady * kazan / 100)).ceilToDouble();
totalPassengerSpeed =
(costSpeed + (costSpeed * kazan / 100)).ceilToDouble();
totalPassengerComfortDiscount =
totalPassengerComfort + totalPassengerComfort * (kazan - 0) / 100;
totalPassengerLadyDiscount =
totalPassengerLady + totalPassengerLady * (kazan - 0) / 100;
totalPassengerSpeedDiscount =
totalPassengerSpeed + totalPassengerSpeed * (kazan - 2) / 100;
totalPassengerMotoDelivery =
(costDelivery + (costDelivery * kazan / 100)).ceilToDouble();
totalPassengerComfort = totalPassengerComfortDiscount -
(totalPassengerComfortDiscount * kazan / 100);
totalPassengerSpeed = totalPassengerSpeedDiscount -
(totalPassengerSpeedDiscount * kazan / 100);
totalPassengerLady = totalPassengerLadyDiscount -
(totalPassengerLadyDiscount * kazan / 100);
totalDriver = totalDriver1 + (totalDriver1 * kazan / 100);
tax = totalCostPassenger * kazan / 100;
totalME = totalCostPassenger - tax;

View File

@@ -4,6 +4,10 @@ class MyTranslation extends Translations {
@override
Map<String, Map<String, String>> get keys => {
"ar": {
'Pick or Tap to confirm': "اختر أو اضغط للتأكيد",
"To use Wallet charge it": "لاستخدام المحفظة، قم بشحنها.",
'\$ Next as Cash \$!': '\$ Cash \$ ',
'This trip just for girls only': "هذه الرحلة فقط للفتيات ",
'How do I request a ride?': 'كيف يمكنني طلب رحلة؟',
'Step-by-step instructions on how to request a ride through the Sefer app.':
'تعليمات خطوة بخطوة حول كيفية طلب رحلة من خلال تطبيق Sefer.',
@@ -31,7 +35,7 @@ class MyTranslation extends Translations {
'ما هي التدابير الأمنية التي يقدمها Sefer؟',
'Sefer prioritizes your safety. We offer features like driver verification, in-app trip tracking, and emergency contact options.':
'يعمل Sefer على أولوية سلامتك. نحن نقدم ميزات مثل التحقق من السائق، وتتبع الرحلة داخل التطبيق، وخيارات الاتصال بالطوارئ.',
'Frequently questions': 'الأسئلة المتكررة ',
'Frequently Questions': 'الأسئلة المتكررة ',
'About Us': 'عننا',
'SEFER is a ride-sharing app designed with your safety and affordability in mind. We connect you with reliable drivers in your area, ensuring a convenient and stress-free travel experience.\n\nHere are some of the key features that set us apart:':
"سفر هو تطبيق مشاركة رحلات مصمم مع وضع سلامتك وإمكانياتك المادية في الاعتبار. نوفر لك اتصالًا بسائقين موثوقين في منطقتك ، مما يضمن تجربة سفر مريحة وخالية من التوتر.\n\n فيما يلي بعض الميزات الرئيسية التي تميزنا:",