12/12/1
This commit is contained in:
@@ -52,6 +52,8 @@ class HelpController extends GetxController {
|
||||
});
|
||||
if (res == "failure") {
|
||||
// print(res);
|
||||
isLoading = false;
|
||||
update();
|
||||
Get.defaultDialog(
|
||||
title: 'There is no help Question here'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
|
||||
@@ -14,6 +14,7 @@ class CaptainWalletController extends GetxController {
|
||||
final formKey = GlobalKey<FormState>();
|
||||
String totalAmount = '0';
|
||||
String totalPoints = '0';
|
||||
|
||||
Future getCaptainWalletFromRide() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
@@ -37,8 +38,14 @@ class CaptainWalletController extends GetxController {
|
||||
payload: {'driverID': box.read(BoxName.driverID)},
|
||||
);
|
||||
walletDriverPointsDate = jsonDecode(res);
|
||||
totalPoints =
|
||||
walletDriverPointsDate['message'][0]['total_amount'].toString();
|
||||
if (walletDriverPointsDate['message'][0]['driverID'].toString() ==
|
||||
box.read(BoxName.driverID)) {
|
||||
totalPoints =
|
||||
walletDriverPointsDate['message'][0]['total_amount'].toString();
|
||||
} else {
|
||||
totalPoints = '0';
|
||||
}
|
||||
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
@@ -64,10 +71,25 @@ class CaptainWalletController extends GetxController {
|
||||
});
|
||||
}
|
||||
|
||||
//check if account bank is created or not
|
||||
Future checkAccountCaptainBank() async {
|
||||
if (box.read(BoxName.accountIdStripeConnect).toString().isEmpty) {
|
||||
var res = await CRUD().get(link: AppLink.getAccount, payload: {
|
||||
'id': box.read(BoxName.driverID).toString(),
|
||||
});
|
||||
var d = jsonDecode(res);
|
||||
if (d['status'] != 'failure') {
|
||||
box.write(BoxName.accountIdStripeConnect,
|
||||
d['message'][0]['accountBank'].toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
getCaptainWalletFromRide();
|
||||
getCaptainWalletFromBuyPoints();
|
||||
checkAccountCaptainBank();
|
||||
super.onInit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user