This commit is contained in:
Hamza Aleghwairyeen
2024-04-12 03:13:24 +03:00
parent 40ec1a5362
commit a84a304c72
7 changed files with 92 additions and 46 deletions

View File

@@ -76,7 +76,7 @@ class MapDriverController extends GetxController {
bool isRideFinished = false; bool isRideFinished = false;
bool isRideStarted = false; bool isRideStarted = false;
bool isPriceWindow = false; bool isPriceWindow = false;
double passengerInfoWindowHeight = Get.height * .4; double passengerInfoWindowHeight = Get.height * .35;
double driverEndPage = 100; double driverEndPage = 100;
double progress = 0; double progress = 0;
double progressToPassenger = 0; double progressToPassenger = 0;
@@ -880,8 +880,8 @@ class MapDriverController extends GetxController {
? ( ? (
await getMapDestination(step0, step1), await getMapDestination(step0, step1),
await getMapDestination(step1, step2), await getMapDestination(step1, step2),
await getMapDestination(step2, step3), step3 == '' ? await getMapDestination(step2, step3) : () {},
await getMapDestination(step3, step4), step4 == '' ? await getMapDestination(step3, step4) : () {},
) )
: await getMapDestination(passengerLocation, passengerDestination); : await getMapDestination(passengerLocation, passengerDestination);
addCustomCarIcon(); addCustomCarIcon();

View File

@@ -252,7 +252,7 @@ class MapPassengerController extends GetxController {
isWayPointStopsSheetUtilGetMap = false; isWayPointStopsSheetUtilGetMap = false;
isWayPointSheet = false; isWayPointSheet = false;
durationToRide = 0; durationToRide = 0;
distanceOfDestnation = 0; distanceOfDestination = 0;
wayPointSheetHeight = 0; wayPointSheetHeight = 0;
remainingTime = 25; remainingTime = 25;
haveSteps = true; haveSteps = true;
@@ -960,7 +960,7 @@ class MapPassengerController extends GetxController {
placesCoordinate[2], placesCoordinate[2],
placesCoordinate[3], placesCoordinate[3],
placesCoordinate[4], placesCoordinate[4],
costDistance.toStringAsFixed(2), costForDriver.toStringAsFixed(2),
double.parse(box.read(BoxName.passengerWalletTotal)) < 0 double.parse(box.read(BoxName.passengerWalletTotal)) < 0
? double.parse(box.read(BoxName.passengerWalletTotal)) ? double.parse(box.read(BoxName.passengerWalletTotal))
.toStringAsFixed(2) .toStringAsFixed(2)
@@ -1038,7 +1038,7 @@ class MapPassengerController extends GetxController {
placesCoordinate[2], placesCoordinate[2],
placesCoordinate[3], placesCoordinate[3],
placesCoordinate[4], placesCoordinate[4],
costDistance.toStringAsFixed(2), costForDriver.toStringAsFixed(2),
double.parse(box.read(BoxName.passengerWalletTotal)) < 0 double.parse(box.read(BoxName.passengerWalletTotal)) < 0
? double.parse(box.read(BoxName.passengerWalletTotal)) ? double.parse(box.read(BoxName.passengerWalletTotal))
.toStringAsFixed(2) .toStringAsFixed(2)
@@ -2002,8 +2002,8 @@ class MapPassengerController extends GetxController {
} }
late LatLngBounds boundsData; late LatLngBounds boundsData;
late String startNameAddress; late String startNameAddress = '';
late String endNameAddress; late String endNameAddress = '';
getMap(String origin, destination) async { getMap(String origin, destination) async {
remainingTime = 25; //to make cancel every call remainingTime = 25; //to make cancel every call
await getCarsLocationByPassengerAndReloadMarker(); await getCarsLocationByPassengerAndReloadMarker();
@@ -2094,7 +2094,7 @@ class MapPassengerController extends GetxController {
} }
} }
double distanceOfDestnation = 0; double distanceOfDestination = 0;
bool haveSteps = false; bool haveSteps = false;
late LatLng latestPosition; late LatLng latestPosition;
// getMapPoints(String originSteps, String destinationSteps, int index) async { // getMapPoints(String originSteps, String destinationSteps, int index) async {
@@ -2172,7 +2172,7 @@ class MapPassengerController extends GetxController {
durationToRide = durationToRide + durationToRide0; durationToRide = durationToRide + durationToRide0;
print(durationToRide0); print(durationToRide0);
print('durationToRide = $durationToRide'); print('durationToRide = $durationToRide');
distance = distanceOfDestnation + (data[0]['distance']['value']) / 1000; distance = distanceOfDestination + (data[0]['distance']['value']) / 1000;
update(); update();
final points = final points =
@@ -2308,6 +2308,7 @@ class MapPassengerController extends GetxController {
return distance; return distance;
} }
double costForDriver = 0;
Future bottomSheet() async { Future bottomSheet() async {
if (data.isNotEmpty) { if (data.isNotEmpty) {
durationToAdd = Duration(seconds: durationToRide); durationToAdd = Duration(seconds: durationToRide);
@@ -2361,6 +2362,7 @@ class MapPassengerController extends GetxController {
totalDriver = totalDriver1 + (totalDriver1 * kazan / 100); totalDriver = totalDriver1 + (totalDriver1 * kazan / 100);
tax = totalCostPassenger * kazan / 100; tax = totalCostPassenger * kazan / 100;
totalME = totalCostPassenger - tax; totalME = totalCostPassenger - tax;
costForDriver = fuelPrice * 12;
if (totalCostPassenger < 1) { if (totalCostPassenger < 1) {
totalCostPassenger = 1; totalCostPassenger = 1;

View File

@@ -442,6 +442,8 @@ class MyTranslation extends Translations {
'Total points is ': "إجمالي النقاط هو", 'Total points is ': "إجمالي النقاط هو",
'Total Connection Duration:': "إجمالي مدة الإتصال:", 'Total Connection Duration:': "إجمالي مدة الإتصال:",
' H and': "ساعة و", ' H and': "ساعة و",
'Passenger name : ': 'إسم الراكب',
'Cost Of Trip IS ': 'تكلفة الرحلة',
'Arrival time': 'وقت الوصول ', 'Arrival time': 'وقت الوصول ',
'arrival time to reach your point': 'الوقت المتوقع للوصول إلى وجهتك ', '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 Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance':

View File

@@ -32,8 +32,8 @@ class PassengerInfoWindow extends StatelessWidget {
child: AnimatedContainer( child: AnimatedContainer(
duration: const Duration(milliseconds: 300), duration: const Duration(milliseconds: 300),
height: controller.passengerInfoWindowHeight, height: controller.passengerInfoWindowHeight,
width: Get.width * .99, width: Get.width * .9,
decoration: AppStyle.boxDecoration, decoration: AppStyle.boxDecoration1,
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@@ -112,42 +112,86 @@ class PassengerInfoWindow extends StatelessWidget {
)), )),
Row( Row(
children: [ children: [
Text( Container(
controller.hours > 1 decoration: AppStyle.boxDecoration1,
? '⌚️ ${controller.hours}h ${controller.minutes}m' // Ride Duration with emoji width: Get.width * .2,
: '⌚️ ${controller.minutes}m', // Short ride duration child: Padding(
style: AppStyle.title, padding: const EdgeInsets.all(4.0),
child: Text(
controller.hours > 1
? '⌚️ ${controller.hours}h ${controller.minutes}m' // Ride Duration with emoji
: '⌚️ ${controller.minutes}m', // Short ride duration
style: AppStyle.number,
),
),
), ),
const SizedBox( const SizedBox(
width: 16.0), // Add spacing between sections width: 16.0), // Add spacing between sections
Text( Container(
' ${controller.distance}km', // Distance with emoji decoration: AppStyle.boxDecoration1,
style: AppStyle.title, width: Get.width * .2,
child: Padding(
padding: const EdgeInsets.all(4),
child: Text(
' ${controller.distance} km', // Distance with emoji
style: AppStyle.number,
),
),
), ),
const SizedBox( const SizedBox(
width: 16.0), // Add spacing between sections width: 16.0), // Add spacing between sections
Text( Container(
' ${controller.passengerName}', // Passenger name with emoji decoration: AppStyle.boxDecoration1,
style: AppStyle.title, width: Get.width * .2,
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Text(
controller
.passengerName, // Passenger name with emoji
style: AppStyle.title,
),
),
), ),
], ],
), ),
Card( Row(
elevation: 5, mainAxisAlignment: MainAxisAlignment.spaceAround,
color: AppColor.greenColor, children: [
child: Padding( Container(
padding: const EdgeInsets.all(4), decoration: AppStyle.boxDecoration1,
child: Row( width: Get.width * .5,
children: [ child: Padding(
Text('Total Cost is '.tr, padding: const EdgeInsets.all(4),
style: AppStyle.title), child: Row(
Text( children: [
controller.totalPassenger.toString(), Text('Total Cost is '.tr,
style: AppStyle.title, style: AppStyle.title),
Text(
controller.totalPassenger.toString(),
style: AppStyle.title,
),
],
), ),
], ),
), ),
), Container(
decoration: AppStyle.boxDecoration1,
width: Get.width * .2,
child: Padding(
padding: const EdgeInsets.all(4),
child: Row(
children: [
Text(controller.carType,
style: AppStyle.title),
Text(
controller.totalPassenger.toString(),
style: AppStyle.title,
),
],
),
),
),
],
), ),
controller.remainingTimeToPassenger != 0 controller.remainingTimeToPassenger != 0
? Stack( ? Stack(

View File

@@ -251,7 +251,8 @@ class OrderRequestPage extends StatelessWidget {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: 'Passenger: '.tr, // Changed text to be more generic text: 'Passenger name : '
.tr, // Changed text to be more generic
style: AppStyle.subtitle, style: AppStyle.subtitle,
children: [ children: [
TextSpan( TextSpan(
@@ -279,9 +280,7 @@ class OrderRequestPage extends StatelessWidget {
style: AppStyle.title, style: AppStyle.title,
children: [ children: [
TextSpan( TextSpan(
text: text: myList[27], style: AppStyle.headTitle2),
orderRequestController.mpg.toStringAsFixed(0),
style: AppStyle.headTitle2),
], ],
), ),
), ),

View File

@@ -266,7 +266,8 @@ class OrderSpeedRequest extends StatelessWidget {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: 'Passenger: '.tr, // Changed text to be more generic text: 'Passenger name : '
.tr, // Changed text to be more generic
style: AppStyle.subtitle, style: AppStyle.subtitle,
children: [ children: [
TextSpan( TextSpan(
@@ -292,9 +293,7 @@ class OrderSpeedRequest extends StatelessWidget {
text: 'Cost Of Trip IS '.tr, text: 'Cost Of Trip IS '.tr,
style: AppStyle.title, style: AppStyle.title,
children: [ children: [
TextSpan( TextSpan(text: myList[27], style: AppStyle.headTitle2),
text: orderRequestController.mpg.toStringAsFixed(0),
style: AppStyle.headTitle2),
], ],
), ),
), ),

View File

@@ -155,7 +155,7 @@ class RideFromStartApp extends StatelessWidget {
print(phoneNumber); // Output: 798583061 print(phoneNumber); // Output: 798583061
var phone = var phone =
// '+${box.read(BoxName.countryCode)}${box.read(BoxName.sosPhonePassenger)}'; // '+${box.read(BoxName.countryCode)}${box.read(BoxName.sosPhonePassenger)}';
'+20${box.read(BoxName.sosPhonePassenger)}'; '${box.read(BoxName.sosPhonePassenger)}';
controller.sendWhatsapp(phone); controller.sendWhatsapp(phone);
} }
}, },