This commit is contained in:
Hamza-Ayed
2024-09-08 10:31:59 +03:00
parent 2098aeda23
commit a40c6851ee
16 changed files with 812 additions and 187 deletions

2
.env
View File

@@ -20,7 +20,7 @@ seferPaymentServer=https://seferpw.shop/sefer
seferCairoServer=https://sefer.click/sefer
seferGizaServer=https://sefergiza.site/sefer
whatappID=369939736211879
whatsapp=EAAOtbZBSUK74BO6yE1QwIBsRCjPDANdum66xap0ZA7OZA8LqEu8MZAts1kwr12eRiNXtvpJ2ZAFSY5dw3KVSyrUuH8boLjynxdFI4Gh1Q7BCHx275X2uZBwKWZCSrsVN17i6mZAFNYYd25sQv0ZBomeTk02ZCIJot4UqWxK9ZBvxsq1k2yS7lD2NsjZB5EHbpaYGLzxFJ2FCCSX6iHyKXab6ckfK7m19wo77in7Dl3YZD
whatsapp=EEAAOtbZBSUK74BO93qYEsBTetiT5qGCHCdxDRXEH1cGUrlbHN2ZB4bVrFCR1ZC8xEVDtHeLUH6yHej2RPMpmoLD69AlqBJJDtQ7nrsmbeIRZCBGPoKueLQUaEMWPC2R6EJdZArqdFy1rv4ZAGJZBV9ifxvwwTAlw7dbzA3WEZBvWKPXswUkPP9UWM1fWEPL86buyH0IvEd6j9grk6l7rG6CAZD
cohere=Aulwd8y5SPWos0hJhG0toUf8gOhUUrpf5Q2TPmVGXrXlBl
claudeAiAPI=zg-qbc-qvo39-xWOxIGwWTOzCFBnIYSKKhfyz_KVAvrH-6_4ZEJL68G_QBH26oeTOMMoQug9KuOjjKSP_A4S3SUDlbxR9duVzoQ-MkX_UQQQXrXlBl
payPalClientId=QALymfNI5Tzt4s-ysoz6vD4_nqX0SUtkC_qYV-Ugk5gaM_8Z-kg4L53k8Uux_4jEWXDkNpXGSWPpIzDFXrXlBl

View File

@@ -37,11 +37,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>48</string>
<string>49</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>4.3.47</string>
<string>4.3.49</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<string>NO</string>
<key>GMSApiKey</key>

View File

@@ -68,6 +68,7 @@ class BoxName {
static const String vin = "vin";
static const String isvibrate = "isvibrate";
static const String make = "make";
static const String hourWait = "hourWait";
static const String model = "model";
static const String year = "year";
static const String expirationDate = "expirationDate";

View File

@@ -330,6 +330,33 @@ class FirebaseMessagesController extends GetxController {
'We regret to inform you that another driver has accepted this order.'
.tr,
'order');
} else if (message.notification!.title! == 'VIP Order Accepted'.tr) {
var myListString = message.data['passengerList'];
var driverList = jsonDecode(myListString) as List<dynamic>;
// Assuming driverList[1] contains a valid date string
DateTime scheduledTime;
try {
scheduledTime = DateTime.parse(driverList[1]);
} catch (e) {
// Handle the error if the date format is incorrect
Log.print('Error parsing date: $e');
scheduledTime = DateTime.now()
.add(const Duration(hours: 1)); // Fallback to 1 hour from now
}
NotificationController()
.showNotification('The driver accepted your trip'.tr, '', 'order');
MyDialog().getDialog(
'VIP Order Accepted'.tr,
'The driver accepted your trip'.tr,
() {
// Schedule a notification for the parsed date or fallback date
NotificationController().scheduleNotification('VIP Order'.tr,
'This is a scheduled notification.'.tr, scheduledTime);
},
);
}
}

View File

@@ -1,10 +1,19 @@
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:get/get.dart';
import 'package:timezone/data/latest.dart' as tz;
import 'package:timezone/timezone.dart' as tz;
class NotificationController extends GetxController {
final FlutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
@override
void onInit() {
super.onInit();
initNotifications();
tz.initializeTimeZones();
}
// Initializes the local notifications plugin
Future<void> initNotifications() async {
const AndroidInitializationSettings android =
@@ -26,4 +35,29 @@ class NotificationController extends GetxController {
NotificationDetails details = NotificationDetails(android: android);
await _flutterLocalNotificationsPlugin.show(0, title, message, details);
}
// Schedules a notification for a specific time
Future<void> scheduleNotification(
String title, String body, DateTime scheduledTime) async {
await _flutterLocalNotificationsPlugin.zonedSchedule(
0,
title,
body,
tz.TZDateTime.from(scheduledTime, tz.local),
const NotificationDetails(
android: AndroidNotificationDetails(
'your_channel_id',
'your_channel_name',
channelDescription: 'your_channel_description',
importance: Importance.max,
priority: Priority.high,
showWhen: false,
),
),
androidAllowWhileIdle: true,
uiLocalNotificationDateInterpretation:
UILocalNotificationDateInterpretation.absoluteTime,
matchDateTimeComponents: DateTimeComponents.time,
);
}
}

View File

@@ -28,9 +28,9 @@ class CRUD {
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}',
},
);
Log.print('payload: ${payload}');
// Log.print('payload: ${payload}');
Log.print('response.request: ${response.request}');
Log.print('response.reasonPhrase: ${response.reasonPhrase}');
// Log.print('response.reasonPhrase: ${response.reasonPhrase}');
Log.print('response.body: ${response.body}');
// print(payload);
@@ -233,8 +233,8 @@ class CRUD {
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
},
);
Log.print('payload: ${payload}');
Log.print('response.request: ${response.request}');
// Log.print('payload: ${payload}');
// Log.print('response.request: ${response.request}');
Log.print('response.body: ${response.body}');
var jsonData = jsonDecode(response.body);
if (response.statusCode == 200) {

View File

@@ -64,6 +64,11 @@ void showUpdateDialog(BuildContext context) {
Navigator.of(context).pop();
},
),
CupertinoDialogAction(
child: Text('Cancel'.tr),
onPressed: () {
Navigator.of(context).pop();
})
],
);
},

View File

