This commit is contained in:
Hamza-Ayed
2024-07-07 19:23:54 +03:00
parent 50a89e02cf
commit 1589c215df
18 changed files with 602 additions and 474 deletions

View File

@@ -264,10 +264,29 @@ class CaptainWalletController extends GetxController {
update();
}
getKazanPercent() async {
var res = await CRUD().get(
link: AppLink.getKazanPercent,
payload: {'country': box.read(BoxName.countryCode).toString()},
);
if (res != 'failure') {
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']);
}
update();
}
@override
void onInit() async {
await Get.find<HomeCaptainController>().getKazanPercent();
kazan = Get.find<HomeCaptainController>().kazan;
getKazanPercent();
await refreshCaptainWallet();
super.onInit();