This commit is contained in:
Hamza Aleghwairyeen
2024-04-16 10:22:01 +03:00
parent a2d4cd845c
commit 24b3804045
18 changed files with 457 additions and 226 deletions

View File

@@ -248,19 +248,22 @@ class HomeCaptainController extends GetxController {
}
getKazanPercent() async {
var res = await CRUD().get(link: AppLink.getKazanPercent);
var res = await CRUD().get(
link: AppLink.getKazanPercent,
payload: {'country': box.read(BoxName.countryCode).toString()},
);
if (res != 'failure') {
kazan = double.parse(jsonDecode(res)['message'][0]['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']);
comfortPrice =
double.parse(jsonDecode(res)['message'][0]['comfortPrice']);
speedPrice = double.parse(jsonDecode(res)['message'][0]['speedPrice']);
deliveryPrice =
double.parse(jsonDecode(res)['message'][0]['deliveryPrice']);
mashwariPrice = double.parse(jsonDecode(res)['message'][0]['freePrice']);
fuelPrice = double.parse(jsonDecode(res)['message'][0]['fuelPrice']);
var json = jsonDecode(res);
kazan = double.parse(json['message'][0]['kazan']);
naturePrice = double.parse(json['message'][0]['naturePrice']);
heavyPrice = double.parse(json['message'][0]['heavyPrice']);
latePrice = double.parse(json['message'][0]['latePrice']);
comfortPrice = double.parse(json['message'][0]['comfortPrice']);
speedPrice = double.parse(json['message'][0]['speedPrice']);
deliveryPrice = double.parse(json['message'][0]['deliveryPrice']);
mashwariPrice = double.parse(json['message'][0]['freePrice']);
fuelPrice = double.parse(json['message'][0]['fuelPrice']);
print(json);
}
}