This commit is contained in:
Hamza Aleghwairyeen
2024-03-28 01:30:12 +03:00
parent 2c279a3c78
commit 508aff9670
3 changed files with 35 additions and 24 deletions

View File

@@ -115,6 +115,9 @@ class MapPassengerController extends GetxController {
bool startLocationFromMap3 = false; bool startLocationFromMap3 = false;
bool startLocationFromMap4 = false; bool startLocationFromMap4 = false;
List startLocationFromMapAll = []; List startLocationFromMapAll = [];
double latePrice = 0;
double heavyPrice = 0;
double naturePrice = 0;
bool heightMenuBool = false; bool heightMenuBool = false;
bool isPickerShown = false; bool isPickerShown = false;
bool isPointsPageForRider = false; bool isPointsPageForRider = false;
@@ -2144,18 +2147,18 @@ class MapPassengerController extends GetxController {
update(); update();
if (currentTime.hour >= 22 && currentTime.hour < 5) { if (currentTime.hour >= 22 && currentTime.hour < 5) {
costDistance = distance * 3.9; costDistance = distance * latePrice;
update(); update();
} else if (currentTime.hour >= 13 && currentTime.hour <= 16) { } else if (currentTime.hour >= 13 && currentTime.hour <= 16) {
if (averageDuration > 2.5) { if (averageDuration > 2.5) {
costDistance = distance * 4; costDistance = distance * heavyPrice;
update(); update();
} else { } else {
costDistance = distance * 3.5; costDistance = distance * naturePrice;
update(); update();
} }
} else { } else {
costDistance = distance * 3.4; costDistance = distance * (naturePrice - .1);
update(); update();
} }
//print('cost $cost'); //print('cost $cost');
@@ -2295,8 +2298,9 @@ class MapPassengerController extends GetxController {
var res = await CRUD().get(link: AppLink.getKazanPercent); var res = await CRUD().get(link: AppLink.getKazanPercent);
if (res != 'failure') { if (res != 'failure') {
kazan = double.parse(jsonDecode(res)['message'][0]['kazan']); kazan = double.parse(jsonDecode(res)['message'][0]['kazan']);
print(res); naturePrice = double.parse(jsonDecode(res)['message'][0]['naturePrice']);
print(kazan); heavyPrice = double.parse(jsonDecode(res)['message'][0]['heavyPrice']);
latePrice = double.parse(jsonDecode(res)['message'][0]['latePrice']);
} }
} }

View File

@@ -1,5 +1,6 @@
import 'package:SEFER/controller/home/captin/home_captain_controller.dart'; import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:SEFER/constant/box_name.dart'; import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/controller/firebase/firbase_messge.dart'; import 'package:SEFER/controller/firebase/firbase_messge.dart';
@@ -193,9 +194,10 @@ class OrderRequestPage extends StatelessWidget {
), ),
), ),
Container( Container(
height: Get.height * .15, height: Get.height * .15,width: Get.width*.9,
decoration: AppStyle.boxDecoration1, decoration: AppStyle.boxDecoration1,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -203,6 +205,7 @@ class OrderRequestPage extends StatelessWidget {
Column( Column(
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
const Icon( const Icon(
Icons.arrow_circle_up, Icons.arrow_circle_up,
@@ -211,9 +214,9 @@ class OrderRequestPage extends StatelessWidget {
Text( Text(
myList[12] + myList[12] +
' ' + ' ' +
'KM'.tr +
' ${myList[11]} ' + ' (${myList[11]}) '
'm'.tr, ,
style: AppStyle.title, style: AppStyle.title,
), ),
], ],
@@ -226,36 +229,38 @@ class OrderRequestPage extends StatelessWidget {
), ),
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Column(
children: [ children: [
Column( Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
const Icon( const Icon(
Icons.arrow_circle_down, Icons.arrow_circle_up,
color: AppColor.redColor, color: AppColor.greenColor,
), ),
Text( Text(
myList[5] + myList[5] +
' ' + ' ' +
'KM'.tr +
' ${myList[11]} ' + ' (${myList[4]}) '
'm'.tr, ,
style: AppStyle.title, style: AppStyle.title,
), ),
], ],
), ),
Text( Text(
myList[30] + ' ' + 'KM'.tr, myList[30],
style: AppStyle.title, style: AppStyle.title,
), ),
], ],
), ),
], ],
), ),
],
],
), ),
), ),
Padding( Padding(
@@ -263,9 +268,9 @@ class OrderRequestPage extends StatelessWidget {
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: 'Passenger Name is '.tr, text: 'Passenger Name is '.tr,
style: AppStyle.title, style: AppStyle.subtitle,
children: [ children: [
TextSpan(text: myList[8], style: AppStyle.headTitle2), TextSpan(text: myList[8], style: AppStyle.title),
], ],
), ),
), ),
@@ -380,7 +385,7 @@ class OrderRequestPage extends StatelessWidget {
// print(bodyToPassenger); // print(bodyToPassenger);
FirebaseMessagesController() FirebaseMessagesController()
.sendNotificationToPassengerToken( .sendNotificationToPassengerToken(
'Apply Ride','your ride is applied'.tr, 'Apply Ride', 'your ride is applied'.tr,
// arguments['DriverList'][9].toString(), // arguments['DriverList'][9].toString(),
arguments['DriverList'][9].toString(), arguments['DriverList'][9].toString(),
// box.read(BoxName.tokenDriver).toString(), // box.read(BoxName.tokenDriver).toString(),

View File

@@ -165,7 +165,9 @@ class GoogleMapPassengerWidget extends StatelessWidget {
// anchor: const Offset(4, 4), // anchor: const Offset(4, 4),
position: carLocation, position: carLocation,
icon: controller.carIcon, icon: controller.carIcon,
rotation: controller.headingList, rotation: double.parse(controller
.datadriverCarsLocationToPassengerAfterApplied[
'message'][0]['latitude']),
markerId: MarkerId(carLocation.toString())), markerId: MarkerId(carLocation.toString())),
for (int i = 1; for (int i = 1;
i < controller.coordinatesWithoutEmpty.length - 1; i < controller.coordinatesWithoutEmpty.length - 1;