@@ -233,7 +233,7 @@ class MapPassengerController extends GetxController {
late double totalPassengerSpeedDiscount = 0;
late double totalPassengerBalashDiscount = 0;
late double totalPassengerRaihGaiDiscount = 0;
late double totalPassengerMotoDelivery = 0;
late double totalPassengerScooter = 0;
late double totalDriver = 0;
late double averageDuration = 0;
late double costDuration = 0;
@@ -258,7 +258,7 @@ class MapPassengerController extends GetxController {
void getCurrentLocationFormString() async {
currentLocationToFormPlaces = true;
currentLocationString = 'Waiting for your location'.tr;
await getLocation();
getLocation();
currentLocationString = passengerLocation.toString();
newStartPointLocation = passengerLocation;
update();
@@ -1760,7 +1760,7 @@ class MapPassengerController extends GetxController {
'northeastLon': bounds.northeast.longitude.toString(),
});
break;
case 'Delivery':
case 'Scooter':
res = await CRUD()
.get(link: AppLink.getCarsLocationByPassengerDelivery, payload: {
'southwestLat': bounds.southwest.latitude.toString(),
@@ -2603,44 +2603,58 @@ class MapPassengerController extends GetxController {
Future<void> getLocation() async {
isLoading = true;
update();
bool serviceEnabled;
PermissionStatus permissionGranted;
// dialoge();
// Check if location services are enabled
serviceEnabled = await location.serviceEnabled();
if (!serviceEnabled) {
serviceEnabled = await location.requestService();
try {
// Perform permission and service checks in parallel
final results = await Future.wait([
location.serviceEnabled(),
location.hasPermission(),
]);
bool serviceEnabled = results[0] as bool; // Cast to bool
PermissionStatus permissionGranted =
results[1] as PermissionStatus; // Cast to PermissionStatus
// Check if location services are enabled
if (!serviceEnabled) {
// Location services are still not enabled, handle the error
return;
serviceEnabled = await location.requestService();
if (!serviceEnabled) {
// Location services are still not enabled, handle the error
isLoading = false;
update();
return;
}
}
}
// Check if the app has permission to access location
permissionGranted = await location.hasPermission();
if (permissionGranted == PermissionStatus.denied) {
permissionGranted = await location.requestPermission();
if (permissionGranted != PermissionStatus.granted) {
// Location permission is still not granted, handle the error
return;
// Check if the app has permission to access location
if (permissionGranted == PermissionStatus.denied) {
permissionGranted = await location.requestPermission();
if (permissionGranted != PermissionStatus.granted) {
// Location permission is still not granted, handle the error
isLoading = false;
update();
return;
}
}
// Request updated location with medium accuracy (faster)
LocationData _locationData = await location.getLocation();
passengerLocation =
LatLng(_locationData.latitude!, _locationData.longitude!);
// Process location data
getLocationArea(passengerLocation.latitude, passengerLocation.longitude);
newStartPointLocation = passengerLocation;
speed = _locationData.speed!;
// Update loading state
isLoading = false;
update();
} catch (e) {
// Handle exceptions (optional logging)
isLoading = false;
update();
}
// Configure location accuracy
// LocationAccuracy desiredAccuracy = LocationAccuracy.high;
// Get the current location
LocationData _locationData = await location.getLocation();
passengerLocation =
(_locationData.latitude != null && _locationData.longitude != null
? LatLng(_locationData.latitude!, _locationData.longitude!)
: null)!;
getLocationArea(passengerLocation.latitude, passengerLocation.longitude);
newStartPointLocation = passengerLocation;
speed = _locationData.speed!;
// //print location details
isLoading = false;
update();
}
LatLngBounds calculateBounds(
@@ -2689,7 +2703,7 @@ class MapPassengerController extends GetxController {
Log.print('AppLink.endPoint: ${AppLink.endPoint}');
if (reloadStartApp == false) {
Timer.periodic(const Duration(seconds: 5), (timer) async {
Timer.periodic(const Duration(seconds: 4), (timer) async {
reloadCount++;
Log.print('reloadCount: ${reloadCount}');
@@ -2762,7 +2776,7 @@ class MapPassengerController extends GetxController {
update();
}
}
}
} else {}
}
}
}
@@ -3195,7 +3209,7 @@ class MapPassengerController extends GetxController {
update();
}
int selectedIndex = -1; // Initialize with no selection
int selectedIndex = 1; // Initialize with no selection
void selectCarFromList(int index) {
selectedIndex = index; // Update selected index
carTypes.forEach(
@@ -3269,6 +3283,8 @@ class MapPassengerController extends GetxController {
double totalPassengerBalash = 0;
double totalPassengerLady = 0;
double totalPassengerRayehGai = 0;
double totalPassengerRayehGaiComfort = 0;
double totalPassengerRayehGaiBalash = 0;
Future bottomSheet() async {
if (data.isNotEmpty) {
durationToAdd = Duration(seconds: durationToRide);
@@ -3285,7 +3301,9 @@ class MapPassengerController extends GetxController {
costDelivery,
costBalash,
costLady,
costRayehGai = 0;
costRayehGai,
costRayehGaiBalash,
costRayehGaiComfort = 0;
update();
if (startNameAddress.toLowerCase().contains('airport') ||
endNameAddress.toLowerCase().contains('airport') ||
@@ -3306,10 +3324,17 @@ class MapPassengerController extends GetxController {
((distance * 1 * speedPrice) * .4) +
costDuration * 2 * latePrice +
20;
costRayehGaiComfort = (distance * 2 * comfortPrice) -
((distance * 1 * comfortPrice) * .4) +
costDuration * 2 * latePrice +
20;
costRayehGaiBalash = (distance * 2 * (speedPrice - 1)) -
((distance * 1 * (speedPrice - 1)) * .4) +
costDuration * 2 * latePrice +
20;
update();
}
if (currentTime.hour >= 21 && currentTime.hour < 0) {
} else if (currentTime.hour >= 21 && currentTime.hour < 0) {
// costDistance = distance * latePrice;
costComfort = (distance * comfortPrice) + costDuration * latePrice;
costSpeed = (distance * speedPrice) + costDuration * latePrice;
@@ -3319,6 +3344,12 @@ class MapPassengerController extends GetxController {
costRayehGai = (distance * 2 * speedPrice) -
((distance * 1 * speedPrice) * .4) +
costDuration * 2 * latePrice;
costRayehGaiComfort = (distance * 2 * comfortPrice) -
((distance * 1 * comfortPrice) * .4) +
costDuration * 2 * latePrice;
costRayehGaiBalash = (distance * 2 * (speedPrice - 1)) -
((distance * 1 * (speedPrice - 1)) * .4) +
costDuration * 2 * latePrice;
update();
} else if (currentTime.hour >= 1 && currentTime.hour < 5) {
@@ -3328,8 +3359,9 @@ class MapPassengerController extends GetxController {
startNameAddress.contains('ديسكو') ||
startNameAddress.contains('ملهى ليلي') ||
startNameAddress.contains('Night club')) {
// Your code here costComfort =
(distance * comfortPrice) + costDuration * (latePrice + .5) * 2;
// Your code here
costComfort =
(distance * comfortPrice) + costDuration * (latePrice + .5) * 2;
costSpeed =
(distance * speedPrice) + costDuration * (latePrice + .5) * 2;
costBalash = (distance * (speedPrice - 1)) +
@@ -3341,6 +3373,12 @@ class MapPassengerController extends GetxController {
costRayehGai = (distance * 2 * speedPrice) -
((distance * 1 * speedPrice) * .4) +
costDuration * 2 * (latePrice + .5) * 2;
costRayehGaiComfort = (distance * 2 * comfortPrice) -
((distance * 1 * comfortPrice) * .4) +
costDuration * 2 * (latePrice + .5) * 2;
costRayehGaiBalash = (distance * 2 * (speedPrice - 1)) -
((distance * 1 * (speedPrice - 1)) * .4) +
costDuration * 2 * (latePrice + .5) * 2;
update();
}
@@ -3356,9 +3394,15 @@ class MapPassengerController extends GetxController {
costRayehGai = (distance * 2 * speedPrice) -
((distance * 1 * speedPrice) * .4) +
costDuration * 2 * latePrice;
costRayehGaiComfort = (distance * 2 * comfortPrice) -
((distance * 1 * comfortPrice) * .4) +
costDuration * 2 * latePrice;
costRayehGaiBalash = (distance * 2 * (speedPrice - 1)) -
((distance * 1 * (speedPrice - 1)) * .4) +
costDuration * 2 * latePrice;
update();
} else if (currentTime.hour >= 13 && currentTime.hour <= 16) {
} else if (currentTime.hour >= 14 && currentTime.hour <= 17) {
// if (averageDuration > 2.5) {
// costDistance = distance * heavyPrice;
costComfort = (distance * comfortPrice) + costDuration * heavyPrice;
@@ -3369,6 +3413,12 @@ class MapPassengerController extends GetxController {
costRayehGai = (distance * 2 * speedPrice) -
((distance * 1 * speedPrice) * .4) +
costDuration * 2 * heavyPrice;
costRayehGaiComfort = (distance * 2 * comfortPrice) -
((distance * 1 * comfortPrice) * .4) +
costDuration * 2 * heavyPrice;
costRayehGaiBalash = (distance * 2 * (speedPrice - 1)) -
((distance * 1 * (speedPrice - 1)) * .4) +
costDuration * 2 * heavyPrice;
update();
// } /
@@ -3382,6 +3432,12 @@ class MapPassengerController extends GetxController {
costRayehGai = (distance * 2 * speedPrice) -
((distance * 1 * speedPrice) * .4) +
costDuration * 2;
costRayehGaiComfort = (distance * 2 * comfortPrice) -
((distance * 1 * comfortPrice) * .4) +
costDuration * 2;
costRayehGaiBalash = (distance * 2 * (speedPrice - 1)) -
((distance * 1 * (speedPrice - 1)) * .4) +
costDuration * 2;
update();
}
@@ -3397,6 +3453,12 @@ class MapPassengerController extends GetxController {
(costBalash + (costBalash * kazan / 100)).ceilToDouble();
totalPassengerRayehGai =
(costRayehGai + (costRayehGai * kazan / 100)).ceilToDouble();
totalPassengerRayehGaiComfort =
(costRayehGaiComfort + (costRayehGaiComfort * kazan / 100))
.ceilToDouble();
totalPassengerRayehGaiBalash =
(costRayehGaiBalash + (costRayehGaiBalash * kazan / 100))
.ceilToDouble();
totalPassengerComfortDiscount =
totalPassengerComfort + totalPassengerComfort * (kazan - 0) / 100;
totalPassengerLadyDiscount =
@@ -3407,7 +3469,7 @@ class MapPassengerController extends GetxController {
totalPassengerBalash + totalPassengerBalash * (kazan) / 100;
totalPassengerRaihGaiDiscount =
totalPassengerRayehGai + totalPassengerRayehGai * (kazan) / 100;
totalPassengerMotoDelivery =
totalPassengerScooter =
(costDelivery + (costDelivery * kazan / 100)).ceilToDouble();
totalPassengerComfort = totalPassengerComfortDiscount -
(totalPassengerComfortDiscount * kazan / 100);
@@ -3428,7 +3490,7 @@ class MapPassengerController extends GetxController {
totalPassengerBalash = 20;
totalPassengerComfort = 30;
totalPassengerLady = 30;
totalPassengerMotoDelivery = 18;
totalPassengerScooter = 18;
} else {
totalPassenger = totalCostPassenger;
update();
@@ -3442,7 +3504,9 @@ class MapPassengerController extends GetxController {
(-1) * (double.parse(box.read(BoxName.passengerWalletTotal)));
totalPassengerBalash = totalPassengerBalash +
(-1) * (double.parse(box.read(BoxName.passengerWalletTotal)));
totalPassengerMotoDelivery = totalPassengerMotoDelivery +
totalPassengerScooter = totalPassengerScooter +
(-1) * (double.parse(box.read(BoxName.passengerWalletTotal)));
totalPassengerRayehGai = totalPassengerScooter +
(-1) * (double.parse(box.read(BoxName.passengerWalletTotal)));
update();
}
@@ -3559,50 +3623,79 @@ class MapPassengerController extends GetxController {
try {
// Prepare trip data
Map<String, dynamic> tripData = {
'id': driver['id'],
'phone': driver['phone'],
'gender': driver['gender'],
'name': driver['name'],
'name_english': driver['name_english'],
'address': driver['address'],
'driverId': driver['id'].toString(),
'phone': driver['phone'].toString(),
'gender': driver['gender'].toString(),
'name': driver['NAME']
.toString(), // Confirm this key exists in the driver map
'name_english': driver['name_english'].toString(),
'address': driver['address'].toString(),
'religion': driver['religion'],
'age': driver['age'],
'education': driver['education'],
'license_type': driver['license_type'],
'national_number': driver['national_number'],
'car_plate': driver['car_plate'],
'make': driver['make'],
'model': driver['model'],
'year': driver['year'],
'color': driver['color'],
'color_hex': driver['color_hex'],
'displacement': driver['displacement'],
'fuel': driver['fuel'],
'token': driver['token'],
'rating': driver['rating'],
'countRide': driver['countRide'],
'passengerId': box.read(BoxName.passengerID),
'timeSelected': tripDateTime.toIso8601String(),
'status': 'pending', // Or other appropriate status
'age': driver['age'].toString(),
'education': driver['education'].toString(),
'license_type': driver['license_type'].toString(),
'national_number': driver['national_number'].toString(),
'car_plate': driver['car_plate'].toString(),
'make': driver['make'].toString(),
'model': driver['model'].toString(),
'color': driver['color'].toString(),
'color_hex': driver['color_hex'].toString(),
'token': driver['token'].toString(),
'rating': driver['rating'].toString(),
'countRide': driver['countRide'].toString(),
'passengerId': box.read(BoxName.passengerID).toString(),
'timeSelected': tripDateTime.toString(),
'status': 'pending',
};
Log.print('tripData prepared: $tripData');
// Send data to server
var response =
await CRUD().post(link: AppLink.addMishwari, payload: tripData);
var response = await CRUD().post(
link: AppLink.addMishwari,
payload: tripData,
);
if (response != 'failure') {
// Trip saved successfully
Get.snackbar('Success'.tr, 'Trip booked successfully'.tr);
Log.print('Server response received: $response');
// Set up local notification
// await setLocalNotification(tripDateTime);
// Send notification to driver
// await FirebaseMessagesController().sendNotificationToDriverMAP();
if (response != 'failure' && response != null) {
Get.back();
Future.delayed(Duration.zero);
Get.defaultDialog(
title: 'Success'.tr,
middleText: 'Trip booked successfully'.tr,
confirm: MyElevatedButton(
title: 'Accept'.tr,
onPressed: () async {
FirebaseMessagesController().sendNotificationToDriverMAP(
'VIP Order'.tr,
'from: ${box.read(BoxName.name)}',
driver['token'].toString(),
[
box.read(BoxName.tokenFCM).toString(),
tripDateTime.toString()
],
'order.wav');
Get.back();
},
kolor: AppColor.greenColor,
));
Get.snackbar('Success'.tr, 'Trip booked successfully'.tr,
backgroundColor: AppColor.greenColor);
} else {
throw Exception('Failed to save trip');
Get.back();
MyDialog().getDialog(
'Error'.tr,
"Driver already has 2 trips within the specified period.".tr,
() {});
Get.snackbar('Error'.tr, 'Trip booked successfully'.tr,
backgroundColor: AppColor.redColor);
Log.print('Error response from server: $response');
throw Exception('Failed to save trip with response: $response');
}
} catch (e) {
Log.print('Exception caught: $e');
Get.snackbar('Error'.tr, 'Failed to book trip: $e'.tr);
}
}
@@ -3679,7 +3772,7 @@ class MapPassengerController extends GetxController {
addCustomStepIcon();
addCustomStartIcon();
addCustomEndIcon();
await getLocation();
getLocation();
// await addToken();
getKazanPercent();

View File

@@ -154,11 +154,15 @@ iOS [https://getapp.cc/app/6458734951]
"You have call from driver": " لديك مكالمة من السائق",
"Comfort": "كمفورت",
"Speed": "سبيد",
"Driver already has 2 trips within the specified period.":
'السائق لديه بالفعل رحلتان خلال الفترة المحددة.',
"The invitation was sent successfully": "تم إرسال الدعوة بنجاح",
"Lady": "ليدي",
"You should select your country": "يجب عليك اختيار بلدك",
"Delivery": "توصيل",
"Mashwari": "‏مشواري",
"Scooter": "سكوتر",
'A trip with a prior reservation, allowing you to choose the best captains and cars.':
'مشوار بحجز مسبق مع إمكانية اختيارك لأفضل الكباتن والسيارات',
"Mishwar Vip": "‏مشوار VIP",
'The driver waiting you in picked location .':
"السائق ينتظرك في موقع الركوب.",
'About Us': "نبذة عنا",
@@ -740,7 +744,7 @@ iOS [https://getapp.cc/app/6458734951]
"Arrival time": 'وَقْتُ الْوُصُولِ ',
"arrival time to reach your point":
'الْوَقْتُ المُتَوَقَّعُ لِلْوُصُولِ إِلَى وَجْهَتِكَ ',
"For Speed and Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"For Speed and scooter trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
'بِالنِّسْبَةِ لِرِحْلَاتِ السُّرْعَةِ وَالتَّوْصِيلِ، يَتِمُّ حِسَابُ السِّعْرِ بِشَكْلٍ دِينَامِيكِيٍّ. أَمَّا بِالنِّسْبَةِ لِرِحْلَاتِ الرَّاحَةِ، فَيَتِمُّ حِسَابُ السِّعْرِ بِنَاءً عَلَى الْوَقْتِ وَالْمَسَافَةِ.',
"Hello this is Driver": "مَرْحَبًا هَذَا السَّائِقُ",
"Is the Passenger in your Car ?": "هَلِ الرَّاكِبُ فِي سَيَّارَتِكَ؟",
@@ -762,7 +766,7 @@ iOS [https://getapp.cc/app/6458734951]
"Best choice for comfort car and flexible route and stops point":
"رحلة مكيفة ومسار متغير لرغبة العميل ونقاط توقف",
"Insert": "إِدْرَاجُ",
"This is for delivery or a motorcycle.":
"This is for scooter or a motorcycle.":
"هَذَا لِلتَّسْلِيمِ أَوِ الدَّرَّاجَةِ النَّارِيَّةِ",
"This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route":
'‏رحلة محددة السعر والشريك السائق ملتزم بالمسار المحدد من خلال التطبيق',
@@ -801,6 +805,7 @@ iOS [https://getapp.cc/app/6458734951]
"الرَّجَاء الْمُسَاعَدَة! اِتَّصِل بِي فِي أَقْرَب وَقْت مُمْكِن",
"Share Trip Details": "مُشَارَكَة تَفَاصِيل الرِّحْلَة",
"Car Plate is ": "‏رَقْم اللَّوْحَة",
"VIP Order": "طلب VIP",
"the 300 points equal 300 L.E for you \nSo go and gain your money":
"اِرْبَح ٣٠٠ جُنَيه! كُلّ ٣٠٠ نُقْطَة تُمْنِحُك ٣٠٠ جُنَيه. اِذْهَب وَاِسْتَفِد مِن نُقَاطِك!",
"the 300 points equal 300 L.E":
@@ -809,6 +814,7 @@ iOS [https://getapp.cc/app/6458734951]
'لم يتم الموافقة على الدفع. الرجاء المحاولة مرة أخرى.',
"Payment Failed": 'فشل الدفع',
"Error": 'خطأ',
'This is a scheduled notification.': "هذا إشعار مجدول.",
"An error occurred during the payment process.":
'حدث خطأ أثناء عملية الدفع.',
"The payment was approved.": 'تمت الموافقة على الدفع.',
@@ -923,10 +929,17 @@ iOS [https://getapp.cc/app/6458734951]
"Payment History": "تاريخ المدفوعات",
"Show Promos to Charge": "إظهار العروض للشحن",
"Point": "نقطة",
'How many hours would you like to wait?':
"كم عدد الساعات التي تود الانتظار؟",
"Driver Wallet": "محفظة السائق",
"Choose between those Type Cars":
'اختر من بين أنواع السيارات التالية',
"hour": ' ساعه',
'Select Waiting Hours': "• اختر ساعات الانتظار",
"Total Points is": "إجمالي النقاط هو",
"You will receive a code in SMS message":
"سوف تتلقى رمزًا في رسالة SMS",
"Done": 'تم',
"Total Budget from trips is ": "إجمالي الميزانية من الرحلات هو ",
"Total Amount:": "المبلغ الإجمالي:",
"Total Budget from trips by\nCredit card is ":
@@ -1558,7 +1571,7 @@ iOS [https://getapp.cc/app/6458734951]
"Arrival time": "Varış zamanı",
"arrival time to reach your point":
"varış noktanıza ulaşmak için varış zamanı",
"For Speed and Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"For Speed and scooter trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"Hızlı ve Teslimat seferlerinde fiyat dinamik olarak hesaplanır. Konfor gezileri için fiyat, zamana ve mesafeye bağlıdır",
"Hello this is Driver": "Merhaba ben Sürücü",
"Is the Passenger in your Car ?": "Yolcu Arabanızda mı?",
@@ -1579,7 +1592,7 @@ iOS [https://getapp.cc/app/6458734951]
"Best choice for comfort car and flexible route and stops point":
"Konforlu araç ve esnek rota ve durak noktaları için en iyi seçim",
"Insert": "Sokmak",
"This is for delivery or a motorcycle.":
"This is for scooter or a motorcycle.":
"Bu teslimat veya motosiklet içindir.",
"This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route":
"Bu yolculuk, sabit bir ücret karşılığında doğrudan başlangıç noktanızdan varış noktanıza gider. Sürücü planlanan rotayı takip etmelidir",
@@ -2388,8 +2401,8 @@ iOS [https://getapp.cc/app/6458734951]
"Arrival time": "Heure d'arrivée",
"arrival time to reach your point":
"heure d'arrivée pour atteindre votre point",
"For Speed and Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"Pour les courses Speed et Delivery, le prix est calculé dynamiquement. Pour les trajets Confort, le prix est fonction du temps et de la distance",
"For Speed and scooter trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"Pour les courses Speed et scooter, le prix est calculé dynamiquement. Pour les trajets Confort, le prix est fonction du temps et de la distance",
"Hello this is Driver": "Bonjour, c'est Driver",
"Is the Passenger in your Car ?":
"Le passager est-il dans votre voiture ?",
@@ -2410,7 +2423,7 @@ iOS [https://getapp.cc/app/6458734951]
"Best choice for comfort car and flexible route and stops point":
"Meilleur choix pour une voiture de confort et un itinéraire et un point d'arrêt flexibles",
"Insert": "Insérer",
"This is for delivery or a motorcycle.":
"This is for scooter or a motorcycle.":
"C'est pour une livraison ou une moto.",
"This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route":
"Ce voyage va directement de votre point de départ à votre destination pour un prix fixe. Le chauffeur doit suivre l'itinéraire prévu",
@@ -3230,8 +3243,8 @@ iOS [https://getapp.cc/app/6458734951]
"Arrival time": "Ankunftszeit",
"arrival time to reach your point":
"Ankunftszeit, um Ihren Punkt zu erreichen",
"For Speed and Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"Für Speed- und Delivery-Fahrten wird der Preis dynamisch berechnet. Bei Komfortfahrten richtet sich der Preis nach Zeit und Entfernung",
"For Speed and scooter trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"Für Speed- und scooter-Fahrten wird der Preis dynamisch berechnet. Bei Komfortfahrten richtet sich der Preis nach Zeit und Entfernung",
"Hello this is Driver": "Hallo, hier ist Driver",
"Is the Passenger in your Car ?":
"Befindet sich der Beifahrer in Ihrem Auto?",
@@ -3252,7 +3265,7 @@ iOS [https://getapp.cc/app/6458734951]
"Best choice for comfort car and flexible route and stops point":
"Beste Wahl für ein komfortables Auto und eine flexible Route und Haltestellen",
"Insert": "Einfügen",
"This is for delivery or a motorcycle.":
"This is for scooter or a motorcycle.":
"Dies ist für die Lieferung oder ein Motorrad.",
"This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route":
"Diese Reise führt zum Festpreis direkt von Ihrem Startpunkt zu Ihrem Ziel. Der Fahrer muss der geplanten Route folgen",
@@ -4063,7 +4076,7 @@ iOS [https://getapp.cc/app/6458734951]
"Arrival time": "Hora de llegada",
"arrival time to reach your point":
"Hora de llegada para llegar a tu punto.",
"For Speed and Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"For Speed and scooter trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"Para viajes de Velocidad y Entrega, el precio se calcula dinámicamente. Para viajes Comfort, el precio se basa en tiempo y distancia.",
"Hello this is Driver": "Hola, este es el conductor.",
"Is the Passenger in your Car ?":
@@ -4085,7 +4098,7 @@ iOS [https://getapp.cc/app/6458734951]
"Best choice for comfort car and flexible route and stops point":
"La mejor opción para un vehículo cómodo y una ruta y un punto de parada flexibles",
"Insert": "Insertar",
"This is for delivery or a motorcycle.":
"This is for scooter or a motorcycle.":
"Esto es para entrega o una motocicleta.",
"This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route":
"Este viaje va directamente desde su punto de partida a su destino por un precio fijo. El conductor debe seguir la ruta planificada.",
@@ -4881,7 +4894,7 @@ iOS [https://getapp.cc/app/6458734951]
"Arrival time": "زمان رسیدن",
"arrival time to reach your point":
"زمان رسیدن برای رسیدن به نقطه خود",
"For Speed and Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"For Speed and scooter trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"برای سفرهای سرعت و تحویل، قیمت به صورت پویا محاسبه می شود. برای سفرهای Comfort، قیمت بر اساس زمان و مسافت است",
"Hello this is Driver": "سلام این راننده است",
"Is the Passenger in your Car ?": "آیا مسافر در ماشین شماست؟",
@@ -4902,7 +4915,7 @@ iOS [https://getapp.cc/app/6458734951]
"Best choice for comfort car and flexible route and stops point":
"بهترین انتخاب برای ماشین راحت و مسیر انعطاف پذیر و نقطه توقف",
"Insert": "درج کنید",
"This is for delivery or a motorcycle.":
"This is for scooter or a motorcycle.":
"این برای تحویل یا موتور سیکلت است.",
"This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route":
"این سفر مستقیماً از نقطه شروع شما به مقصد شما با قیمت ثابت می رود. راننده باید مسیر برنامه ریزی شده را دنبال کند",
@@ -5708,7 +5721,7 @@ iOS [https://getapp.cc/app/6458734951]
"Arrival time": "Ωρα άφιξης",
"arrival time to reach your point":
"ώρα άφιξης για να φτάσετε στο σημείο σας",
"For Speed and Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"For Speed and scooter trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"Για ταξίδια Ταχύτητας και Παράδοσης, η τιμή υπολογίζεται δυναμικά. Για Comfort ταξίδια, η τιμή βασίζεται σε χρόνο και απόσταση",
"Hello this is Driver": "Γεια σας, αυτός είναι ο οδηγός",
"Is the Passenger in your Car ?":
@@ -5730,7 +5743,7 @@ iOS [https://getapp.cc/app/6458734951]
"Best choice for comfort car and flexible route and stops point":
"Η καλύτερη επιλογή για αυτοκίνητο άνεσης και ευέλικτη διαδρομή και σημείο στάσεων",
"Insert": "Εισάγετε",
"This is for delivery or a motorcycle.":
"This is for scooter or a motorcycle.":
"Αυτό είναι για παράδοση ή μοτοσυκλέτα.",
"This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route":
"Αυτό το ταξίδι πηγαίνει απευθείας από το σημείο εκκίνησης στον προορισμό σας για μια σταθερή τιμή. Ο οδηγός πρέπει να ακολουθήσει την προγραμματισμένη διαδρομή",
@@ -6539,7 +6552,7 @@ iOS [https://getapp.cc/app/6458734951]
"Arrival time": "آمد کے وقت",
"arrival time to reach your point":
"آپ کے نقطہ تک پہنچنے کے لئے آمد کا وقت",
"For Speed and Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"For Speed and scooter trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"سپیڈ اور ڈیلیوری ٹرپس کے لیے، قیمت کا حساب متحرک طور پر کیا جاتا ہے۔ آرام دہ دوروں کے لیے، قیمت وقت اور فاصلے پر مبنی ہے۔",
"Hello this is Driver": "ہیلو یہ ڈرائیور ہے۔",
"Is the Passenger in your Car ?": "کیا مسافر آپ کی گاڑی میں ہے؟",
@@ -6560,7 +6573,7 @@ iOS [https://getapp.cc/app/6458734951]
"Best choice for comfort car and flexible route and stops point":
"آرام دہ کار اور لچکدار روٹ اور اسٹاپ پوائنٹ کے لیے بہترین انتخاب",
"Insert": "داخل کریں",
"This is for delivery or a motorcycle.":
"This is for scooter or a motorcycle.":
"یہ ڈیلیوری یا موٹرسائیکل کے لیے ہے۔",
"This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route":
"یہ سفر ایک مقررہ قیمت پر آپ کے نقطہ آغاز سے براہ راست آپ کی منزل تک جاتا ہے۔ ڈرائیور کو منصوبہ بند راستے پر چلنا چاہیے۔",
@@ -7357,7 +7370,7 @@ iOS [https://getapp.cc/app/6458734951]
"Arrival time": "आगमन का समय",
"arrival time to reach your point":
"अपनी बात तक पहुंचने के लिए आगमन का समय",
"For Speed and Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"For Speed and scooter trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"स्पीड और डिलीवरी ट्रिप के लिए, कीमत की गणना गतिशील रूप से की जाती है। आरामदायक यात्राओं के लिए, कीमत समय और दूरी पर आधारित होती है",
"Hello this is Driver": "नमस्ते, मैं ड्राइवर हूं",
"Is the Passenger in your Car ?": "क्या यात्री आपकी कार में है?",
@@ -7379,7 +7392,7 @@ iOS [https://getapp.cc/app/6458734951]
"Best choice for comfort car and flexible route and stops point":
"आरामदायक कार और लचीले मार्ग और स्टॉप पॉइंट के लिए सर्वोत्तम विकल्प",
"Insert": "डालना",
"This is for delivery or a motorcycle.":
"This is for scooter or a motorcycle.":
"यह डिलीवरी या मोटरसाइकिल के लिए है।",
"This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route":
"यह यात्रा एक निश्चित कीमत पर आपके शुरुआती बिंदु से सीधे आपके गंतव्य तक जाती है। चालक को नियोजित मार्ग का पालन करना होगा",
@@ -8183,7 +8196,7 @@ iOS [https://getapp.cc/app/6458734951]
"Arrival time": "Время прибытия",
"arrival time to reach your point":
"время прибытия, чтобы добраться до вашей точки",
"For Speed and Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"For Speed and scooter trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"Для поездок «Скорость» и «Доставка» цена рассчитывается динамически. Для поездок Комфорт цена зависит от времени и расстояния.",
"Hello this is Driver": "Привет, это Драйвер",
"Is the Passenger in your Car ?": "Пассажир в вашей машине?",
@@ -8204,7 +8217,7 @@ iOS [https://getapp.cc/app/6458734951]
"Best choice for comfort car and flexible route and stops point":
"Лучший выбор для комфортного автомобиля, гибкого маршрута и остановок.",
"Insert": "Вставлять",
"This is for delivery or a motorcycle.":
"This is for scooter or a motorcycle.":
"Это на доставку или мотоцикл.",
"This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route":
"Эта поездка идет прямо от отправной точки до пункта назначения по фиксированной цене. Водитель должен следовать запланированному маршруту",
@@ -9014,8 +9027,8 @@ iOS [https://getapp.cc/app/6458734951]
"Arrival time": "Orario di arrivo",
"arrival time to reach your point":
"orario di arrivo per raggiungere il tuo punto",
"For Speed and Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"Per i viaggi Speed e Delivery il prezzo viene calcolato dinamicamente. Per i viaggi Comfort il prezzo dipende dal tempo e dalla distanza",
"For Speed and scooter trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"Per i viaggi Speed e scooter il prezzo viene calcolato dinamicamente. Per i viaggi Comfort il prezzo dipende dal tempo e dalla distanza",
"Hello this is Driver": "Ciao, sono Driver",
"Is the Passenger in your Car ?": "Il passeggero è nella tua auto?",
"Please wait for the passenger to enter the car before starting the trip.":
@@ -9035,7 +9048,7 @@ iOS [https://getapp.cc/app/6458734951]
"Best choice for comfort car and flexible route and stops point":
"La scelta migliore per un'auto confortevole e un percorso flessibile e punti di sosta",
"Insert": "Inserire",
"This is for delivery or a motorcycle.":
"This is for scooter or a motorcycle.":
"Questo è per la consegna o una moto.",
"This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route":
"Questo viaggio va direttamente dal tuo punto di partenza alla tua destinazione a un prezzo fisso. L'autista deve seguire il percorso previsto",
@@ -9776,7 +9789,7 @@ iOS [https://getapp.cc/app/6458734951]
"Cost Of Trip IS": "旅行费用是",
"Arrival time": "到达时间",
"arrival time to reach your point": "到达目的地的到达时间",
"For Speed and Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"For Speed and scooter trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"对于速度和送货行程,价格是动态计算的。对于舒适旅行,价格根据时间和距离而定",
"Hello this is Driver": "你好,这是司机",
"Is the Passenger in your Car ?": "乘客在你的车里吗?",
@@ -9794,7 +9807,7 @@ iOS [https://getapp.cc/app/6458734951]
"Best choice for comfort car and flexible route and stops point":
"舒适用车、灵活路线和停靠点的最佳选择",
"Insert": "插入",
"This is for delivery or a motorcycle.": "这是用于送货或摩托车。",
"This is for scooter or a motorcycle.": "这是用于送货或摩托车。",
"This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route":
"此行程以固定价格直接从您的出发地前往目的地。司机必须按照计划的路线行驶",
"You can decline a request without any cost": "您可以拒绝请求,无需支付任何费用",

View File

@@ -1,4 +1,5 @@
import 'package:SEFER/controller/home/home_page_controller.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/colors.dart';
@@ -6,6 +7,10 @@ import 'package:SEFER/constant/style.dart';
import 'package:SEFER/views/lang/languages.dart';
import 'package:SEFER/views/widgets/my_scafold.dart';
import '../../constant/box_name.dart';
import '../../controller/profile/profile_controller.dart';
import '../../main.dart';
import '../widgets/elevated_btn.dart';
import 'HomePage/about_page.dart';
import 'HomePage/frequentlyQuestionsPage.dart';
import 'HomePage/trip_record_page.dart';
@@ -17,6 +22,16 @@ class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
Get.put(HomePageController());
final List<String> countryOptions = [
'Jordan',
'USA',
'Egypt',
'Turkey',
'Saudi Arabia',
'Qatar',
'Bahrain',
'Kuwait',
];
return MyScafolld(
isleading: true,
title: 'Home Page'.tr,
@@ -45,21 +60,7 @@ class HomePage extends StatelessWidget {
color: AppColor.primaryColor,
),
),
ListTile(
leading: const Icon(Icons.location_city_outlined),
title: Text(
'Change Country'.tr,
style: AppStyle.headTitle2,
),
subtitle: Text(
'You can change the Country to get all features'.tr,
style: AppStyle.title,
),
onTap: () => Get.to(MyScafolld(
title: 'Change Country'.tr,
body: [CountryPickerFromSetting()],
isleading: true)),
),
changeCountry(countryOptions),
ListTile(
leading: const Icon(Icons.question_answer),
title: Text(

View File

@@ -5,6 +5,7 @@ import 'package:SEFER/main.dart';
import 'package:SEFER/views/home/profile/passenger_profile_page.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:SEFER/views/widgets/my_dialog.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -45,29 +46,47 @@ List<CarType> carTypes = [
image: 'assets/images/lady.png',
),
CarType(
carType: 'Delivery',
carDetail: 'Delivery service'.tr,
carType: 'Scooter',
carDetail: 'Scooter service'.tr,
image: 'assets/images/moto.png',
),
CarType(
carType: 'Mashwari',
carDetail: 'Mashwari without end point'.tr,
carType: 'Mishwar Vip',
carDetail: 'Mishwar Vip without end point'.tr,
image: 'assets/images/freeRide.png',
),
CarType(
carType: 'Rayeh Gai',
carDetail: "Best choice for cities".tr,
image: 'assets/images/roundtrip.png',
),
];
class CarDetailsTypeToChoose extends StatelessWidget {
CarDetailsTypeToChoose({super.key});
final textToSpeechController = Get.put(TextToSpeechController());
@override
Widget build(BuildContext context) {
return GetBuilder<MapPassengerController>(
builder: (mapPassengerController) {
// Add a new CarType if the distance condition is met and the list has fewer than 6 items
if (mapPassengerController.distance > 40) {
carTypes.add(
CarType(
carType: 'Rayeh Gai',
carDetail: "Best choice for cities".tr,
image: 'assets/images/roundtrip.png',
),
);
if (carTypes.length > 7) {
carTypes.removeRange(7, carTypes.length);
}
} // Create a Set to remove duplicates based on the `carType` field
else if (carTypes.length > 6) {
carTypes.removeRange(6, carTypes.length);
}
Set<CarType> uniqueCarTypes = {};
uniqueCarTypes.addAll(carTypes);
// Convert the Set back to a List
carTypes = uniqueCarTypes.toList();
return mapPassengerController.data.isNotEmpty &&
mapPassengerController.isBottomSheetShown &&
mapPassengerController.rideConfirm == false
@@ -142,9 +161,9 @@ class CarDetailsTypeToChoose extends StatelessWidget {
? mapPassengerController
.totalPassengerBalash
.toStringAsFixed(2)
: carType.carType == 'Delivery'
: carType.carType == 'Scooter'
? mapPassengerController
.totalPassengerMotoDelivery
.totalPassengerScooter
.toStringAsFixed(2)
: carType.carType == 'Lady'
? mapPassengerController
@@ -153,7 +172,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
: carType.carType ==
'Rayeh Gai'
? mapPassengerController
.totalPassengerRayehGai
.totalPassengerRayehGaiBalash
.toStringAsFixed(
2)
: '50',
@@ -231,7 +250,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
: carType.carType == 'Balash' &&
(mapPassengerController
.totalPassengerBalash >
15)
20)
? Row(
children: [
Container(
@@ -400,19 +419,19 @@ class CarDetailsTypeToChoose extends StatelessWidget {
} else if (mapPassengerController
.selectedIndex ==
4) {
box.write(BoxName.carType, 'Delivery');
box.write(BoxName.carType, 'Scooter');
mapPassengerController.totalPassenger =
mapPassengerController
.totalPassengerMotoDelivery;
.totalPassengerScooter;
Get.defaultDialog(
title: 'Delivery'.tr,
title: 'Scooter'.tr,
titleStyle: AppStyle.title,
content: CarDialogue(
textToSpeechController:
textToSpeechController,
image: 'assets/images/moto.png',
text:
'This is for delivery or a motorcycle.'
'This is for Scooter or a motorcycle.'
.tr),
confirm: MyElevatedButton(
kolor: AppColor.greenColor,
@@ -434,17 +453,17 @@ class CarDetailsTypeToChoose extends StatelessWidget {
} else if (mapPassengerController
.selectedIndex ==
5) {
box.write(BoxName.carType, 'Mashwari');
box.write(BoxName.carType, 'Mishwar Vip');
mapPassengerController.totalPassenger = 50;
Get.defaultDialog(
title: 'Mashwari'.tr,
title: 'Mishwar Vip'.tr,
titleStyle: AppStyle.title,
content: CarDialogue(
textToSpeechController:
textToSpeechController,
image: 'assets/images/freeRide.png',
text:
'Perfect for adventure seekers who want to experience something new and exciting'
'A trip with a prior reservation, allowing you to choose the best captains and cars.'
.tr),
confirm: MyElevatedButton(
kolor: AppColor.greenColor,
@@ -541,29 +560,175 @@ class CarDetailsTypeToChoose extends StatelessWidget {
.selectedIndex ==
6) {
box.write(BoxName.carType, 'Rayeh Gai');
mapPassengerController.totalPassenger =
mapPassengerController.totalPassengerLady;
// mapPassengerController.totalPassenger =
// mapPassengerController.totalPassengerRayehGai;
Get.defaultDialog(
title: 'Rayeh Gai'.tr,
titleStyle: AppStyle.title,
content: CarDialogue(
textToSpeechController:
textToSpeechController,
image: 'assets/images/roundtrip.png',
text:
"Rayeh Gai: Round trip service for convenient travel between cities, easy and reliable."
.tr),
confirm: MyElevatedButton(
kolor: AppColor.greenColor,
title: 'Next'.tr,
onPressed: () {
Get.back();
mapPassengerController
.isBottomSheetShown = false;
mapPassengerController.update();
mapPassengerController
.changeCashConfirmPageShown();
}),
content: Column(
children: [
CarDialogue(
textToSpeechController:
textToSpeechController,
image:
'assets/images/roundtrip.png',
text:
"Rayeh Gai: Round trip service for convenient travel between cities, easy and reliable."
.tr),
const SizedBox(
height: 16,
),
Container(
decoration: AppStyle.boxDecoration,
child: Padding(
padding:
const EdgeInsets.all(8.0),
child: Text(
'Choose between those Type Cars'
.tr),
),
),
const SizedBox(
height: 16,
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceAround,
children: [
Container(
decoration:
AppStyle.boxDecoration,
child: InkWell(
onTap: () {
box.write(BoxName.carType,
'RayehGaiComfort');
mapPassengerController
.totalPassenger =
mapPassengerController
.totalPassengerRayehGaiComfort;
Get.back();
mapPassengerController
.isBottomSheetShown =
false;
mapPassengerController
.update();
mapPassengerController
.changeCashConfirmPageShown();
},
child: Padding(
padding:
const EdgeInsets.all(
8.0),
child: Column(
children: [
Text('Comfort'.tr),
Text(mapPassengerController
.totalPassengerRayehGaiComfort
.toString() +
r'$'),
],
),
),
)),
const SizedBox(
width: 10,
),
Container(
decoration:
AppStyle.boxDecoration,
child: InkWell(
onTap: () {
box.write(BoxName.carType,
'Speed');
mapPassengerController
.totalPassenger =
mapPassengerController
.totalPassengerRayehGai;
Get.back();
mapPassengerController
.isBottomSheetShown =
false;
mapPassengerController
.update();
mapPassengerController
.changeCashConfirmPageShown();
},
child: Padding(
padding:
const EdgeInsets.all(
8.0),
child: Column(
children: [
Text('Speed'.tr),
Text(mapPassengerController
.totalPassengerRayehGai
.toString() +
r'$'),
],
),
),
),
),
const SizedBox(
width: 10,
),
Container(
decoration:
AppStyle.boxDecoration,
child: InkWell(
onTap: () {
box.write(BoxName.carType,
'Balash');
mapPassengerController
.totalPassenger =
mapPassengerController
.totalPassengerRayehGaiBalash;
Get.back();
mapPassengerController
.isBottomSheetShown =
false;
mapPassengerController
.update();
mapPassengerController
.changeCashConfirmPageShown();
},
child: Padding(
padding:
const EdgeInsets.all(
8.0),
child: Column(
children: [
Text('Balash'.tr),
Text(mapPassengerController
.totalPassengerRayehGaiBalash
.toString() +
r'$'),
],
),
),
),
),
],
),
const SizedBox(
height: 16,
),
const SizedBox(
height: 16,
),
],
),
// confirm: MyElevatedButton(
// kolor: AppColor.greenColor,
// title: 'Next'.tr,
// onPressed: () {
// Get.back();
// mapPassengerController
// .isBottomSheetShown = false;
// mapPassengerController.update();
// mapPassengerController
// .changeCashConfirmPageShown();
// }),
cancel: MyElevatedButton(
title: 'Cancel'.tr,
kolor: AppColor.redColor,
@@ -588,6 +753,111 @@ class CarDetailsTypeToChoose extends StatelessWidget {
// ;
});
}
Future<dynamic> comfortDialougRayehgai(
MapPassengerController mapPassengerController) {
return Get.defaultDialog(
title: 'Comfort'.tr,
content: GetBuilder<MapPassengerController>(
builder: (mapPassengerController) {
return Column(
children: [
SizedBox(height: 60, child: HourPickerExample()),
const SizedBox(
height: 16,
),
SizedBox(
height: 30,
child: Text(box.read(BoxName.hourWait).toString() + 'hour'.tr ??
'1${'hour'.tr}'),
),
],
);
}),
confirm: MyElevatedButton(
kolor: AppColor.greenColor,
title: 'Next'.tr,
onPressed: () {
Get.back();
mapPassengerController.isBottomSheetShown = false;
mapPassengerController.update();
mapPassengerController.changeCashConfirmPageShown();
}),
cancel: MyElevatedButton(
title: 'Cancel'.tr,
kolor: AppColor.redColor,
onPressed: () {
Get.back();
}));
}
Future<dynamic> speedDialougRayehGai(
MapPassengerController mapPassengerController) {
return Get.defaultDialog(
title: 'Speed'.tr,
content: Column(
children: [
SizedBox(height: 60, child: HourPickerExample()),
const SizedBox(
height: 16,
),
SizedBox(
height: 30,
child: Text(box.read(BoxName.hourWait).toString() + 'hour'.tr ??
'1${'hour'.tr}'),
),
],
),
confirm: MyElevatedButton(
kolor: AppColor.greenColor,
title: 'Next'.tr,
onPressed: () {
Get.back();
mapPassengerController.isBottomSheetShown = false;
mapPassengerController.update();
mapPassengerController.changeCashConfirmPageShown();
}),
cancel: MyElevatedButton(
title: 'Cancel'.tr,
kolor: AppColor.redColor,
onPressed: () {
Get.back();
}));
}
Future<dynamic> balashDialougRayehGai(
MapPassengerController mapPassengerController) {
return Get.defaultDialog(
title: 'Balash'.tr,
content: Column(
children: [
SizedBox(height: 60, child: HourPickerExample()),
const SizedBox(
height: 16,
),
SizedBox(
height: 30,
child: Text(box.read(BoxName.hourWait).toString() + 'hour'.tr ??
'1${'hour'.tr}'),
),
],
),
confirm: MyElevatedButton(
kolor: AppColor.greenColor,
title: 'Next'.tr,
onPressed: () {
Get.back();
mapPassengerController.isBottomSheetShown = false;
mapPassengerController.update();
mapPassengerController.changeCashConfirmPageShown();
}),
cancel: MyElevatedButton(
title: 'Cancel'.tr,
kolor: AppColor.redColor,
onPressed: () {
Get.back();
}));
}
}
class BurcMoney extends StatelessWidget {
@@ -805,3 +1075,72 @@ class CarDialogue extends StatelessWidget {
);
}
}
class HourPickerExample extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () async {
int? selectedHour = await showCupertinoModalPopup<int>(
context: context,
builder: (BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
height: 200,
color: Colors.white,
child: Column(
children: [
CupertinoButton(
child: Text('Done'.tr),
onPressed: () {
Navigator.of(context).pop();
},
),
SizedBox(
height: 140,
child: CupertinoPicker(
itemExtent: 32.0,
onSelectedItemChanged: (int index) {
// Handle the selection
box.write(BoxName.hourWait, index);
// Navigator.pop(context, index + 1);
},
children: List<Widget>.generate(5, (int index) {
return Center(
child: Text('${index + 1} ${'hour'.tr}'),
);
}),
),
),
],
),
),
);
},
);
if (selectedHour != null) {
// Do something with the selected hour
print('Selected hour: $selectedHour');
}
},
child: Container(
// height: 70,
decoration: BoxDecoration(
border: Border.all(
color: AppColor.blueColor,
width: 3,
),
borderRadius: BorderRadius.circular(12)),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'How many hours would you like to wait?'.tr,
style: TextStyle(fontSize: 18),
),
),
),
);
}
}

View File

@@ -338,7 +338,7 @@ class MainBottomMenuMap extends StatelessWidget {
title: 'Yes'.tr,
onPressed: () async {
Get.back();
await controller.getLocation();
controller.getLocation();
await controller.getMap(
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
'${controller.recentPlaces[index]['latitude']},${controller.recentPlaces[index]['longitude']}',
@@ -606,7 +606,7 @@ class FaviouratePlacesDialog extends StatelessWidget {
TextButton(
onPressed: () async {
Get.back();
await controller.getLocation();
controller.getLocation();
await controller.getMap(
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',

View File

@@ -1,12 +1,14 @@
import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/controller/home/map_passenger_controller.dart';
import 'package:SEFER/env/env.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../constant/api_key.dart';
import '../../../print.dart';
class CupertinoDriverListWidget extends StatelessWidget {
MapPassengerController mapPassengerController =
@@ -30,7 +32,7 @@ class CupertinoDriverListWidget extends StatelessWidget {
leading: CircleAvatar(
radius: 25,
backgroundImage: NetworkImage(
'${AK.serverPHP}/portrate_captain_image/${driver['id']}.jpg',
'${Env.seferCairoServer}/portrate_captain_image/${driver['id']}.jpg',
),
backgroundColor: CupertinoColors.systemGrey5,
),
@@ -138,6 +140,7 @@ class CupertinoDriverListWidget extends StatelessWidget {
onPressed: () {
Get.back();
showDateTimePickerDialog(driver);
Log.print('driver: ${driver}');
}));
print('${'Selected driver'.tr}: ${driver['NAME']}');
// Get.back(); // Close the dialog
@@ -150,9 +153,18 @@ class CupertinoDriverListWidget extends StatelessWidget {
}
Color hexToColor(String hexColor) {
if (hexColor == null || hexColor.isEmpty || hexColor == 'null') {
// Return a default color if the hex color is invalid
return Colors.grey;
}
hexColor = hexColor.replaceAll("#", "");
String colorString = "ff$hexColor";
return Color(int.parse(colorString, radix: 16));
if (hexColor.length == 6) {
hexColor = "ff$hexColor";
} else if (hexColor.length != 8) {
// Return a default color if the hex color is not in the valid format
return Colors.grey;
}
return Color(int.parse(hexColor, radix: 16));
}
void showDriverSelectionDialog(Map<String, dynamic> driver) {
@@ -192,7 +204,23 @@ class CupertinoDriverListWidget extends StatelessWidget {
);
}
Future<void> confirmTripData(
Map<String, dynamic> driver, DateTime selectedDateTime) async {
try {
// Save trip data and set up notifications
// Log.print('selectedDateTime: $selectedDateTime');
// Log.print('driver: $driver');
await mapPassengerController.saveTripData(driver, selectedDateTime);
Get.back(); // Close the dialog
} catch (e) {
// Handle any errors that occur during the save process
Log.print('Error saving trip data: $e');
Get.snackbar('Error', 'Failed to save trip data');
}
}
void showDateTimePickerDialog(Map<String, dynamic> driver) {
Log.print('driver: ${driver}');
DateTime selectedDateTime = DateTime.now();
Get.defaultDialog(
@@ -209,12 +237,10 @@ class CupertinoDriverListWidget extends StatelessWidget {
),
confirm: MyElevatedButton(
title: 'Confirm Trip'.tr,
onPressed: () async {
onPressed: () {
DateTime selectedDateTime =
mapPassengerController.selectedDateTime.value;
// Save trip data and set up notifications
Get.back();
await mapPassengerController.saveTripData(driver, selectedDateTime);
confirmTripData(driver, selectedDateTime);
},
),
);

View File

@@ -393,6 +393,92 @@ class CountryPicker extends StatelessWidget {
}
}
ListTile changeCountry(List<String> countryOptions) {
return ListTile(
leading: const Icon(Icons.location_city_outlined),
title: Text(
'Change Country'.tr,
style: AppStyle.headTitle2,
),
subtitle: Text(
'You can change the Country to get all features'.tr,
style: AppStyle.title,
),
onTap: () => Get.to(MyScafolld(
title: 'Change Country'.tr,
// body: [],
body: [
GetBuilder<ProfileController>(builder: (controller) {
return Padding(
padding: const EdgeInsets.all(20.0),
child: ListView(
children: [
const SizedBox(
height: 20,
),
Text(
"Select Your Country".tr,
style: AppStyle.headTitle2,
textAlign: TextAlign.center,
),
// const SizedBox(
// height: 20,
// ),
Padding(
padding: const EdgeInsets.all(10),
child: Text(
"To ensure you receive the most accurate information for your location, please select your country below. This will help tailor the app experience and content to your country."
.tr,
style: AppStyle.title,
textAlign: TextAlign.center,
),
),
SizedBox(
height: 200,
child: CupertinoPicker(
itemExtent: 32,
onSelectedItemChanged: (int index) {
controller.setCountry(countryOptions[index]);
box.write(BoxName.countryCode,
countryOptions[index]); // Save in English
},
children: List.generate(
countryOptions.length,
(index) => Center(
child: Text(
countryOptions[index]
.tr, // Display translated if not English
style: AppStyle.title,
),
),
),
),
),
MyElevatedButton(
title:
'Select Country'.tr, // Use translated text for button
onPressed: () async {
// No conversion needed
box.write(
BoxName.countryCode, //
controller
.selectedCountry); // Already saved in English
Get.snackbar(controller.selectedCountry.toString().tr, '',
backgroundColor: AppColor.greenColor);
// Get.back();//
// Get.back();
},
)
],
),
);
})
],
isleading: true)),
);
}
class CountryPickerFromSetting extends StatelessWidget {
final ProfileController controller = Get.put(ProfileController());
final LoginController loginController = Get.put(LoginController());
@@ -462,8 +548,7 @@ class CountryPickerFromSetting extends StatelessWidget {
MyElevatedButton(
title: 'Select Country'.tr, // Use translated text for button
onPressed: () async {
loginController.saveCountryCode(controller.selectedCountry
.toString()); // No conversion needed
// No conversion needed
box.write(
BoxName.countryCode, //
controller.selectedCountry); // Already saved in English

View File

@@ -1733,7 +1733,7 @@ packages:
source: hosted
version: "0.7.0"
timezone:
dependency: transitive
dependency: "direct main"
description:
name: timezone
sha256: "2236ec079a174ce07434e89fcd3fcda430025eb7692244139a9cf54fdcf1fc7d"

View File

@@ -61,6 +61,7 @@ dependencies:
package_info_plus: ^8.0.0
uni_links: ^0.5.1
googleapis_auth: ^1.6.0
timezone: ^0.9.4
dev_dependencies:
flutter_test: