Update: 2026-06-26 17:29:23
This commit is contained in:
@@ -14,9 +14,9 @@ import '../../constant/links.dart';
|
||||
import '../../env/env.dart';
|
||||
import '../../main.dart';
|
||||
import '../../print.dart';
|
||||
import '../../views/widgets/snackbar.dart';
|
||||
import 'device_info.dart';
|
||||
import 'encrypt_decrypt.dart';
|
||||
import 'security_checks.dart';
|
||||
import 'ssl_pinning.dart';
|
||||
|
||||
class CRUD {
|
||||
@@ -36,7 +36,7 @@ class CRUD {
|
||||
'password': AK.passnpassenger,
|
||||
'aud': '${AK.allowed}$dev',
|
||||
};
|
||||
Log.print('payload: ${payload}');
|
||||
Log.print('payload: $payload');
|
||||
var response1 = await _client.post(
|
||||
Uri.parse(AppLink.loginJwtDriver),
|
||||
body: payload,
|
||||
@@ -46,7 +46,7 @@ class CRUD {
|
||||
final decodedResponse1 = jsonDecode(response1.body);
|
||||
|
||||
final jwt = decodedResponse1['jwt'];
|
||||
Log.print('jwt: ${jwt}');
|
||||
Log.print('jwt: $jwt');
|
||||
await box.write(BoxName.jwt, X.c(X.c(X.c(jwt, cn), cC), cs));
|
||||
await storage.write(key: BoxName.jwt, value: X.c(X.c(X.c(jwt, cn), cC), cs));
|
||||
// await AppInitializer().getKey();
|
||||
@@ -334,11 +334,11 @@ class CRUD {
|
||||
Future<dynamic> postWallet(
|
||||
{required String link, Map<String, dynamic>? payload}) async {
|
||||
var s = await getJwtWallet();
|
||||
Log.print('jwt: ${s}');
|
||||
Log.print('jwt: $s');
|
||||
final hmac = box.read(BoxName.hmac);
|
||||
Log.print('hmac: ${hmac}');
|
||||
Log.print('hmac: $hmac');
|
||||
var url = Uri.parse(link);
|
||||
Log.print('url: ${url}');
|
||||
Log.print('url: $url');
|
||||
|
||||
// إضافة الـ HMAC للـ payload لزيادة التوافقية
|
||||
if (payload != null && hmac != null) {
|
||||
@@ -389,9 +389,9 @@ class CRUD {
|
||||
link: AppLink.send_whatsapp_message,
|
||||
payload: {'receiver': to, 'message': message});
|
||||
if (res != 'failure') {
|
||||
Get.snackbar('Success', 'Message sent successfully');
|
||||
mySnackbarSuccess('Message sent successfully');
|
||||
} else {
|
||||
Get.snackbar('Error', 'Failed to send message');
|
||||
mySnackbarError('Failed to send message');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -399,7 +399,6 @@ class CRUD {
|
||||
required String channelName,
|
||||
required String uid,
|
||||
}) async {
|
||||
var uid = box.read(BoxName.phone) ?? box.read(BoxName.phoneDriver);
|
||||
var res = await _client.get(
|
||||
Uri.parse(
|
||||
'https://repulsive-pig-rugby-shirt.cyclic.app/token?channelName=$channelName'),
|
||||
@@ -450,15 +449,6 @@ class CRUD {
|
||||
}
|
||||
|
||||
Future allMethodForAI(String prompt, driverID, imagePath) async {
|
||||
// await ImageController().choosImage(linkPHP, imagePath);
|
||||
Future.delayed(const Duration(seconds: 2));
|
||||
var extractedString = await arabicTextExtractByVisionAndAI(
|
||||
imagePath: imagePath, driverID: driverID);
|
||||
var json = jsonDecode(extractedString);
|
||||
var textValues = getAllTextValuesWithLineNumbers(json);
|
||||
// List<String> textValues = getAllTextValues(json);
|
||||
|
||||
// await AI().geminiAiExtraction(prompt, textValues);
|
||||
}
|
||||
|
||||
Map<String, List<Map<String, String>>> getAllTextValuesWithLineNumbers(
|
||||
@@ -616,7 +606,7 @@ class CRUD {
|
||||
"receiver": phone
|
||||
});
|
||||
|
||||
var res = await _client.post(
|
||||
await _client.post(
|
||||
Uri.parse(AppLink.sendSms),
|
||||
body: body,
|
||||
headers: headers,
|
||||
|
||||
Reference in New Issue
Block a user