Update: 2026-06-27 05:36:53
This commit is contained in:
@@ -71,7 +71,7 @@ class LoginDriverController extends GetxController {
|
||||
await CountryLogic.initializeCountry();
|
||||
// box.write(BoxName.driverID, '34feffd3fa72d6bee56b');
|
||||
// await getAppTester();
|
||||
getJWT();
|
||||
await getJWT();
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@@ -147,8 +147,9 @@ class LoginDriverController extends GetxController {
|
||||
return;
|
||||
}
|
||||
Log.print('Security check passed');
|
||||
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
|
||||
dev = Platform.isAndroid ? 'android' : 'ios';
|
||||
var fingerPrint = box.read(BoxName.deviceFingerprint)?.toString() ??
|
||||
await DeviceHelper.getDeviceFingerprint();
|
||||
var payload = {
|
||||
'id': box.read(BoxName.driverID),
|
||||
'password': AK.passnpassenger,
|
||||
@@ -389,6 +390,9 @@ class LoginDriverController extends GetxController {
|
||||
|
||||
// ✅ الحصول على توكن access بدل registration قبل أي طلبات بعد تسجيل الدخول
|
||||
Log.print('🔑 Getting access token after login...');
|
||||
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
|
||||
await storage.write(
|
||||
key: BoxName.fingerPrint, value: fingerPrint.toString());
|
||||
await getJWT();
|
||||
Log.print('🔑 Access token obtained.');
|
||||
|
||||
@@ -406,10 +410,6 @@ class LoginDriverController extends GetxController {
|
||||
payload: {
|
||||
'captain_id': (box.read(BoxName.driverID)).toString()
|
||||
});
|
||||
|
||||
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
|
||||
await storage.write(
|
||||
key: BoxName.fingerPrint, value: fingerPrint.toString());
|
||||
// print(jsonDecode(token)['data'][0]['token'].toString());
|
||||
// print(box.read(BoxName.tokenDriver).toString());
|
||||
// if (box.read(BoxName.emailDriver).toString() !=
|
||||
|
||||
@@ -554,6 +554,15 @@ class ScanDocumentsByApi extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
if (responseString.isNotEmpty) {
|
||||
try {
|
||||
final decoded = jsonDecode(responseString);
|
||||
if (decoded['status'] == 'success' && decoded['message']['file_link'] != null) {
|
||||
box.write(BoxName.driverPhotoUrl, decoded['message']['file_link'].toString());
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
isLoading = false;
|
||||
update();
|
||||
|
||||
|
||||
@@ -35,15 +35,17 @@ Future<void> getPermissionOverlay() async {
|
||||
Future<void> showDriverGiftClaim(BuildContext context) async {
|
||||
if (box.read(BoxName.is_claimed).toString() == '0' ||
|
||||
box.read(BoxName.is_claimed) == null) {
|
||||
final country = box.read(BoxName.countryCode)?.toString() ?? 'Jordan';
|
||||
final giftAmount = country == 'Jordan' ? '3' : '300';
|
||||
MyDialog().getDialog(
|
||||
'You have gift 300 ${CurrencyHelper.currency}'.tr, 'This for new registration'.tr, () async {
|
||||
'You have gift $giftAmount ${CurrencyHelper.currency}'.tr, 'This for new registration'.tr, () async {
|
||||
Get.back();
|
||||
var res = await CRUD().post(link: AppLink.updateDriverClaim, payload: {
|
||||
'driverId': box.read(BoxName.driverID),
|
||||
});
|
||||
if (res != 'failure') {
|
||||
Get.find<CaptainWalletController>()
|
||||
.addDriverWallet('new driver', '300', '300');
|
||||
.addDriverWallet('new driver', giftAmount, giftAmount);
|
||||
Confetti.launch(
|
||||
context,
|
||||
options:
|
||||
|
||||
@@ -130,6 +130,9 @@ class SplashScreenController extends GetxController
|
||||
await initializer.initializeApp();
|
||||
await EncryptionHelper.initialize();
|
||||
|
||||
await DeviceHelper.getDeviceFingerprint();
|
||||
await loginController.getJWT();
|
||||
|
||||
await loginController.loginDriver(
|
||||
box.read(BoxName.driverID).toString(),
|
||||
box.read(BoxName.emailDriver).toString(),
|
||||
|
||||
Reference in New Issue
Block a user