Update: 2026-07-21 20:40:48
This commit is contained in:
@@ -110,6 +110,7 @@ class BoxName {
|
|||||||
static const String tripData = 'tripData';
|
static const String tripData = 'tripData';
|
||||||
static const String parentTripSelected = 'parentTripSelected';
|
static const String parentTripSelected = 'parentTripSelected';
|
||||||
static const String styleVersion = 'styleVersion';
|
static const String styleVersion = 'styleVersion';
|
||||||
static const String isDestinationMatch = 'isDestinationMatch'; // 🆕 AI Destination Matching
|
static const String isDestinationMatch =
|
||||||
|
'isDestinationMatch'; // 🆕 AI Destination Matching
|
||||||
static const String isPrime = 'isPrime'; // 👑 Siro Prime subscription status
|
static const String isPrime = 'isPrime'; // 👑 Siro Prime subscription status
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,8 +127,8 @@ class LoginController extends GetxController {
|
|||||||
|
|
||||||
if (jwt != null) {
|
if (jwt != null) {
|
||||||
// نشفر الـ JWT بالتشفير الثلاثي قبل التخزين في GetStorage
|
// نشفر الـ JWT بالتشفير الثلاثي قبل التخزين في GetStorage
|
||||||
box.write(BoxName.jwt, c(jwt));
|
box.write(BoxName.jwt, (jwt));
|
||||||
storage.write(key: BoxName.jwt, value: c(jwt));
|
storage.write(key: BoxName.jwt, value: (jwt));
|
||||||
}
|
}
|
||||||
|
|
||||||
await EncryptionHelper.initialize();
|
await EncryptionHelper.initialize();
|
||||||
@@ -159,8 +159,8 @@ class LoginController extends GetxController {
|
|||||||
: decoded['jwt']);
|
: decoded['jwt']);
|
||||||
|
|
||||||
if (jwt != null) {
|
if (jwt != null) {
|
||||||
box.write(BoxName.jwt, c(jwt));
|
box.write(BoxName.jwt, (jwt));
|
||||||
storage.write(key: BoxName.jwt, value: c(jwt));
|
storage.write(key: BoxName.jwt, value: (jwt));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -481,7 +481,8 @@ class LoginController extends GetxController {
|
|||||||
'fingerPrint': fingerPrint,
|
'fingerPrint': fingerPrint,
|
||||||
'aud': '${AK.allowed}${Platform.isAndroid ? 'android' : 'ios'}',
|
'aud': '${AK.allowed}${Platform.isAndroid ? 'android' : 'ios'}',
|
||||||
};
|
};
|
||||||
Log.print("Tester Login Payload: email=${payload['email']}, password=${payload['password']}, aud=${payload['aud']}");
|
Log.print(
|
||||||
|
"Tester Login Payload: email=${payload['email']}, password=${payload['password']}, aud=${payload['aud']}");
|
||||||
|
|
||||||
var response = await http.post(
|
var response = await http.post(
|
||||||
Uri.parse(AppLink.loginUsingCredentialsWithoutGooglePassenger),
|
Uri.parse(AppLink.loginUsingCredentialsWithoutGooglePassenger),
|
||||||
@@ -498,8 +499,8 @@ class LoginController extends GetxController {
|
|||||||
|
|
||||||
// حفظ التوكن
|
// حفظ التوكن
|
||||||
if (jwt != null) {
|
if (jwt != null) {
|
||||||
box.write(BoxName.jwt, c(jwt));
|
box.write(BoxName.jwt, (jwt));
|
||||||
await storage.write(key: BoxName.jwt, value: c(jwt));
|
await storage.write(key: BoxName.jwt, value: (jwt));
|
||||||
}
|
}
|
||||||
|
|
||||||
box.write(BoxName.isVerified, '1');
|
box.write(BoxName.isVerified, '1');
|
||||||
@@ -563,33 +564,39 @@ class LoginController extends GetxController {
|
|||||||
}
|
}
|
||||||
if (!serviceEnabled) {
|
if (!serviceEnabled) {
|
||||||
// Location services are still not enabled, show a message
|
// Location services are still not enabled, show a message
|
||||||
mySnackbarError('Please enable location services in your device settings to continue.'.tr);
|
mySnackbarError(
|
||||||
|
'Please enable location services in your device settings to continue.'
|
||||||
|
.tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the app has permission to access location
|
// Check if the app has permission to access location
|
||||||
permissionGranted = await location.hasPermission();
|
permissionGranted = await location.hasPermission();
|
||||||
|
|
||||||
if (permissionGranted == loc.PermissionStatus.deniedForever) {
|
if (permissionGranted == loc.PermissionStatus.deniedForever) {
|
||||||
mySnackbarError('Please go to app settings and grant location permission.'.tr);
|
mySnackbarError(
|
||||||
|
'Please go to app settings and grant location permission.'.tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (permissionGranted == loc.PermissionStatus.denied) {
|
if (permissionGranted == loc.PermissionStatus.denied) {
|
||||||
permissionGranted = await location.requestPermission();
|
permissionGranted = await location.requestPermission();
|
||||||
if (permissionGranted != loc.PermissionStatus.granted && permissionGranted != loc.PermissionStatus.grantedLimited) {
|
if (permissionGranted != loc.PermissionStatus.granted &&
|
||||||
|
permissionGranted != loc.PermissionStatus.grantedLimited) {
|
||||||
// Location permission is still not granted, handle the error
|
// Location permission is still not granted, handle the error
|
||||||
mySnackbarError('Location permission is required to use the app. Please grant permission.'.tr);
|
mySnackbarError(
|
||||||
|
'Location permission is required to use the app. Please grant permission.'
|
||||||
|
.tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize geofencing now that we have permission
|
// Initialize geofencing now that we have permission
|
||||||
if (Platform.isAndroid || Platform.isIOS) {
|
if (Platform.isAndroid || Platform.isIOS) {
|
||||||
await SiroGeofencingService.initAndStart();
|
await SiroGeofencingService.initAndStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (permissionGranted.toString() == 'PermissionStatus.granted' ||
|
if (permissionGranted.toString() == 'PermissionStatus.granted' ||
|
||||||
permissionGranted == loc.PermissionStatus.granted ||
|
permissionGranted == loc.PermissionStatus.granted ||
|
||||||
permissionGranted == loc.PermissionStatus.grantedLimited) {
|
permissionGranted == loc.PermissionStatus.grantedLimited) {
|
||||||
@@ -598,7 +605,6 @@ class LoginController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ─────────────────────────────────────────────────────────────
|
// ─────────────────────────────────────────────────────────────
|
||||||
// sendPassengerLocation: تسجيل موقع فتح التطبيق للراكب
|
// sendPassengerLocation: تسجيل موقع فتح التطبيق للراكب
|
||||||
// ─────────────────────────────────────────────────────────────
|
// ─────────────────────────────────────────────────────────────
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import '../../../print.dart';
|
|||||||
import '../../views/auth/otp_page.dart';
|
import '../../views/auth/otp_page.dart';
|
||||||
import '../../views/widgets/error_snakbar.dart';
|
import '../../views/widgets/error_snakbar.dart';
|
||||||
import '../functions/crud.dart';
|
import '../functions/crud.dart';
|
||||||
|
import '../functions/encrypt_decrypt.dart';
|
||||||
import '../functions/package_info.dart';
|
import '../functions/package_info.dart';
|
||||||
import '../functions/country_logic.dart';
|
import '../functions/country_logic.dart';
|
||||||
import 'login_controller.dart';
|
import 'login_controller.dart';
|
||||||
@@ -16,7 +17,8 @@ class PhoneAuthHelper {
|
|||||||
// Define your server URLs
|
// Define your server URLs
|
||||||
static final String _sendOtpUrl = '${AppLink.server}/auth/otp/request.php';
|
static final String _sendOtpUrl = '${AppLink.server}/auth/otp/request.php';
|
||||||
static final String _verifyOtpUrl = '${AppLink.server}/auth/otp/verify.php';
|
static final String _verifyOtpUrl = '${AppLink.server}/auth/otp/verify.php';
|
||||||
static final String _registerUrl = '${AppLink.server}/auth/passenger/register.php';
|
static final String _registerUrl =
|
||||||
|
'${AppLink.server}/auth/passenger/register.php';
|
||||||
|
|
||||||
// removed formatSyrianPhone
|
// removed formatSyrianPhone
|
||||||
|
|
||||||
@@ -82,6 +84,14 @@ class PhoneAuthHelper {
|
|||||||
Log.print('isRegistered: ${isRegistered}');
|
Log.print('isRegistered: ${isRegistered}');
|
||||||
|
|
||||||
if (isRegistered) {
|
if (isRegistered) {
|
||||||
|
final jwtToken = data['message']?['jwt'] ??
|
||||||
|
data['message']?['token'] ??
|
||||||
|
data['message']?['access_token'];
|
||||||
|
if (jwtToken != null && jwtToken.toString().isNotEmpty) {
|
||||||
|
box.write(BoxName.jwt, (jwtToken.toString()));
|
||||||
|
await storage.write(
|
||||||
|
key: BoxName.jwt, value: (jwtToken.toString()));
|
||||||
|
}
|
||||||
// ✅ المستخدم موجود مسبقاً -> تسجيل دخول مباشر
|
// ✅ المستخدم موجود مسبقاً -> تسجيل دخول مباشر
|
||||||
await _handleSuccessfulLogin(data['message']['passenger']);
|
await _handleSuccessfulLogin(data['message']['passenger']);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -76,10 +76,11 @@ class ImageController extends GetxController {
|
|||||||
length,
|
length,
|
||||||
filename: basename(file.path),
|
filename: basename(file.path),
|
||||||
);
|
);
|
||||||
final String fingerPrint = box.read(BoxName.deviceFpEncrypted)?.toString() ?? '';
|
final String fingerPrint =
|
||||||
|
box.read(BoxName.deviceFpEncrypted)?.toString() ?? '';
|
||||||
request.headers.addAll({
|
request.headers.addAll({
|
||||||
'Authorization':
|
'Authorization':
|
||||||
'Bearer ${X.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs).toString().split(AppInformation.addd)[0]}',
|
'Bearer ${(box.read(BoxName.jwt)).toString().split(AppInformation.addd)[0]}',
|
||||||
'X-Device-FP': fingerPrint,
|
'X-Device-FP': fingerPrint,
|
||||||
});
|
});
|
||||||
// Set the file name to the driverID
|
// Set the file name to the driverID
|
||||||
|
|||||||
@@ -70,8 +70,9 @@ class ComplaintController extends GetxController {
|
|||||||
|
|
||||||
var uri = Uri.parse('${AppLink.server}/upload_audio.php');
|
var uri = Uri.parse('${AppLink.server}/upload_audio.php');
|
||||||
var request = http.MultipartRequest('POST', uri);
|
var request = http.MultipartRequest('POST', uri);
|
||||||
String token = r(box.read(BoxName.jwt)).toString().split(Env.addd)[0];
|
String token = (box.read(BoxName.jwt)).toString().split(Env.addd)[0];
|
||||||
final String fingerPrint = box.read(BoxName.deviceFpEncrypted)?.toString() ?? '';
|
final String fingerPrint =
|
||||||
|
box.read(BoxName.deviceFpEncrypted)?.toString() ?? '';
|
||||||
|
|
||||||
var mimeType = lookupMimeType(audioFile.path);
|
var mimeType = lookupMimeType(audioFile.path);
|
||||||
// ** التعديل: تم استخدام نفس هيدر التوثيق **
|
// ** التعديل: تم استخدام نفس هيدر التوثيق **
|
||||||
@@ -146,7 +147,7 @@ class ComplaintController extends GetxController {
|
|||||||
// 3. استخراج البيانات المطلوبة
|
// 3. استخراج البيانات المطلوبة
|
||||||
final rideId = feedBack[0]['id'].toString(); // ! تأكد أن اسم حقل ID صحيح
|
final rideId = feedBack[0]['id'].toString(); // ! تأكد أن اسم حقل ID صحيح
|
||||||
final complaint = complaintController.text;
|
final complaint = complaintController.text;
|
||||||
String token = r(box.read(BoxName.jwt)).toString().split(Env.addd)[0];
|
String token = (box.read(BoxName.jwt)).toString().split(Env.addd)[0];
|
||||||
|
|
||||||
// 4. استدعاء سكربت PHP الجديد باستخدام http.post
|
// 4. استدعاء سكربت PHP الجديد باستخدام http.post
|
||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
|
|||||||
Reference in New Issue
Block a user