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