This commit is contained in:
Hamza-Ayed
2024-07-20 14:18:06 +03:00
parent 27de944c2f
commit bdb910f3c2
14 changed files with 186 additions and 126 deletions

View File

@@ -108,7 +108,7 @@ class CaptainWalletController extends GetxController {
link: AppLink.getAllPaymentFromRide,
payload: {'driverID': box.read(BoxName.driverID)},
);
isLoading = false;
// isLoading = false;
if (res != 'failure') {
walletDate = jsonDecode(res);
totalAmount = walletDate['message'][0]['total_amount'] ?? '0';
@@ -120,11 +120,14 @@ class CaptainWalletController extends GetxController {
totalAmountVisa = walletDateVisa['message'][0]['diff'] ?? '0';
update();
} else {
totalAmount = "0";
totalAmountVisa = "0";
}
}
Future getCaptainWalletFromBuyPoints() async {
isLoading = true;
// isLoading = true;
update();
var res = await CRUD().get(
@@ -134,8 +137,7 @@ class CaptainWalletController extends GetxController {
isLoading = false;
// update();
walletDriverPointsDate = jsonDecode(res);
if (walletDriverPointsDate['message'][0]['driverID'].toString() ==
box.read(BoxName.driverID).toString()) {
if (res != 'failure') {
double totalPointsDouble = double.parse(
walletDriverPointsDate['message'][0]['total_amount'].toString());
totalPoints = totalPointsDouble.toStringAsFixed(0);