4/7/11
This commit is contained in:
@@ -28,7 +28,11 @@ class HomeCaptainController extends GetxController {
|
|||||||
late double kazan;
|
late double kazan;
|
||||||
double latePrice = 0;
|
double latePrice = 0;
|
||||||
double heavyPrice = 0;
|
double heavyPrice = 0;
|
||||||
double comfortPrice = 0, speedPrice = 0, deliveryPrice = 0, mashwariPrice = 0;
|
double comfortPrice = 0,
|
||||||
|
speedPrice = 0,
|
||||||
|
deliveryPrice = 0,
|
||||||
|
mashwariPrice = 0,
|
||||||
|
fuelPrice = 0;
|
||||||
double naturePrice = 0;
|
double naturePrice = 0;
|
||||||
bool isCallOn = false;
|
bool isCallOn = false;
|
||||||
String totalMoneyToday = '0';
|
String totalMoneyToday = '0';
|
||||||
@@ -256,6 +260,7 @@ class HomeCaptainController extends GetxController {
|
|||||||
deliveryPrice =
|
deliveryPrice =
|
||||||
double.parse(jsonDecode(res)['message'][0]['deliveryPrice']);
|
double.parse(jsonDecode(res)['message'][0]['deliveryPrice']);
|
||||||
mashwariPrice = double.parse(jsonDecode(res)['message'][0]['freePrice']);
|
mashwariPrice = double.parse(jsonDecode(res)['message'][0]['freePrice']);
|
||||||
|
fuelPrice = double.parse(jsonDecode(res)['message'][0]['fuelPrice']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -836,6 +836,13 @@ class MapDriverController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double mpg = 0;
|
||||||
|
calculateConsumptionFuel() {
|
||||||
|
mpg = Get.find<HomeCaptainController>().fuelPrice /
|
||||||
|
12; //todo in register car add mpg in box
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
late Duration durationToAdd;
|
late Duration durationToAdd;
|
||||||
int hours = 0;
|
int hours = 0;
|
||||||
int minutes = 0;
|
int minutes = 0;
|
||||||
@@ -910,6 +917,7 @@ class MapDriverController extends GetxController {
|
|||||||
durationToAdd = Duration(seconds: int.parse(duration));
|
durationToAdd = Duration(seconds: int.parse(duration));
|
||||||
hours = durationToAdd.inHours;
|
hours = durationToAdd.inHours;
|
||||||
minutes = (durationToAdd.inMinutes % 60).round();
|
minutes = (durationToAdd.inMinutes % 60).round();
|
||||||
|
calculateConsumptionFuel();
|
||||||
// cancelCheckRidefromPassenger();
|
// cancelCheckRidefromPassenger();
|
||||||
// checkIsDriverNearPassenger();
|
// checkIsDriverNearPassenger();
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
|||||||
@@ -2458,7 +2458,9 @@ class MapPassengerController extends GetxController {
|
|||||||
link: AppLink.getPassengerRate,
|
link: AppLink.getPassengerRate,
|
||||||
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
passengerRate = jsonDecode(res)['message']['rating'].toDouble();
|
passengerRate = jsonDecode(res)['message']['rating'] == null
|
||||||
|
? 5
|
||||||
|
: jsonDecode(res)['message']['rating'].toDouble();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,13 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
endIcon = value;
|
endIcon = value;
|
||||||
});
|
});
|
||||||
// }
|
// }
|
||||||
|
double mpg = 0;
|
||||||
|
calculateConsumptionFuel() {
|
||||||
|
mpg = Get.find<HomeCaptainController>().fuelPrice /
|
||||||
|
12; //todo in register car add mpg in box
|
||||||
|
}
|
||||||
|
|
||||||
|
calculateConsumptionFuel();
|
||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
title: 'Order Details'.tr,
|
title: 'Order Details'.tr,
|
||||||
body: [
|
body: [
|
||||||
@@ -278,7 +284,8 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: double.parse(myList[26]).toStringAsFixed(2),
|
text: (mpg * double.parse(myList[5]))
|
||||||
|
.toStringAsFixed(2),
|
||||||
style: AppStyle.headTitle2),
|
style: AppStyle.headTitle2),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -81,6 +81,11 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
endIcon = value;
|
endIcon = value;
|
||||||
});
|
});
|
||||||
// }
|
// }
|
||||||
|
double mpg = 0;
|
||||||
|
calculateConsumptionFuel() {
|
||||||
|
mpg = Get.find<HomeCaptainController>().fuelPrice /
|
||||||
|
12; //todo in register car add mpg in box
|
||||||
|
}
|
||||||
|
|
||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
title: 'Order Details'.tr,
|
title: 'Order Details'.tr,
|
||||||
@@ -287,7 +292,8 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: double.parse(myList[26]).toStringAsFixed(2),
|
text: (mpg * double.parse(myList[5]))
|
||||||
|
.toStringAsFixed(2),
|
||||||
style: AppStyle.headTitle2),
|
style: AppStyle.headTitle2),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user