diff --git a/android/app/build.gradle b/android/app/build.gradle
index 560034d..0fb8084 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -55,8 +55,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 23
targetSdkVersion flutter.targetSdkVersion
- versionCode 32
- versionName '1.5.32'
+ versionCode 35
+ versionName '1.5.35'
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
}
diff --git a/assets/images/logo.gif b/assets/images/logo.gif
index 2646c02..2a94831 100644
Binary files a/assets/images/logo.gif and b/assets/images/logo.gif differ
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 1f6e6ab..2bfc321 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -21,7 +21,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 33
+ 35
CFBundleSignature
????
CFBundleURLTypes
@@ -36,7 +36,7 @@
CFBundleVersion
- 4.0.33
+ 4.0.35
FirebaseAppDelegateProxyEnabled
NO
GMSApiKey
diff --git a/lib/controller/auth/apple_sigin.dart b/lib/controller/auth/apple_sigin.dart
index af64880..a624cae 100644
--- a/lib/controller/auth/apple_sigin.dart
+++ b/lib/controller/auth/apple_sigin.dart
@@ -24,7 +24,6 @@ class AuthController extends GetxController {
await _auth.signInWithCredential(credential);
return userCredential.user;
} catch (error) {
- print("Error during Apple sign-in: $error");
return null;
}
}
diff --git a/lib/controller/auth/captin/history_captain.dart b/lib/controller/auth/captin/history_captain.dart
index 9f55437..380f5f3 100644
--- a/lib/controller/auth/captin/history_captain.dart
+++ b/lib/controller/auth/captin/history_captain.dart
@@ -26,7 +26,6 @@ class HistoryCaptainController extends GetxController {
payload: {'driver_id': box.read(BoxName.driverID)});
if (res != 'failure') {
historyData = jsonDecode(res);
- print(historyData);
isloading = false;
update();
} else {
@@ -48,7 +47,6 @@ class HistoryCaptainController extends GetxController {
var res = await CRUD()
.get(link: AppLink.getRideOrderID, payload: {'id': orderId});
historyDetailsData = jsonDecode(res);
- print(historyDetailsData);
isloading = false;
update();
Get.to(() => HistoryDetailsPage());
diff --git a/lib/controller/auth/captin/login_captin_controller.dart b/lib/controller/auth/captin/login_captin_controller.dart
index 3c2cc47..7a754d3 100644
--- a/lib/controller/auth/captin/login_captin_controller.dart
+++ b/lib/controller/auth/captin/login_captin_controller.dart
@@ -4,7 +4,6 @@ import 'dart:math';
import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/controller/functions/location_background_controller.dart';
import 'package:SEFER/views/auth/captin/cards/sms_signup.dart';
-import 'package:SEFER/views/auth/captin/register_captin.dart';
import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:get/get.dart';
@@ -30,7 +29,6 @@ class LoginCaptinController extends GetxController {
final location = Location();
void changeAgreeTerm() {
isAgreeTerms = !isAgreeTerms;
- print(isAgreeTerms);
update();
}
@@ -58,7 +56,6 @@ class LoginCaptinController extends GetxController {
'phone': phoneController.text,
'password': passwordController.text
});
- print(res);
if (res == 'failure') {
//Failure
isloading = false;
@@ -66,10 +63,8 @@ class LoginCaptinController extends GetxController {
Get.snackbar('Failure', '', backgroundColor: Colors.red);
} else {
var jsonDecoeded = jsonDecode(res);
- // print(jsonDecoeded);
if (jsonDecoeded.isNotEmpty) {
if (jsonDecoeded['status'] == 'success') {
- print(jsonDecoeded['data'][0]['verified']);
if (jsonDecoeded['data'][0]['verified'] == 1) {
box.write(BoxName.driverID, jsonDecoeded['data'][0]['id']);
box.write(BoxName.emailDriver, jsonDecoeded['data'][0]['email']);
@@ -81,12 +76,10 @@ class LoginCaptinController extends GetxController {
Get.offAll(() => HomeCaptain());
isloading = false;
update();
- print(box.read(BoxName.driverID).toString());
- print(box.read(BoxName.tokenDriver));
await CRUD().post(link: AppLink.addTokensDriver, payload: {
'token': box.read(BoxName.tokenDriver),
'captain_id': box.read(BoxName.driverID).toString()
- }).then((value) => print('cccc'));
+ });
} else {
isloading = false;
update();
@@ -99,7 +92,7 @@ class LoginCaptinController extends GetxController {
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
'email': emailController.text,
'token': randomNumber.toString(),
- }).then((value) => print(value));
+ });
Get.to(() => VerifyEmailCaptainPage());
},
);
@@ -111,7 +104,6 @@ class LoginCaptinController extends GetxController {
update();
}
} else {
- print('res is null');
isloading = false;
update();
}
@@ -125,7 +117,6 @@ class LoginCaptinController extends GetxController {
'email': email,
'id': driverID,
});
- print(res);
if (res == 'Failure') {
//Failure
Get.offAll(() => SmsSignupEgypt());
@@ -134,7 +125,6 @@ class LoginCaptinController extends GetxController {
// Get.snackbar('Failure', '', backgroundColor: Colors.red);
} else {
var jsonDecoeded = jsonDecode(res);
- // print(jsonDecoeded['data'][0]['is_verified']);
if (jsonDecoeded.isNotEmpty) {
if (jsonDecoeded['status'] == 'success' &&
jsonDecoeded['data'][0]['is_verified'] == 1) {
@@ -147,12 +137,10 @@ class LoginCaptinController extends GetxController {
'${jsonDecoeded['data'][0]['first_name']}'
' ${jsonDecoeded['data'][0]['last_name']}');
- print(box.read(BoxName.tokenDriver));
var token = await CRUD().get(
link: AppLink.getDriverToken,
payload: {'captain_id': box.read(BoxName.driverID).toString()});
- print(token);
- print(box.read(BoxName.tokenDriver));
+
if (token != 'failure') {
if (jsonDecode(token)['data'][0]['token'] !=
box.read(BoxName.tokenDriver)) {
@@ -165,7 +153,7 @@ class LoginCaptinController extends GetxController {
await CRUD().post(link: AppLink.addTokensDriver, payload: {
'token': box.read(BoxName.tokenDriver),
'captain_id': box.read(BoxName.driverID).toString()
- }).then((value) => print('cccc'));
+ });
}
}
@@ -178,7 +166,6 @@ class LoginCaptinController extends GetxController {
update();
}
} else {
- print('res is null');
Get.snackbar('failure'.tr, '', backgroundColor: AppColor.redColor);
isloading = false;
update();
diff --git a/lib/controller/auth/captin/ml_google_doc.dart b/lib/controller/auth/captin/ml_google_doc.dart
index 6580a6b..7ff71b5 100644
--- a/lib/controller/auth/captin/ml_google_doc.dart
+++ b/lib/controller/auth/captin/ml_google_doc.dart
@@ -85,19 +85,15 @@ class CarRegistrationRecognizerController extends GetxController {
}
String result = lines.map((map) => map.values.first.toString()).join(' ');
- // print(result.length);
if (result.length > 2200) {
result = result.substring(0, 2200);
}
- // print('jsonOutput------------------------------');
- // print(result);
Map result2 = await LlamaAi().getCarRegistrationData(result,
'vin,make,made,year,expiration_date,color,owner,registration_date'); //
// Assign the result to the extracted variable
extracted = result2;
- print('extracted is ' + extracted.toString());
update();
}
}
diff --git a/lib/controller/auth/captin/register_captin_controller.dart b/lib/controller/auth/captin/register_captin_controller.dart
index 68f1663..82c6763 100644
--- a/lib/controller/auth/captin/register_captin_controller.dart
+++ b/lib/controller/auth/captin/register_captin_controller.dart
@@ -178,7 +178,6 @@ class RegisterCaptainController extends GetxController {
'expireDate': expireDate,
'dateOfBirth': dob,
});
- print(jsonDecode(res));
isLoading = false;
update();
if (jsonDecode(res)['status'] == 'success') {
@@ -199,7 +198,6 @@ class RegisterCaptainController extends GetxController {
'owner': owner,
'registrationDate': registrationDate,
});
- print(jsonDecode(res));
box.write(BoxName.vin, vin);
box.write(BoxName.make, make);
box.write(BoxName.model, model);
@@ -243,7 +241,7 @@ class RegisterCaptainController extends GetxController {
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
'email': emailController.text,
'token': randomNumber.toString(),
- }).then((value) => print(value));
+ });
Get.to(() => VerifyEmailCaptainPage());
}
}
diff --git a/lib/controller/auth/google_sign.dart b/lib/controller/auth/google_sign.dart
index a1bd633..8d618b9 100644
--- a/lib/controller/auth/google_sign.dart
+++ b/lib/controller/auth/google_sign.dart
@@ -30,7 +30,6 @@ class GoogleSignInHelper {
}
return googleUser;
} catch (error) {
- print('Google Sign-In error: $error');
return null;
}
}
@@ -51,7 +50,6 @@ class GoogleSignInHelper {
}
return googleUser;
} catch (error) {
- print('Google Sign-In error: $error');
return null;
}
}
@@ -61,10 +59,7 @@ class GoogleSignInHelper {
try {
await _googleSignIn.signOut();
await _handleSignOut();
- print('User signed out.');
- } catch (error) {
- print('Google Sign-Out error: $error');
- }
+ } catch (error) {}
}
static Future _handleSignOut() async {
@@ -88,8 +83,6 @@ class GoogleSignInHelper {
Get.offAll(OnBoardingPage());
// Perform any additional sign-out tasks or API calls here
// For example, you can notify your server about the user sign-out
-
- print('User data cleared.');
}
// Method to get the current signed-in user
@@ -107,10 +100,5 @@ class GoogleSignInHelper {
// Perform any additional sign-up tasks or API calls here
// For example, you can send the user data to your server for registration
-
- print('driverID = ${box.read(BoxName.driverID)}');
- print('emailDriver = ${box.read(BoxName.emailDriver)}');
- // print('nameDriver = ${box.read(BoxName.nameDriver)}');
- // print('driverPhotoUrl = ${box.read(BoxName.driverPhotoUrl)}');
}
}
diff --git a/lib/controller/auth/login_controller.dart b/lib/controller/auth/login_controller.dart
index 9413c20..367a053 100644
--- a/lib/controller/auth/login_controller.dart
+++ b/lib/controller/auth/login_controller.dart
@@ -1,5 +1,4 @@
import 'dart:convert';
-import 'dart:io';
import 'dart:math';
import 'package:flutter/material.dart';
@@ -12,8 +11,6 @@ import 'package:SEFER/controller/functions/secure_storage.dart';
import 'package:SEFER/main.dart';
import 'package:SEFER/views/auth/verify_email_page.dart';
-import '../functions/device_info.dart';
-
class LoginController extends GetxController {
final formKey = GlobalKey();
final formKeyAdmin = GlobalKey();
@@ -28,7 +25,6 @@ class LoginController extends GetxController {
void changeAgreeTerm() {
isAgreeTerms = !isAgreeTerms;
- print(isAgreeTerms);
update();
}
@@ -56,12 +52,9 @@ class LoginController extends GetxController {
//Failure
Get.snackbar('Failure', '', backgroundColor: Colors.red);
} else {
- // print(res);
var jsonDecoeded = jsonDecode(res);
- // print(jsonDecoeded);
if (jsonDecoeded.isNotEmpty) {
if (jsonDecoeded['status'] == 'success') {
- print(jsonDecoeded['data'][0]['verified']);
if (jsonDecoeded['data'][0]['verified'] == 1) {
box.write(BoxName.driverID, jsonDecoeded['data'][0]['id']);
box.write(BoxName.emailDriver, jsonDecoeded['data'][0]['email']);
@@ -75,12 +68,10 @@ class LoginController extends GetxController {
// Get.offAll(() => const MapPagePassenger());
isloading = false;
update();
- print(box.read(BoxName.passengerID).toString());
- print(box.read(BoxName.tokenFCM));
await CRUD().post(link: AppLink.addTokens, payload: {
'token': box.read(BoxName.tokenFCM),
'passengerID': box.read(BoxName.passengerID).toString()
- }).then((value) => print('cccc'));
+ });
} else {
isloading = false;
update();
@@ -93,7 +84,7 @@ class LoginController extends GetxController {
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
'email': emailController.text,
'token': randomNumber.toString(),
- }).then((value) => print(value));
+ });
Get.to(() => const VerifyEmailPage());
},
);
@@ -105,7 +96,6 @@ class LoginController extends GetxController {
update();
}
} else {
- print('res is null');
isloading = false;
update();
}
diff --git a/lib/controller/auth/register_controller.dart b/lib/controller/auth/register_controller.dart
index 304e79f..45297bd 100644
--- a/lib/controller/auth/register_controller.dart
+++ b/lib/controller/auth/register_controller.dart
@@ -83,14 +83,12 @@ class RegisterController extends GetxController {
'site': siteController.text,
'birthdate': birthDate,
});
- print(jsonDecode(res));
if (jsonDecode(res)['status'] == 'success') {
- print('sdfffffffffff');
int randomNumber = Random().nextInt(100000) + 1;
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
'email': emailController.text,
'token': randomNumber.toString(),
- }).then((value) => print(value));
+ });
Get.to(() => const VerifyEmailPage());
}
}
diff --git a/lib/controller/auth/tokens_controller.dart b/lib/controller/auth/tokens_controller.dart
index 57b7f48..3458470 100644
--- a/lib/controller/auth/tokens_controller.dart
+++ b/lib/controller/auth/tokens_controller.dart
@@ -29,10 +29,7 @@ class TokenController extends GetxController {
isloading = false;
update();
- print(res.request);
- print(res.body);
var jsonToken = jsonDecode(res.body);
- // print(jsonToken);
if (jsonToken['status'] == 'The token has been updated successfully.') {
Get.snackbar('token updated'.tr, '');
}
diff --git a/lib/controller/firebase/firbase_messge.dart b/lib/controller/firebase/firbase_messge.dart
index a79c80b..7e22f98 100644
--- a/lib/controller/firebase/firbase_messge.dart
+++ b/lib/controller/firebase/firbase_messge.dart
@@ -32,8 +32,7 @@ class FirebaseMessagesController extends GetxController {
// Get the current notification settings
NotificationSettings? notificationSettings =
await FirebaseMessaging.instance.getNotificationSettings();
- print(
- 'Notification authorization status: ${notificationSettings.authorizationStatus}');
+ 'Notification authorization status: ${notificationSettings.authorizationStatus}';
// Call the update function if needed
update();
@@ -57,7 +56,6 @@ class FirebaseMessagesController extends GetxController {
provisional: false,
sound: true,
);
- print('User granted permission: ${settings.authorizationStatus}');
messaging.setForegroundNotificationPresentationOptions(
alert: true, badge: true, sound: true);
}
@@ -66,8 +64,6 @@ class FirebaseMessagesController extends GetxController {
Future getToken() async {
fcmToken.getToken().then((token) {
box.write(BoxName.tokenDriver, token);
-
- print(token);
});
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
@@ -82,14 +78,12 @@ class FirebaseMessagesController extends GetxController {
FirebaseMessaging.onBackgroundMessage((RemoteMessage message) async {
// Handle background message
if (message.data.isNotEmpty && message.notification != null) {
- print(message.notification?.title);
fireBaseTitles(message);
}
});
FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
if (message.data.isNotEmpty && message.notification != null) {
- print(message.notification?.title);
fireBaseTitles(message);
}
});
@@ -109,7 +103,6 @@ class FirebaseMessagesController extends GetxController {
// This is for location using and uploading status
Get.put(HomeCaptainController()).changeRideId();
update();
- // print('driverToken==============$driverToken');
Get.to(() => OrderRequestPage(), arguments: {
'myListString': myListString,
'DriverList': myList,
@@ -153,9 +146,7 @@ class FirebaseMessagesController extends GetxController {
// token: driverList[0].toString(),
// remoteID: driverList[2].toString(),
// ));
- } catch (e) {
- print('Error navigating to PassengerCallPage: $e');
- }
+ } catch (e) {}
} else if (message.notification!.title! == 'Call Income from Passenger') {
try {
var myListString = message.data['passengerList'];
@@ -173,9 +164,7 @@ class FirebaseMessagesController extends GetxController {
// token: driverList[0].toString(),
// remoteID: driverList[2].toString(),
));
- } catch (e) {
- print('Error navigating to PassengerCallPage: $e');
- }
+ } catch (e) {}
} else if (message.notification!.title! == 'Call End') {
try {
var myListString = message.data['passengerList'];
@@ -189,9 +178,7 @@ class FirebaseMessagesController extends GetxController {
}
// Assuming GetMaterialApp is initialized and context is valid for navigation
Get.off(const CallPage());
- } catch (e) {
- print('Error navigating to PassengerCallPage: $e');
- }
+ } catch (e) {}
} else if (message.notification!.title! == 'Order Applied') {
Get.snackbar(
"The order has been accepted by another driver."
@@ -209,7 +196,6 @@ class FirebaseMessagesController extends GetxController {
// var myPoints = jsonDecode(points) as List;
driverToken = myList[14].toString();
update();
- // print('driverToken==============$driverToken');
Get.to(() => OrderSpeedRequest(), arguments: {
'myListString': myListString,
'DriverList': myList,
@@ -364,7 +350,6 @@ class FirebaseMessagesController extends GetxController {
// Save the list of tokens back to the box.
// box.write(BoxName.tokens, tokens);
tokens = box.read(BoxName.tokens);
- // print(tokens);
for (var i = 0; i < tokens.length; i++) {
http
.post(Uri.parse('https://fcm.googleapis.com/fcm/send'),
@@ -387,9 +372,7 @@ class FirebaseMessagesController extends GetxController {
'to': tokens[i],
}))
.whenComplete(() {})
- .catchError((e) {
- print('sendNotification() error: $e');
- });
+ .catchError((e) {});
}
}
@@ -416,7 +399,6 @@ class FirebaseMessagesController extends GetxController {
// }))
// .whenComplete(() {})
// .catchError((e) {
- // print('sendNotification() error: $e');
// });
// }
// }
@@ -446,15 +428,12 @@ class FirebaseMessagesController extends GetxController {
if (response.statusCode == 200) {
// Notification sent successfully
- print('Notification sent successfully');
} else {
// Handle error response
- print(
- 'Failed to send notification. Status code: ${response.statusCode}');
+ 'Failed to send notification. Status code: ${response.statusCode}';
}
} catch (e) {
// Handle other exceptions
- print('sendNotification() error: $e');
}
}
@@ -483,15 +462,12 @@ class FirebaseMessagesController extends GetxController {
if (response.statusCode == 200) {
// Notification sent successfully
- print('Notification sent successfully');
} else {
// Handle error response
- print(
- 'Failed to send notification. Status code: ${response.statusCode}');
+ 'Failed to send notification. Status code: ${response.statusCode}';
}
} catch (e) {
// Handle other exceptions
- print('sendNotification() error: $e');
}
}
@@ -522,15 +498,12 @@ class FirebaseMessagesController extends GetxController {
if (response.statusCode == 200) {
// Notification sent successfully
- print('Notification sent successfully');
} else {
// Handle error response
- print(
- 'Failed to send notification. Status code: ${response.statusCode}');
+ 'Failed to send notification. Status code: ${response.statusCode}';
}
} catch (e) {
// Handle other exceptions
- print('sendNotification() error: $e');
}
}
@@ -560,15 +533,12 @@ class FirebaseMessagesController extends GetxController {
if (response.statusCode == 200) {
// Notification sent successfully
- print('Notification sent successfully');
} else {
// Handle error response
- print(
- 'Failed to send notification. Status code: ${response.statusCode}');
+ 'Failed to send notification. Status code: ${response.statusCode}';
}
} catch (e) {
// Handle other exceptions
- print('sendNotification() error: $e');
}
}
@@ -599,15 +569,12 @@ class FirebaseMessagesController extends GetxController {
if (response.statusCode == 200) {
// Notification sent successfully
- print('Notification sent successfully');
} else {
// Handle error response
- print(
- 'Failed to send notification. Status code: ${response.statusCode}');
+ 'Failed to send notification. Status code: ${response.statusCode}';
}
} catch (e) {
// Handle other exceptions
- print('sendNotification() error: $e');
}
}
}
diff --git a/lib/controller/functions/call_controller.dart b/lib/controller/functions/call_controller.dart
index 8d2fe77..13d8d12 100644
--- a/lib/controller/functions/call_controller.dart
+++ b/lib/controller/functions/call_controller.dart
@@ -31,9 +31,6 @@ class CallController extends GetxController {
}
initAgoraFull() async {
- print('channelName is $channelName');
- print('remoteid is $remoteUid');
- print('uid is $uid');
await fetchToken();
// Set up an instance of Agora engine
setupVoiceSDKEngine();
@@ -65,8 +62,6 @@ class CallController extends GetxController {
//create an instance of the Agora engine
agoraEngine = createAgoraRtcEngine();
await agoraEngine.initialize(RtcEngineContext(appId: AK.agoraAppId));
- print('eeeeeeeeeeeeeeeeeeee');
- print(agoraEngine);
// Register the event handler
agoraEngine.registerEventHandler(
RtcEngineEventHandler(
@@ -129,7 +124,6 @@ class CallController extends GetxController {
var res = await CRUD()
.getAgoraToken(channelName: channelName, uid: uid.toString());
token = res;
- print('token is $token');
update();
}
}
diff --git a/lib/controller/functions/camer_controller.dart b/lib/controller/functions/camer_controller.dart
index a636fdb..be92c13 100644
--- a/lib/controller/functions/camer_controller.dart
+++ b/lib/controller/functions/camer_controller.dart
@@ -91,10 +91,7 @@ class CameraClassController extends GetxController {
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
- print(await response.stream.bytesToString());
- } else {
- print(response.reasonPhrase);
- }
+ } else {}
}
Future uploadImage(File imageFile) async {
@@ -164,12 +161,9 @@ class CameraClassController extends GetxController {
update();
// Print the JSON output
- print(jsonOutput);
// Get.back();
- } catch (e) {
- print('Error capturing image: $e');
- }
+ } catch (e) {}
}
String getTextAsJSON(String text) {
@@ -228,11 +222,8 @@ class CameraClassController extends GetxController {
// textBlocks.toString(); // Convert the extracted text to JSON.
// // Print the JSON to the console.
-// print(jsonText);
// update();
-// // print(text);
// } catch (e) {
-// print('Error during text extraction: $e');
// scannedText = '';
// }
// }
diff --git a/lib/controller/functions/crud.dart b/lib/controller/functions/crud.dart
index 39123ce..5331f22 100644
--- a/lib/controller/functions/crud.dart
+++ b/lib/controller/functions/crud.dart
@@ -27,15 +27,9 @@ class CRUD {
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}',
},
);
- print("-----request----" + response.request.toString());
- // print("-----headers-----" + response.headers.toString());
- print("-----payload-----" + payload.toString());
// if (response.statusCode == 200) {
- // print(response.body);
var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') {
- print(jsonData);
-
return response.body;
}
@@ -55,11 +49,8 @@ class CRUD {
if (res.statusCode == 200) {
var response = jsonDecode(res.body);
- print(await response);
return response['token'];
- } else {
- print(res.reasonPhrase);
- }
+ } else {}
}
Future getLlama({
@@ -105,10 +96,8 @@ class CRUD {
Future.delayed(const Duration(seconds: 2));
var extractedString =
await arabicTextExtractByVisionAndAI(imagePath: imagePath);
- // print(extractedString);
var json = jsonDecode(extractedString);
var textValues = extractTextFromLines(json);
- print(textValues);
// await Get.put(AI()).geminiAiExtraction(prompt, textValues);
await Get.put(AI()).anthropicAI(textValues, prompt, imagePath);
}
@@ -152,11 +141,8 @@ class CRUD {
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
- // print(await response.stream.bytesToString());
return await response.stream.bytesToString();
- } else {
- print(response.reasonPhrase);
- }
+ } else {}
}
Future getChatGPT({
@@ -210,12 +196,8 @@ class CRUD {
},
);
if (response.statusCode == 200) {
- print(response);
return response.body;
- } else {
- print('eeeeeeeeerrrrorrrr ${response.statusCode}');
- print(response.body);
- }
+ } else {}
}
Future post({
@@ -236,11 +218,8 @@ class CRUD {
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
},
);
- print(response.request);
- print(payload);
var jsonData = jsonDecode(response.body);
- print(jsonData);
if (response.statusCode == 200) {
if (jsonData['status'] == 'success') {
return response.body;
@@ -248,7 +227,6 @@ class CRUD {
String errorMessage = jsonData['message'];
// Get.snackbar('Error'.tr, errorMessage.tr,
// backgroundColor: AppColor.redColor);
- print(errorMessage.tr);
return (jsonData['status']);
}
} else {
@@ -267,11 +245,8 @@ class CRUD {
);
var response = await http.post(url,
body: payload, headers: {'Content-Type': 'application/json'});
- print(response.request);
- print(payload);
var jsonData = jsonDecode(response.body);
- // print(jsonData);
if (response.statusCode == 200) {
if (jsonData['status'] == 'success') {
return response.body;
@@ -297,13 +272,8 @@ class CRUD {
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
- // print(request.body);
- // print(response);
if (response.statusCode == 200) {
- print(await response.stream.bytesToString());
- } else {
- print(response.reasonPhrase);
- }
+ } else {}
}
Future postFromDialogue({
@@ -324,9 +294,6 @@ class CRUD {
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
},
);
- //print(response.request);
- //print('body=========================');
- //print(response.body);
if (response.body.isNotEmpty) {
var jsonData = jsonDecode(response.body);
@@ -368,10 +335,7 @@ class CRUD {
);
if (response.statusCode == 201) {
- print('Verification request sent');
- } else {
- print('Failed to send verification request');
- }
+ } else {}
// Prompt the user to enter the OTP
final otpCode = "123456"; // Replace with user input
@@ -394,10 +358,7 @@ class CRUD {
);
if (checkResponse.statusCode == 201) {
- print('Verification successful');
- } else {
- print('Verification failed');
- }
+ } else {}
}
Future getGoogleApi({
@@ -411,9 +372,7 @@ class CRUD {
url,
body: payload,
);
- print(response.request);
var jsonData = jsonDecode(response.body);
- // //print(jsonData);
if (jsonData['status'] == 'OK') {
return jsonData;
}
diff --git a/lib/controller/functions/device_info.dart b/lib/controller/functions/device_info.dart
index 3ac8c4e..9dcfbdc 100644
--- a/lib/controller/functions/device_info.dart
+++ b/lib/controller/functions/device_info.dart
@@ -20,6 +20,5 @@ class DeviceController {
deviceSerialNumber = iosInfo.identifierForVendor!;
box.write(BoxName.deviceInfo, deviceSerialNumber.toString());
}
- print(deviceSerialNumber);
}
}
diff --git a/lib/controller/functions/gemeni.dart b/lib/controller/functions/gemeni.dart
index 0a38702..cedae7c 100644
--- a/lib/controller/functions/gemeni.dart
+++ b/lib/controller/functions/gemeni.dart
@@ -208,20 +208,6 @@ class AI extends GetxController {
Future addDriverEgypt() async {
try {
- print(box.read(BoxName.driverID).toString());
- print(box.read(BoxName.phoneDriver)?.toString() ?? '');
- print(responseIdEgyptBack['gender']);
- print(responseIdEgyptDriverLicense['license_type']);
- print(responseIdEgyptBack['nationalID']);
- print(responseIdEgyptDriverLicense['issue_date']);
- print(responseIdEgyptDriverLicense['expiry_date']);
- print(responseIdEgyptDriverLicense['license_categories']);
- print(responseIdEgyptFront['card_id']);
- print(responseIdEgyptDriverLicense['issue_date']);
- print(responseIdEgyptFront['dob'] != null
- ? responseIdEgyptFront['dob'] + '-01-01'.toString()
- : '');
-
// Extract values from box or set defaults
var firstName = responseIdEgyptDriverLicense['firstName'] ?? '';
var lastName = responseIdEgyptDriverLicense['lastName'] ?? '';
@@ -282,7 +268,6 @@ class AI extends GetxController {
'site': site,
'employmentType': employmentType,
};
- print(payload);
isLoading = true;
update();
// Make POST request
@@ -292,7 +277,6 @@ class AI extends GetxController {
update();
// Handle response
- print(status1);
if (status1['status'] == 'success') {
isDriverSaved = true;
Get.snackbar('Success', 'Driver data saved successfully',
@@ -302,7 +286,6 @@ class AI extends GetxController {
backgroundColor: Colors.red);
}
} catch (e) {
- print('Error: $e');
Get.snackbar('Error', 'An error occurred while saving driver data',
backgroundColor: Colors.red);
}
@@ -338,9 +321,7 @@ class AI extends GetxController {
Get.snackbar('Success', 'message',
backgroundColor: AppColor.greenColor);
}
- } catch (e) {
- print('error is $e');
- }
+ } catch (e) {}
}
final picker = ImagePicker();
@@ -414,10 +395,8 @@ class AI extends GetxController {
Future.delayed(const Duration(seconds: 2));
var extractedString =
await CRUD().arabicTextExtractByVisionAndAI(imagePath: imagePath);
- // print(extractedString);
var json = jsonDecode(extractedString);
var textValues = CRUD().extractTextFromLines(json);
- print(textValues);
// await Get.put(AI()).geminiAiExtraction(prompt, textValues, imagePath);
await Get.put(AI()).anthropicAI(textValues, prompt, imagePath);
isLoading = false;
@@ -473,7 +452,6 @@ class AI extends GetxController {
},
],
});
- print(requestBody);
final response = await http.post(
Uri.parse(
@@ -485,13 +463,9 @@ class AI extends GetxController {
if (response.statusCode == 200) {
var responseData = jsonDecode(response.body);
// Process the responseData as needed
- // print(responseData);
var result =
responseData['candidates'][0]['content']['parts'][0]['text'];
- // print(jsonEncode(result));
- // print((result));
- // print(result['dob']);
RegExp regex = RegExp(r"```json([^`]*)```");
String? jsonString =
regex.firstMatch(responseData.toString())?.group(1)?.trim();
@@ -499,19 +473,11 @@ class AI extends GetxController {
if (jsonString != null) {
// Convert the JSON object to a String
jsonString = jsonEncode(json.decode(jsonString));
- print(jsonString);
- } else {
- print("JSON string not found");
- }
+ } else {}
// Rest of your code...
- } else {
- print('Request failed with status: ${response.statusCode}');
- print('Request failed with status: ${response.body}');
- }
- } else {
- print('No image selected');
- }
+ } else {}
+ } else {}
}
Future anthropicAI(
@@ -533,9 +499,6 @@ class AI extends GetxController {
"messages": messagesData,
});
- print('requestBody');
- print(requestBody);
-
final response = await http.post(
Uri.parse('https://api.anthropic.com/v1/messages'),
headers: {
@@ -549,29 +512,22 @@ class AI extends GetxController {
if (response.statusCode == 200) {
var responseData = jsonDecode(utf8.decode(response.bodyBytes));
// Process the responseData as needed
- print(utf8.decode(response.bodyBytes));
if (idType == 'car_back') {
responseIdCardDriverEgyptBack =
jsonDecode(responseData['content'][0]['text']);
- print(responseIdCardDriverEgyptBack);
} else if (idType == 'car_front') {
responseIdCardDriverEgyptFront =
jsonDecode(responseData['content'][0]['text']);
- print(responseIdCardDriverEgyptFront);
} else if (idType == 'id_front') {
responseIdEgyptFront = jsonDecode(responseData['content'][0]['text']);
- print(responseIdEgyptFront);
} else if (idType == 'id_back') {
responseIdEgyptBack = jsonDecode(responseData['content'][0]['text']);
- print(responseIdEgyptBack);
} else if (idType == 'driver_license') {
responseIdEgyptDriverLicense =
jsonDecode(responseData['content'][0]['text']);
- print(responseIdEgyptDriverLicense);
} else if (idType == 'criminalRecord') {
responseCriminalRecordEgypt =
jsonDecode(responseData['content'][0]['text']);
- print(responseCriminalRecordEgypt);
}
update();
@@ -615,7 +571,6 @@ class AI extends GetxController {
}
]
});
- // print(requestBody);
final response = await http.post(
Uri.parse(
@@ -629,12 +584,8 @@ class AI extends GetxController {
if (response.statusCode == 200) {
var responseData = jsonDecode(response.body);
// Process the responseData as needed
- // print(responseData);
var result = responseData['candidates'][0]['content']['parts'][0]['text'];
- // print(jsonEncode(result));
- // print((result));
- // print(result['dob']);
RegExp regex = RegExp(r"```json([^`]*)```");
String? jsonString =
regex.firstMatch(responseData.toString())?.group(1)?.trim();
@@ -645,33 +596,24 @@ class AI extends GetxController {
if (idType == 'car_back') {
responseIdCardDriverEgyptBack = jsonDecode(jsonString);
- print(responseIdCardDriverEgyptBack);
} else if (idType == 'car_front') {
responseIdCardDriverEgyptFront = jsonDecode(jsonString);
- print(responseIdCardDriverEgyptFront);
} else if (idType == 'id_front') {
responseIdEgyptFront = jsonDecode(jsonString);
- print(responseIdEgyptFront);
} else if (idType == 'id_back') {
responseIdEgyptBack = jsonDecode(jsonString);
- print(responseIdEgyptBack);
} else if (idType == 'driver_license') {
responseIdEgyptDriverLicense = jsonDecode(jsonString);
- print(responseIdEgyptDriverLicense);
}
update();
} else {
- print("JSON string not found");
Get.snackbar('Error', "JSON string not found",
backgroundColor: AppColor.redColor);
}
// Rest of your code...
- } else {
- print('Request failed with status: ${response.statusCode}');
- print('Request failed with status: ${response.body}');
- }
+ } else {}
}
Future getDriverLicenseJordanContent() async {
@@ -725,7 +667,6 @@ class AI extends GetxController {
},
],
});
- print(requestBody);
final response = await http.post(
Uri.parse(
@@ -738,13 +679,9 @@ class AI extends GetxController {
if (response.statusCode == 200) {
var responseData = jsonDecode(response.body);
// Process the responseData as needed
- // print(responseData);
var result =
responseData['candidates'][0]['content']['parts'][0]['text'];
- // print(jsonEncode(result));
- // print((result));
- // print(result['dob']);
RegExp regex = RegExp(r"```json([^`]*)```");
String? jsonString =
regex.firstMatch(responseData.toString())?.group(1)?.trim();
@@ -753,21 +690,11 @@ class AI extends GetxController {
// Convert the JSON object to a String
jsonString = jsonEncode(json.decode(jsonString));
responseMap = jsonDecode(jsonString);
- print(jsonString);
- print(responseMap);
- print(responseMap['dob']);
- } else {
- print("JSON string not found");
- }
+ } else {}
// Rest of your code...
- } else {
- print('Request failed with status: ${response.statusCode}');
- print('Request failed with status: ${response.body}');
- }
- } else {
- print('No image selected');
- }
+ } else {}
+ } else {}
}
Future getCarLicenseJordanContent() async {
@@ -826,7 +753,6 @@ Output the extracted information in the following JSON format''',
},
],
});
- print(requestBody);
final response = await http.post(
Uri.parse(
@@ -840,13 +766,9 @@ Output the extracted information in the following JSON format''',
if (response.statusCode == 200) {
var responseData = jsonDecode(response.body);
// Process the responseData as needed
- // print(responseData);
var result =
responseData['candidates'][0]['content']['parts'][0]['text'];
- // print(jsonEncode(result));
- // print((result));
- // print(result['dob']);
RegExp regex = RegExp(r"```json([^`]*)```");
String? jsonString =
regex.firstMatch(responseData.toString())?.group(1)?.trim();
@@ -855,21 +777,11 @@ Output the extracted information in the following JSON format''',
// Convert the JSON object to a String
jsonString = jsonEncode(json.decode(jsonString));
responseCarLicenseMapJordan = jsonDecode(jsonString);
- print(jsonString);
- print(responseCarLicenseMapJordan);
- print(responseCarLicenseMapJordan['plate_number']);
- } else {
- print("JSON string not found");
- }
+ } else {}
// Rest of your code...
- } else {
- print('Request failed with status: ${response.statusCode}');
- print('Request failed with status: ${response.body}');
- }
- } else {
- print('No image selected');
- }
+ } else {}
+ } else {}
}
Future jordanID() async {
@@ -928,7 +840,6 @@ Output the extracted information in the following JSON format''',
},
],
});
- print(requestBody);
final response = await http.post(
Uri.parse(
@@ -941,13 +852,9 @@ Output the extracted information in the following JSON format''',
if (response.statusCode == 200) {
var responseData = jsonDecode(response.body);
// Process the responseData as needed
- // print(responseData);
var result =
responseData['candidates'][0]['content']['parts'][0]['text'];
- // print(jsonEncode(result));
- // print((result));
- // print(result['dob']);
RegExp regex = RegExp(r"```json([^`]*)```");
String? jsonString =
regex.firstMatch(responseData.toString())?.group(1)?.trim();
@@ -956,21 +863,11 @@ Output the extracted information in the following JSON format''',
// Convert the JSON object to a String
jsonString = jsonEncode(json.decode(jsonString));
responseCarLicenseMapJordan = jsonDecode(jsonString);
- print(jsonString);
- print(responseCarLicenseMapJordan);
- print(responseCarLicenseMapJordan['plate_number']);
- } else {
- print("JSON string not found");
- }
+ } else {}
// Rest of your code...
- } else {
- print('Request failed with status: ${response.statusCode}');
- print('Request failed with status: ${response.body}');
- }
- } else {
- print('No image selected');
- }
+ } else {}
+ } else {}
}
Future carLicenseJordan() async {
@@ -1038,7 +935,6 @@ Output the extracted information in the following JSON formate and make date for
},
],
});
- print(requestBody);
final response = await http.post(
Uri.parse(
@@ -1051,13 +947,9 @@ Output the extracted information in the following JSON formate and make date for
if (response.statusCode == 200) {
var responseData = jsonDecode(response.body);
// Process the responseData as needed
- // print(responseData);
var result =
responseData['candidates'][0]['content']['parts'][0]['text'];
- // print(jsonEncode(result));
- // print((result));
- // print(result['dob']);
RegExp regex = RegExp(r"```json([^`]*)```");
String? jsonString =
regex.firstMatch(responseData.toString())?.group(1)?.trim();
@@ -1066,21 +958,11 @@ Output the extracted information in the following JSON formate and make date for
// Convert the JSON object to a String
jsonString = jsonEncode(json.decode(jsonString));
responseCarLicenseMapJordan = jsonDecode(jsonString);
- print(jsonString);
- print(responseCarLicenseMapJordan);
- print(responseCarLicenseMapJordan['plate_number']);
- } else {
- print("JSON string not found");
- }
+ } else {}
// Rest of your code...
- } else {
- print('Request failed with status: ${response.statusCode}');
- print('Request failed with status: ${response.body}');
- }
- } else {
- print('No image selected');
- }
+ } else {}
+ } else {}
}
Future getTextFromCard(String prompt) async {
@@ -1133,7 +1015,6 @@ Output the extracted information in the following JSON formate and make date for
},
],
});
- print(requestBody);
final response = await http.post(
Uri.parse(
@@ -1146,13 +1027,9 @@ Output the extracted information in the following JSON formate and make date for
if (response.statusCode == 200) {
var responseData = jsonDecode(response.body);
// Process the responseData as needed
- // print(responseData);
var result =
responseData['candidates'][0]['content']['parts'][0]['text'];
- // print(jsonEncode(result));
- // print((result));
- // print(result['dob']);
RegExp regex = RegExp(r"```json([^`]*)```");
String? jsonString =
regex.firstMatch(responseData.toString())?.group(1)?.trim();
@@ -1161,21 +1038,11 @@ Output the extracted information in the following JSON formate and make date for
// Convert the JSON object to a String
jsonString = jsonEncode(json.decode(jsonString));
responseBackCarLicenseMap = jsonDecode(jsonString);
- // print(jsonString);
- print(responseBackCarLicenseMap);
- // print(responseCarLicenseMap['plate_number']);
- } else {
- print("JSON string not found");
- }
+ } else {}
// Rest of your code...
- } else {
- print('Request failed with status: ${response.statusCode}');
- print('Request failed with status: ${response.body}');
- }
- } else {
- print('No image selected');
- }
+ } else {}
+ } else {}
}
Future generateBackCarLicenseJordanContent() async {
@@ -1229,7 +1096,6 @@ Output the extracted information in the following JSON formate and make date for
},
],
});
- print(requestBody);
final response = await http.post(
Uri.parse(
@@ -1242,13 +1108,9 @@ Output the extracted information in the following JSON formate and make date for
if (response.statusCode == 200) {
var responseData = jsonDecode(response.body);
// Process the responseData as needed
- // print(responseData);
var result =
responseData['candidates'][0]['content']['parts'][0]['text'];
- // print(jsonEncode(result));
- // print((result));
- // print(result['dob']);
RegExp regex = RegExp(r"```json([^`]*)```");
String? jsonString =
regex.firstMatch(responseData.toString())?.group(1)?.trim();
@@ -1257,21 +1119,11 @@ Output the extracted information in the following JSON formate and make date for
// Convert the JSON object to a String
jsonString = jsonEncode(json.decode(jsonString));
responseBackCarLicenseMap = jsonDecode(jsonString);
- // print(jsonString);
- print(responseBackCarLicenseMap);
- // print(responseCarLicenseMap['plate_number']);
- } else {
- print("JSON string not found");
- }
+ } else {}
// Rest of your code...
- } else {
- print('Request failed with status: ${response.statusCode}');
- print('Request failed with status: ${response.body}');
- }
- } else {
- print('No image selected');
- }
+ } else {}
+ } else {}
}
Future getFromCarRegistration() async {
@@ -1323,7 +1175,6 @@ Output the extracted information in the following JSON formate and make date for
},
],
});
- print(requestBody);
final response = await http.post(
Uri.parse(
@@ -1337,7 +1188,6 @@ Output the extracted information in the following JSON formate and make date for
// Process the responseData as needed
var result =
responseData['candidates'][0]['content']['parts'][0]['text'];
- print(result);
RegExp regex = RegExp(r"```json([^`]*)```");
String? jsonString =
regex.firstMatch(responseData.toString())?.group(1)?.trim();
@@ -1345,19 +1195,11 @@ Output the extracted information in the following JSON formate and make date for
if (jsonString != null) {
// Convert the JSON object to a String
jsonString = jsonEncode(json.decode(jsonString));
- print(jsonString);
- } else {
- print("JSON string not found");
- }
+ } else {}
// Rest of your code...
- } else {
- print('Request failed with status: ${response.statusCode}');
- print('Request failed with status: ${response.body}');
- }
- } else {
- print('No image selected');
- }
+ } else {}
+ } else {}
}
@override
diff --git a/lib/controller/functions/launch.dart b/lib/controller/functions/launch.dart
index 9ad78c2..eaeecd2 100644
--- a/lib/controller/functions/launch.dart
+++ b/lib/controller/functions/launch.dart
@@ -4,9 +4,7 @@ import 'dart:io';
void showInBrowser(String url) async {
if (await canLaunchUrl(Uri.parse(url))) {
launchUrl(Uri.parse(url));
- } else {
- print('Could not launch $url');
- }
+ } else {}
}
void launchCommunication(
@@ -30,7 +28,6 @@ void launchCommunication(
'mailto:$contactInfo?subject=Subject&body=${Uri.encodeComponent(message)}';
break;
default:
- print('Method not supported on iOS');
return;
}
} else if (Platform.isAndroid) {
@@ -49,7 +46,6 @@ void launchCommunication(
url =
'whatsapp://send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
} else {
- print('WhatsApp is not installed on this device.');
// Provide an alternative action, such as opening the WhatsApp Web API
url =
'https://api.whatsapp.com/send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
@@ -60,19 +56,13 @@ void launchCommunication(
'mailto:$contactInfo?subject=Subject&body=${Uri.encodeComponent(message)}';
break;
default:
- print('Method not supported on Android');
return;
}
} else {
- print('Platform not supported');
return;
}
- print('Launching URL: $url');
-
if (await canLaunchUrl(Uri.parse(url))) {
await launchUrl(Uri.parse(url));
- } else {
- print('Could not launch $url');
- }
+ } else {}
}
diff --git a/lib/controller/functions/llama_ai.dart b/lib/controller/functions/llama_ai.dart
index 6baebb1..6a66d73 100644
--- a/lib/controller/functions/llama_ai.dart
+++ b/lib/controller/functions/llama_ai.dart
@@ -6,21 +6,15 @@ import 'package:SEFER/controller/functions/gemeni.dart';
class LlamaAi {
Future