25-3/8/1
This commit is contained in:
6
.env
6
.env
@@ -44,16 +44,14 @@ anthropicAIkeySeferNew=zg-qbc-qvo39-n4VdMQ5nuJeIYhMN4PDYr7qox3-t2i1Lh7aNTDfYF-Gf
|
|||||||
llama3Key=kzg_uTXy3e9DBbCQ1FnMGxYwTKysx9US1burxJj4fFwOje4LZBUFKJS1XrXlBl
|
llama3Key=kzg_uTXy3e9DBbCQ1FnMGxYwTKysx9US1burxJj4fFwOje4LZBUFKJS1XrXlBl
|
||||||
payMobOutPassword='D2zJFxkE#LN3vz38z2dYxpNfWXrXlBl'
|
payMobOutPassword='D2zJFxkE#LN3vz38z2dYxpNfWXrXlBl'
|
||||||
payMobOutUserName='zjujl_qvo_fwjfgjlXrXlBl'
|
payMobOutUserName='zjujl_qvo_fwjfgjlXrXlBl'
|
||||||
keyOfApp=nqryjp@1737wqnmqqsjyzjujljksvceiXrXlBl
|
keyOfApp=nqryjjjhgjp@1bCQ1FnMGxYwsjyzjujljksvceiXrXlBl
|
||||||
initializationVector=abcdefghijklmnop
|
initializationVector=ujljkdelkjlXrXlBlfghijkl
|
||||||
sss_pass=wqnmqqsjyvwv:nqrYJP@17378XrXlBl
|
sss_pass=wqnmqqsjyvwv:nqrYJP@17378XrXlBl
|
||||||
sss_encryptionSalt=zg-vlie-2l1ZlpxiLJ6wQOvbb4TnC9XrxgUEyVQIu6TID4qP4FUUqoS5XrXlBl
|
sss_encryptionSalt=zg-vlie-2l1ZlpxiLJ6wQOvbb4TnC9XrxgUEyVQIu6TID4qP4FUUqoS5XrXlBl
|
||||||
addd=BlBlNl
|
addd=BlBlNl
|
||||||
allowed=TripzDriver:
|
allowed=TripzDriver:
|
||||||
passnpassenger=hbgbitbXrXrBr
|
passnpassenger=hbgbitbXrXrBr
|
||||||
newId=new
|
newId=new
|
||||||
|
|
||||||
|
|
||||||
a=q
|
a=q
|
||||||
b=x
|
b=x
|
||||||
c=f
|
c=f
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class MainActivity : FlutterFragmentActivity() {
|
|||||||
// Log.d("DEBUG", "isNotTrust: $isNotTrust")
|
// Log.d("DEBUG", "isNotTrust: $isNotTrust")
|
||||||
// Log.d("DEBUG", "checkForIssues: $checkForIssues")
|
// Log.d("DEBUG", "checkForIssues: $checkForIssues")
|
||||||
|
|
||||||
if (isRooted || isTampered || !isRealDevice || isOnExternalStorage || isNotTrust) {
|
if (isRooted || isTampered || !isRealDevice) {
|
||||||
// Log.e("DEBUG", "Security issue detected! Showing dialog.")
|
// Log.e("DEBUG", "Security issue detected! Showing dialog.")
|
||||||
showSecurityWarningDialog()
|
showSecurityWarningDialog()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,9 +2,12 @@ import UIKit
|
|||||||
import Flutter
|
import Flutter
|
||||||
import FirebaseCore
|
import FirebaseCore
|
||||||
import GoogleMaps
|
import GoogleMaps
|
||||||
|
import CoreLocation // ✅ استيراد CoreLocation لتحديث الموقع
|
||||||
|
|
||||||
@main
|
@main
|
||||||
@objc class AppDelegate: FlutterAppDelegate {
|
@objc class AppDelegate: FlutterAppDelegate, CLLocationManagerDelegate {
|
||||||
|
var locationManager: CLLocationManager?
|
||||||
|
|
||||||
override func application(
|
override func application(
|
||||||
_ application: UIApplication,
|
_ application: UIApplication,
|
||||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||||
@@ -19,9 +22,28 @@ import GoogleMaps
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ✅ تفعيل تحديث الموقع فور تشغيل التطبيق
|
||||||
|
// startLocationUpdates()
|
||||||
|
|
||||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func startLocationUpdates() {
|
||||||
|
locationManager = CLLocationManager()
|
||||||
|
locationManager?.delegate = self
|
||||||
|
locationManager?.desiredAccuracy = kCLLocationAccuracyBest
|
||||||
|
locationManager?.allowsBackgroundLocationUpdates = true
|
||||||
|
locationManager?.pausesLocationUpdatesAutomatically = false
|
||||||
|
|
||||||
|
locationManager?.requestAlwaysAuthorization() // ✅ طلب إذن الموقع
|
||||||
|
locationManager?.startUpdatingLocation() // ✅ بدء التحديث
|
||||||
|
}
|
||||||
|
|
||||||
|
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
|
||||||
|
guard let location = locations.last else { return }
|
||||||
|
print("📍 Location updated: \(location.coordinate.latitude), \(location.coordinate.longitude)")
|
||||||
|
}
|
||||||
|
|
||||||
func showJailbreakAlert() {
|
func showJailbreakAlert() {
|
||||||
guard let rootVC = UIApplication.shared.keyWindow?.rootViewController else { return }
|
guard let rootVC = UIApplication.shared.keyWindow?.rootViewController else { return }
|
||||||
|
|
||||||
|
|||||||
@@ -1,109 +1,110 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>LSMinimumSystemVersion</key>
|
|
||||||
<string>12.0</string>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<key>UIBackgroundModes</key>
|
<string>12.0</string>
|
||||||
<array>
|
<key>UIBackgroundModes</key>
|
||||||
<string>fetch</string>
|
<array>
|
||||||
<string>location</string>
|
<string>fetch</string>
|
||||||
<string>remote-notification</string>
|
<string>location</string>
|
||||||
</array>
|
<string>remote-notification</string>
|
||||||
<key>BGTaskSchedulerPermittedIdentifiers</key>
|
</array>
|
||||||
<array>
|
<key>BGTaskSchedulerPermittedIdentifiers</key>
|
||||||
|
<array>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
</array>
|
||||||
|
<key>NSContactsUsageDescription</key>
|
||||||
|
<string>This app requires contacts access to function properly.</string>
|
||||||
|
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||||
|
<true />
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
|
<key>CFBundleDisplayName</key>
|
||||||
|
<string>Tripz Driver</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleGetInfoString</key>
|
||||||
|
<string></string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
</array>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<key>NSContactsUsageDescription</key>
|
<string>6.0</string>
|
||||||
<string>This app requires contacts access to function properly.</string>
|
<key>CFBundleName</key>
|
||||||
<key>CADisableMinimumFrameDurationOnPhone</key>
|
<string>Tripz Driver</string>
|
||||||
<true/>
|
<key>CFBundlePackageType</key>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<string>APPL</string>
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
<key>CFBundleShortVersionString</key>
|
||||||
<key>CFBundleDisplayName</key>
|
<string>94</string>
|
||||||
<string>Tripz Driver</string>
|
<key>CFBundleSignature</key>
|
||||||
<key>CFBundleExecutable</key>
|
<string>????</string>
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
<key>CFBundleURLTypes</key>
|
||||||
<key>CFBundleGetInfoString</key>
|
<array>
|
||||||
<string></string>
|
<dict>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleTypeRole</key>
|
||||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
<string>Editor</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleURLSchemes</key>
|
||||||
<string>6.0</string>
|
<array>
|
||||||
<key>CFBundleName</key>
|
<string>com.googleusercontent.apps.594687661098-9fnj82nef9oagl98prigdf8qne3ddbto</string>
|
||||||
<string>Tripz Driver</string>
|
</array>
|
||||||
<key>CFBundlePackageType</key>
|
</dict>
|
||||||
<string>APPL</string>
|
</array>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>94</string>
|
<string>5.0.94</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>FirebaseAppDelegateProxyEnabled</key>
|
||||||
<string>????</string>
|
<string>NO</string>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>GMSApiKey</key>
|
||||||
<array>
|
<string>YOUR_API_KEY</string>
|
||||||
<dict>
|
<key>LSApplicationCategoryType</key>
|
||||||
<key>CFBundleTypeRole</key>
|
<string></string>
|
||||||
<string>Editor</string>
|
<key>LSApplicationQueriesSchemes</key>
|
||||||
<key>CFBundleURLSchemes</key>
|
<array>
|
||||||
<array>
|
<string>googlechromes</string>
|
||||||
<string>com.googleusercontent.apps.594687661098-9fnj82nef9oagl98prigdf8qne3ddbto</string>
|
<string>comgooglemaps</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
</array>
|
<true />
|
||||||
<key>CFBundleVersion</key>
|
<key>NSCameraUsageDescription</key>
|
||||||
<string>5.0.94</string>
|
<string>This app requires access to your camera in order to scan QR codes and capture images
|
||||||
<key>FirebaseAppDelegateProxyEnabled</key>
|
|
||||||
<string>NO</string>
|
|
||||||
<key>GMSApiKey</key>
|
|
||||||
<string>YOUR_API_KEY</string>
|
|
||||||
<key>LSApplicationCategoryType</key>
|
|
||||||
<string></string>
|
|
||||||
<key>LSApplicationQueriesSchemes</key>
|
|
||||||
<array>
|
|
||||||
<string>googlechromes</string>
|
|
||||||
<string>comgooglemaps</string>
|
|
||||||
</array>
|
|
||||||
<key>LSRequiresIPhoneOS</key>
|
|
||||||
<true/>
|
|
||||||
<key>NSCameraUsageDescription</key>
|
|
||||||
<string>This app requires access to your camera in order to scan QR codes and capture images
|
|
||||||
for uploading and access to connect to a call.</string>
|
for uploading and access to connect to a call.</string>
|
||||||
<key>NSFaceIDUsageDescription</key>
|
<key>NSFaceIDUsageDescription</key>
|
||||||
<string>Use Face ID to securely authenticate payment accounts.</string>
|
<string>Use Face ID to securely authenticate payment accounts.</string>
|
||||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||||
<string>This app needs access to your location to provide you with the best ride experience.
|
<string>This app needs access to your location to provide you with the best ride experience.
|
||||||
Your location data will be used to find the nearest available cars and connect you with
|
Your location data will be used to find the nearest available cars and connect you with
|
||||||
the closest captain for efficient and convenient rides.</string>
|
the closest captain for efficient and convenient rides.</string>
|
||||||
<key>NSLocationAlwaysUsageDescription</key>
|
<key>NSLocationAlwaysUsageDescription</key>
|
||||||
<string>This app needs access to location.</string>
|
<string>This app needs access to location.</string>
|
||||||
<key>NSLocationWhenInUseUsageDescription</key>
|
<key>NSLocationWhenInUseUsageDescription</key>
|
||||||
<string>This app needs access to your location to provide you with the best ride experience.
|
<string>This app needs access to your location to provide you with the best ride experience.
|
||||||
Your location data will be used to find the nearest available cars and connect you with
|
Your location data will be used to find the nearest available cars and connect you with
|
||||||
the closest captain for efficient and convenient rides.</string>
|
the closest captain for efficient and convenient rides.</string>
|
||||||
<key>NSMicrophoneUsageDescription</key>
|
<key>NSMicrophoneUsageDescription</key>
|
||||||
<string>This app requires access to your microphone to record audio, allowing you to add
|
<string>This app requires access to your microphone to record audio, allowing you to add
|
||||||
voice recordings to your photos and videos and access to connect to a call.</string>
|
voice recordings to your photos and videos and access to connect to a call.</string>
|
||||||
<key>NSPhotoLibraryUsageDescription</key>
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
<string>Explanation of why your app needs access to the photo library.</string>
|
<string>Explanation of why your app needs access to the photo library.</string>
|
||||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||||
<true/>
|
<true />
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
<string>LaunchScreen</string>
|
<string>LaunchScreen</string>
|
||||||
<key>UIMainStoryboardFile</key>
|
<key>UIMainStoryboardFile</key>
|
||||||
<string>Main</string>
|
<string>Main</string>
|
||||||
<key>UISupportedInterfaceOrientations</key>
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
<array>
|
<array>
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
</array>
|
</array>
|
||||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||||
<array>
|
<array>
|
||||||
<string>UIInterfaceOrientationPortrait</string>
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
</array>
|
</array>
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
<false/>
|
<false />
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
import 'package:crypto/crypto.dart';
|
||||||
|
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:secure_string_operations/secure_string_operations.dart';
|
import 'package:secure_string_operations/secure_string_operations.dart';
|
||||||
@@ -109,14 +111,21 @@ class LoginDriverController extends GetxController {
|
|||||||
return jsonDecode(response1.body)['jwt'].toString();
|
return jsonDecode(response1.body)['jwt'].toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String shortHash(String password) {
|
||||||
|
var bytes = utf8.encode(password);
|
||||||
|
var digest = sha256.convert(bytes);
|
||||||
|
return base64UrlEncode(digest.bytes);
|
||||||
|
}
|
||||||
|
|
||||||
getJWT() async {
|
getJWT() async {
|
||||||
// await SecurityHelper.performSecurityChecks();
|
|
||||||
dev = Platform.isAndroid ? 'android' : 'ios';
|
dev = Platform.isAndroid ? 'android' : 'ios';
|
||||||
|
Log.print(
|
||||||
|
'box.read(BoxName.firstTimeLoadKey): ${box.read(BoxName.firstTimeLoadKey)}');
|
||||||
if (box.read(BoxName.firstTimeLoadKey).toString() != 'false') {
|
if (box.read(BoxName.firstTimeLoadKey).toString() != 'false') {
|
||||||
var response0 = await http.post(
|
var response0 = await http.post(
|
||||||
Uri.parse(AppLink.loginFirstTimeDriver),
|
Uri.parse(AppLink.loginFirstTimeDriver),
|
||||||
body: {
|
body: {
|
||||||
'id': box.read(BoxName.passengerID) ?? AK.newId,
|
'id': box.read(BoxName.driverID) ?? AK.newId,
|
||||||
'password': AK.passnpassenger,
|
'password': AK.passnpassenger,
|
||||||
'aud': '${AK.allowed}$dev',
|
'aud': '${AK.allowed}$dev',
|
||||||
},
|
},
|
||||||
@@ -139,20 +148,26 @@ class LoginDriverController extends GetxController {
|
|||||||
} else {}
|
} else {}
|
||||||
} else {
|
} else {
|
||||||
await EncryptionHelper.initialize();
|
await EncryptionHelper.initialize();
|
||||||
|
var emailDecrypted = (box.read(BoxName.emailDriver));
|
||||||
|
var pass = passwordController.text.isEmpty
|
||||||
|
? '$emailDecrypted${box.read(BoxName.driverID)}'
|
||||||
|
: '${emailController.text.toString()}${box.read(BoxName.driverID)}';
|
||||||
|
String hashedPassword = shortHash(pass);
|
||||||
var payload = {
|
var payload = {
|
||||||
'id': box.read(BoxName.passengerID),
|
'id': box.read(BoxName.driverID),
|
||||||
'password': AK.passnpassenger,
|
'password': hashedPassword,
|
||||||
'aud': '${AK.allowed}$dev',
|
'aud': '${AK.allowed}$dev',
|
||||||
};
|
};
|
||||||
var response1 = await http.post(
|
var response1 = await http.post(
|
||||||
Uri.parse(AppLink.loginJwtDriver),
|
Uri.parse(AppLink.loginJwtDriver),
|
||||||
body: payload,
|
body: payload,
|
||||||
);
|
);
|
||||||
|
print(response1.request);
|
||||||
|
print(response1.body);
|
||||||
|
print(payload);
|
||||||
if (response1.statusCode == 200) {
|
if (response1.statusCode == 200) {
|
||||||
final decodedResponse1 = jsonDecode(response1.body);
|
final decodedResponse1 = jsonDecode(response1.body);
|
||||||
Log.print('decodedResponse1: ${decodedResponse1}');
|
// Log.print('decodedResponse1: ${decodedResponse1}');
|
||||||
|
|
||||||
final jwt = decodedResponse1['jwt'];
|
final jwt = decodedResponse1['jwt'];
|
||||||
await box.write(BoxName.jwt, X.c(X.c(X.c(jwt, cn), cC), cs));
|
await box.write(BoxName.jwt, X.c(X.c(X.c(jwt, cn), cC), cs));
|
||||||
@@ -196,14 +211,18 @@ class LoginDriverController extends GetxController {
|
|||||||
loginWithGoogleCredential(String driverID, email) async {
|
loginWithGoogleCredential(String driverID, email) async {
|
||||||
isloading = true;
|
isloading = true;
|
||||||
update();
|
update();
|
||||||
|
await SecurityHelper.performSecurityChecks();
|
||||||
|
Log.print('(BoxName.emailDriver): ${box.read(BoxName.emailDriver)}');
|
||||||
|
|
||||||
var res = await CRUD().get(link: AppLink.loginFromGoogleCaptin, payload: {
|
var res = await CRUD().get(link: AppLink.loginFromGoogleCaptin, payload: {
|
||||||
'email': email.toString().contains('@')
|
'email': email.toString().contains('@')
|
||||||
|
// ? (box.read(BoxName.emailDriver))
|
||||||
? EncryptionHelper.instance.encryptData(email)
|
? EncryptionHelper.instance.encryptData(email)
|
||||||
: email,
|
: email,
|
||||||
'id': driverID,
|
'id': driverID,
|
||||||
});
|
});
|
||||||
|
|
||||||
print(res);
|
print('res is $res');
|
||||||
if (res == 'failure') {
|
if (res == 'failure') {
|
||||||
//Failure
|
//Failure
|
||||||
if (box.read(BoxName.phoneVerified).toString() == '1') {
|
if (box.read(BoxName.phoneVerified).toString() == '1') {
|
||||||
@@ -221,6 +240,7 @@ class LoginDriverController extends GetxController {
|
|||||||
if (jsonDecoeded['status'] == 'success' &&
|
if (jsonDecoeded['status'] == 'success' &&
|
||||||
jsonDecoeded['data'][0]['is_verified'].toString() == '1') {
|
jsonDecoeded['data'][0]['is_verified'].toString() == '1') {
|
||||||
box.write(BoxName.emailDriver, (jsonDecoeded['data'][0]['email']));
|
box.write(BoxName.emailDriver, (jsonDecoeded['data'][0]['email']));
|
||||||
|
box.write(BoxName.firstTimeLoadKey, 'false');
|
||||||
box.write(BoxName.driverID, (jsonDecoeded['data'][0]['id']));
|
box.write(BoxName.driverID, (jsonDecoeded['data'][0]['id']));
|
||||||
box.write(BoxName.isTest, '1');
|
box.write(BoxName.isTest, '1');
|
||||||
box.write(BoxName.gender, (jsonDecoeded['data'][0]['gender']));
|
box.write(BoxName.gender, (jsonDecoeded['data'][0]['gender']));
|
||||||
@@ -345,8 +365,7 @@ class LoginDriverController extends GetxController {
|
|||||||
'email': EncryptionHelper.instance.encryptData(email),
|
'email': EncryptionHelper.instance.encryptData(email),
|
||||||
'password': password,
|
'password': password,
|
||||||
});
|
});
|
||||||
box.write(BoxName.emailDriver,
|
box.write(BoxName.emailDriver, (email).toString());
|
||||||
EncryptionHelper.instance.encryptData(email).toString());
|
|
||||||
print(res);
|
print(res);
|
||||||
if (res == 'failure') {
|
if (res == 'failure') {
|
||||||
//Failure
|
//Failure
|
||||||
|
|||||||
@@ -123,7 +123,8 @@ class RegisterCaptainController extends GetxController {
|
|||||||
.encryptData('+2${phoneController.text}'));
|
.encryptData('+2${phoneController.text}'));
|
||||||
await Get.put(LoginDriverController()).loginWithGoogleCredential(
|
await Get.put(LoginDriverController()).loginWithGoogleCredential(
|
||||||
box.read(BoxName.driverID).toString(),
|
box.read(BoxName.driverID).toString(),
|
||||||
box.read(BoxName.emailDriver).toString(),
|
EncryptionHelper.instance
|
||||||
|
.encryptData(box.read(BoxName.emailDriver).toString()),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: {
|
await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: {
|
||||||
@@ -132,7 +133,8 @@ class RegisterCaptainController extends GetxController {
|
|||||||
'token_code': EncryptionHelper.instance
|
'token_code': EncryptionHelper.instance
|
||||||
.encryptData(randomNumber.toString()),
|
.encryptData(randomNumber.toString()),
|
||||||
"driverId": box.read(BoxName.driverID),
|
"driverId": box.read(BoxName.driverID),
|
||||||
"email": box.read(BoxName.emailDriver),
|
"email": EncryptionHelper.instance
|
||||||
|
.encryptData(box.read(BoxName.emailDriver)),
|
||||||
});
|
});
|
||||||
|
|
||||||
await smsEgyptController.sendSmsEgypt(
|
await smsEgyptController.sendSmsEgypt(
|
||||||
|
|||||||
@@ -94,8 +94,9 @@ class GoogleSignInHelper {
|
|||||||
// Retrieve driverID and emailDriver with added validation
|
// Retrieve driverID and emailDriver with added validation
|
||||||
final driverID =
|
final driverID =
|
||||||
(box.read(BoxName.driverID)!.toString()) ?? 'Unknown ID';
|
(box.read(BoxName.driverID)!.toString()) ?? 'Unknown ID';
|
||||||
final emailDriver =
|
final emailDriver = EncryptionHelper.instance
|
||||||
(box.read(BoxName.emailDriver)!.toString()) ?? 'Unknown Email';
|
.encryptData(box.read(BoxName.emailDriver)!.toString()) ??
|
||||||
|
'Unknown Email';
|
||||||
|
|
||||||
// Debug print statements
|
// Debug print statements
|
||||||
print('Driver ID: $driverID');
|
print('Driver ID: $driverID');
|
||||||
@@ -125,8 +126,7 @@ class GoogleSignInHelper {
|
|||||||
// Store driver information
|
// Store driver information
|
||||||
box.write(BoxName.driverID,
|
box.write(BoxName.driverID,
|
||||||
(user.id) ?? 'Unknown ID'); // Ensure there's a fallback value
|
(user.id) ?? 'Unknown ID'); // Ensure there's a fallback value
|
||||||
box.write(BoxName.emailDriver,
|
box.write(BoxName.emailDriver, (user.email) ?? 'Unknown Email');
|
||||||
EncryptionHelper.instance.encryptData(user.email) ?? 'Unknown Email');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method to handle Google Sign-Out
|
// Method to handle Google Sign-Out
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import 'package:sefer_driver/controller/functions/secure_storage.dart';
|
|||||||
import 'package:sefer_driver/main.dart';
|
import 'package:sefer_driver/main.dart';
|
||||||
import 'package:sefer_driver/views/auth/verify_email_page.dart';
|
import 'package:sefer_driver/views/auth/verify_email_page.dart';
|
||||||
|
|
||||||
|
import '../functions/encrypt_decrypt.dart';
|
||||||
|
|
||||||
class LoginController extends GetxController {
|
class LoginController extends GetxController {
|
||||||
final formKey = GlobalKey<FormState>();
|
final formKey = GlobalKey<FormState>();
|
||||||
final formKeyAdmin = GlobalKey<FormState>();
|
final formKeyAdmin = GlobalKey<FormState>();
|
||||||
@@ -58,7 +60,10 @@ class LoginController extends GetxController {
|
|||||||
if (jsonDecoeded['status'] == 'success') {
|
if (jsonDecoeded['status'] == 'success') {
|
||||||
if (jsonDecoeded['data'][0]['verified'] == 1) {
|
if (jsonDecoeded['data'][0]['verified'] == 1) {
|
||||||
box.write(BoxName.driverID, jsonDecoeded['data'][0]['id']);
|
box.write(BoxName.driverID, jsonDecoeded['data'][0]['id']);
|
||||||
box.write(BoxName.emailDriver, jsonDecoeded['data'][0]['email']);
|
box.write(
|
||||||
|
BoxName.emailDriver,
|
||||||
|
EncryptionHelper.instance
|
||||||
|
.encryptData(jsonDecoeded['data'][0]['email']));
|
||||||
box.write(
|
box.write(
|
||||||
BoxName.nameDriver,
|
BoxName.nameDriver,
|
||||||
jsonDecoeded['data'][0]['first_name'] +
|
jsonDecoeded['data'][0]['first_name'] +
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'package:jwt_decoder/jwt_decoder.dart';
|
||||||
import 'package:secure_string_operations/secure_string_operations.dart';
|
import 'package:secure_string_operations/secure_string_operations.dart';
|
||||||
import 'package:sefer_driver/constant/box_name.dart';
|
import 'package:sefer_driver/constant/box_name.dart';
|
||||||
import 'package:sefer_driver/constant/links.dart';
|
import 'package:sefer_driver/constant/links.dart';
|
||||||
@@ -22,6 +23,16 @@ class CRUD {
|
|||||||
required String link,
|
required String link,
|
||||||
Map<String, dynamic>? payload,
|
Map<String, dynamic>? payload,
|
||||||
}) async {
|
}) async {
|
||||||
|
bool isTokenExpired = JwtDecoder.isExpired(X
|
||||||
|
.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs)
|
||||||
|
.toString()
|
||||||
|
.split(AppInformation.addd)[0]);
|
||||||
|
Log.print('isTokenExpired: ${isTokenExpired}');
|
||||||
|
|
||||||
|
if (isTokenExpired) {
|
||||||
|
await LoginDriverController().getJWT();
|
||||||
|
}
|
||||||
|
// await Get.put(LoginDriverController()).getJWT();
|
||||||
var url = Uri.parse(
|
var url = Uri.parse(
|
||||||
link,
|
link,
|
||||||
);
|
);
|
||||||
@@ -34,6 +45,9 @@ class CRUD {
|
|||||||
'Bearer ${X.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs).toString().split(AppInformation.addd)[0]}'
|
'Bearer ${X.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs).toString().split(AppInformation.addd)[0]}'
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
print(response.request);
|
||||||
|
print(response.body);
|
||||||
|
print(payload);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
if (jsonData['status'] == 'success') {
|
if (jsonData['status'] == 'success') {
|
||||||
@@ -48,7 +62,7 @@ class CRUD {
|
|||||||
if (jsonData['error'] == 'Token expired') {
|
if (jsonData['error'] == 'Token expired') {
|
||||||
// Show snackbar prompting to re-login
|
// Show snackbar prompting to re-login
|
||||||
await Get.put(LoginDriverController()).getJWT();
|
await Get.put(LoginDriverController()).getJWT();
|
||||||
mySnackbarSuccess('please order now'.tr);
|
// mySnackbarSuccess('please order now'.tr);
|
||||||
|
|
||||||
return 'token_expired'; // Return a specific value for token expiration
|
return 'token_expired'; // Return a specific value for token expiration
|
||||||
} else {
|
} else {
|
||||||
@@ -92,7 +106,7 @@ class CRUD {
|
|||||||
|
|
||||||
if (jsonData['error'] == 'Token expired') {
|
if (jsonData['error'] == 'Token expired') {
|
||||||
// Show snackbar prompting to re-login
|
// Show snackbar prompting to re-login
|
||||||
await Get.put(LoginDriverController()).getJwtWallet();
|
// await Get.put(LoginDriverController()).getJwtWallet();
|
||||||
|
|
||||||
return 'token_expired'; // Return a specific value for token expiration
|
return 'token_expired'; // Return a specific value for token expiration
|
||||||
} else {
|
} else {
|
||||||
@@ -111,6 +125,13 @@ class CRUD {
|
|||||||
{required String link, Map<String, dynamic>? payload}) async {
|
{required String link, Map<String, dynamic>? payload}) async {
|
||||||
var url = Uri.parse(link);
|
var url = Uri.parse(link);
|
||||||
try {
|
try {
|
||||||
|
bool isTokenExpired = JwtDecoder.isExpired(X
|
||||||
|
.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs)
|
||||||
|
.toString()
|
||||||
|
.split(AppInformation.addd)[0]);
|
||||||
|
if (isTokenExpired) {
|
||||||
|
await LoginDriverController().getJWT();
|
||||||
|
}
|
||||||
var response = await http.post(
|
var response = await http.post(
|
||||||
url,
|
url,
|
||||||
body: payload,
|
body: payload,
|
||||||
@@ -121,6 +142,9 @@ class CRUD {
|
|||||||
// 'Authorization': 'Bearer ${box.read(BoxName.jwt)}'
|
// 'Authorization': 'Bearer ${box.read(BoxName.jwt)}'
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
print(response.request);
|
||||||
|
print(response.body);
|
||||||
|
print(payload);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
try {
|
try {
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
@@ -139,7 +163,7 @@ class CRUD {
|
|||||||
|
|
||||||
if (jsonData['error'] == 'Token expired') {
|
if (jsonData['error'] == 'Token expired') {
|
||||||
// Show snackbar prompting to re-login
|
// Show snackbar prompting to re-login
|
||||||
await Get.put(LoginDriverController()).getJWT();
|
// await Get.put(LoginDriverController()).getJWT();
|
||||||
// MyDialog().getDialog(
|
// MyDialog().getDialog(
|
||||||
// 'Session expired. Please log in again.'.tr,
|
// 'Session expired. Please log in again.'.tr,
|
||||||
// '',
|
// '',
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ class EncryptionHelper {
|
|||||||
/// Encrypts a string
|
/// Encrypts a string
|
||||||
String encryptData(String plainText) {
|
String encryptData(String plainText) {
|
||||||
try {
|
try {
|
||||||
final encrypter =
|
final encrypter = encrypt.Encrypter(
|
||||||
encrypt.Encrypter(encrypt.AES(key, mode: encrypt.AESMode.cbc));
|
encrypt.AES(key, mode: encrypt.AESMode.cbc)); // AES-GCM
|
||||||
final encrypted = encrypter.encrypt(plainText, iv: iv);
|
final encrypted = encrypter.encrypt(plainText, iv: iv);
|
||||||
return encrypted.base64;
|
return encrypted.base64;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
import 'package:sefer_driver/constant/api_key.dart';
|
import 'package:sefer_driver/constant/api_key.dart';
|
||||||
import 'package:sefer_driver/constant/box_name.dart';
|
import 'package:sefer_driver/constant/box_name.dart';
|
||||||
import 'package:sefer_driver/main.dart';
|
import 'package:sefer_driver/main.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:http/io_client.dart';
|
||||||
|
|
||||||
import '../../constant/links.dart';
|
import '../../constant/links.dart';
|
||||||
import 'encrypt_decrypt.dart';
|
import 'encrypt_decrypt.dart';
|
||||||
@@ -13,14 +15,16 @@ Future<String> faceDetector() async {
|
|||||||
await Future.delayed(const Duration(seconds: 2));
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
|
|
||||||
var headers = {
|
var headers = {
|
||||||
'Authorization': 'Basic ${AK.basicCompareFaces}',
|
// 'Authorization': 'Basic ${AK.basicCompareFaces}',
|
||||||
|
'Authorization': 'Basic hamza:12345678',
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// var request = http.Request('POST', Uri.parse(//Todo
|
||||||
|
// 'https://face-detect-f6924392c4c7.herokuapp.com/compare_faces'));
|
||||||
|
|
||||||
var request = http.Request(
|
var request = http.Request(
|
||||||
'POST',
|
'POST', Uri.parse('https://mohkh.online:5000/compare_faces'));
|
||||||
Uri.parse(
|
|
||||||
'https://face-detect-f6924392c4c7.herokuapp.com/compare_faces'));
|
|
||||||
|
|
||||||
request.body = json.encode({
|
request.body = json.encode({
|
||||||
"url1":
|
"url1":
|
||||||
@@ -32,7 +36,9 @@ Future<String> faceDetector() async {
|
|||||||
request.headers.addAll(headers);
|
request.headers.addAll(headers);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
http.StreamedResponse response = await request.send();
|
http.Client client = await createHttpClient();
|
||||||
|
http.StreamedResponse response = await client.send(request);
|
||||||
|
// http.StreamedResponse response = await request.send();
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
String result = await response.stream.bytesToString();
|
String result = await response.stream.bytesToString();
|
||||||
@@ -47,3 +53,43 @@ Future<String> faceDetector() async {
|
|||||||
return 'Error: $e';
|
return 'Error: $e';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<http.Client> createHttpClient() async {
|
||||||
|
final SecurityContext securityContext = SecurityContext();
|
||||||
|
HttpClient httpClient = HttpClient(context: securityContext);
|
||||||
|
httpClient.badCertificateCallback =
|
||||||
|
(X509Certificate cert, String host, int port) => true; // Bypass SSL
|
||||||
|
return IOClient(httpClient);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> faceDetector2(String url1, String url2) async {
|
||||||
|
var headers = {
|
||||||
|
'Authorization': 'Basic hamza:12345678',
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
};
|
||||||
|
|
||||||
|
var request = http.Request(
|
||||||
|
'POST', Uri.parse('https://mohkh.online:5000/compare_faces'));
|
||||||
|
|
||||||
|
request.body = json.encode({"url1": url1, "url2": url2});
|
||||||
|
request.headers.addAll(headers);
|
||||||
|
|
||||||
|
try {
|
||||||
|
http.Client client = await createHttpClient(); // Use custom client
|
||||||
|
DateTime startTime = DateTime.now();
|
||||||
|
http.StreamedResponse response = await client.send(request);
|
||||||
|
DateTime endTime = DateTime.now();
|
||||||
|
Duration duration = endTime.difference(startTime);
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
print(await response.stream.bytesToString());
|
||||||
|
print(duration.inSeconds);
|
||||||
|
|
||||||
|
return await response.stream.bytesToString();
|
||||||
|
} else {
|
||||||
|
print(await response.stream.bytesToString());
|
||||||
|
return 'Error: ${response.reasonPhrase}';
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
return 'Exception: $e';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ import 'dart:async';
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
import 'dart:convert';
|
||||||
|
import 'package:crypto/crypto.dart';
|
||||||
|
|
||||||
import 'package:sefer_driver/constant/box_name.dart';
|
import 'package:sefer_driver/constant/box_name.dart';
|
||||||
import 'package:sefer_driver/constant/info.dart';
|
import 'package:sefer_driver/constant/info.dart';
|
||||||
import 'package:sefer_driver/constant/links.dart';
|
import 'package:sefer_driver/constant/links.dart';
|
||||||
@@ -400,7 +403,10 @@ class AI extends GetxController {
|
|||||||
'last_name': EncryptionHelper.instance.encryptData(
|
'last_name': EncryptionHelper.instance.encryptData(
|
||||||
responseNonIdCardFront['full_name'].toString().split(' ').last) ??
|
responseNonIdCardFront['full_name'].toString().split(' ').last) ??
|
||||||
'Not specified',
|
'Not specified',
|
||||||
'email': box.read(BoxName.emailDriver)?.toString() ?? 'Not specified',
|
'email': EncryptionHelper.instance
|
||||||
|
.encryptData(box.read(BoxName.emailDriver))
|
||||||
|
?.toString() ??
|
||||||
|
'Not specified',
|
||||||
'phone': box.read(BoxName.phoneDriver)?.toString() ?? 'Not specified',
|
'phone': box.read(BoxName.phoneDriver)?.toString() ?? 'Not specified',
|
||||||
'id': box.read(BoxName.driverID)?.toString() ?? 'Not specified',
|
'id': box.read(BoxName.driverID)?.toString() ?? 'Not specified',
|
||||||
'password':
|
'password':
|
||||||
@@ -494,9 +500,21 @@ class AI extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String shortHash(String password) {
|
||||||
|
var bytes = utf8.encode(password);
|
||||||
|
var digest = sha256.convert(bytes);
|
||||||
|
return base64UrlEncode(digest.bytes);
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> addDriverEgypt() async {
|
Future<void> addDriverEgypt() async {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
update();
|
update();
|
||||||
|
final loginDriverController = Get.put(LoginDriverController());
|
||||||
|
|
||||||
|
var pass = loginDriverController.passwordController.text.isEmpty
|
||||||
|
? '${box.read(BoxName.emailDriver)}${box.read(BoxName.driverID)}'
|
||||||
|
: '${loginDriverController.emailController.text.toString()}${box.read(BoxName.driverID)}';
|
||||||
|
String hashedPassword = shortHash(pass);
|
||||||
|
|
||||||
var payload = {
|
var payload = {
|
||||||
'first_name': EncryptionHelper.instance.encryptData(
|
'first_name': EncryptionHelper.instance.encryptData(
|
||||||
@@ -505,16 +523,13 @@ class AI extends GetxController {
|
|||||||
'last_name': EncryptionHelper.instance.encryptData(
|
'last_name': EncryptionHelper.instance.encryptData(
|
||||||
responseIdEgyptDriverLicense['lastName'].toString()) ??
|
responseIdEgyptDriverLicense['lastName'].toString()) ??
|
||||||
'Not specified',
|
'Not specified',
|
||||||
'email': box.read(BoxName.emailDriver)?.toString() ?? 'Not specified',
|
'email': EncryptionHelper.instance
|
||||||
|
.encryptData(box.read(BoxName.emailDriver))
|
||||||
|
.toString() ??
|
||||||
|
'Not specified',
|
||||||
'phone': box.read(BoxName.phoneDriver)?.toString() ?? 'Not specified',
|
'phone': box.read(BoxName.phoneDriver)?.toString() ?? 'Not specified',
|
||||||
'id': box.read(BoxName.driverID)?.toString() ?? 'Not specified',
|
'id': box.read(BoxName.driverID)?.toString() ?? 'Not specified',
|
||||||
'password':
|
'password': hashedPassword.toString(),
|
||||||
Get.put(LoginDriverController()).passwordController.text.isEmpty
|
|
||||||
? box.read(BoxName.emailDriver).toString()
|
|
||||||
: Get.find<LoginDriverController>()
|
|
||||||
.passwordController
|
|
||||||
.text
|
|
||||||
.toString(),
|
|
||||||
'gender': EncryptionHelper.instance
|
'gender': EncryptionHelper.instance
|
||||||
.encryptData(responseIdEgyptBack['gender'].toString()) ??
|
.encryptData(responseIdEgyptBack['gender'].toString()) ??
|
||||||
'Not specified',
|
'Not specified',
|
||||||
@@ -825,7 +840,7 @@ class AI extends GetxController {
|
|||||||
var json = jsonDecode(extractedString);
|
var json = jsonDecode(extractedString);
|
||||||
// Log.print('extractedString: ${extractedString}');
|
// Log.print('extractedString: ${extractedString}');
|
||||||
var textValues = CRUD().extractTextFromLines(json);
|
var textValues = CRUD().extractTextFromLines(json);
|
||||||
Log.print('textValues: ${textValues}');
|
Log.print('textValues: $textValues');
|
||||||
// Log.print('json: ${json}');
|
// Log.print('json: ${json}');
|
||||||
|
|
||||||
DocumentType detectedType = checkDocumentType(textValues);
|
DocumentType detectedType = checkDocumentType(textValues);
|
||||||
@@ -1141,7 +1156,7 @@ class AI extends GetxController {
|
|||||||
jsonDecode(responseData['content'][0]['text']);
|
jsonDecode(responseData['content'][0]['text']);
|
||||||
} else if (idType == 'non_id_front') {
|
} else if (idType == 'non_id_front') {
|
||||||
responseNonIdCardFront = jsonDecode(responseData['content'][0]['text']);
|
responseNonIdCardFront = jsonDecode(responseData['content'][0]['text']);
|
||||||
Log.print('responseNonIdCardFront: ${responseNonIdCardFront}');
|
Log.print('responseNonIdCardFront: $responseNonIdCardFront');
|
||||||
} else if (idType == 'non_id_back') {
|
} else if (idType == 'non_id_back') {
|
||||||
responseNonIdCardBack = jsonDecode(responseData['content'][0]['text']);
|
responseNonIdCardBack = jsonDecode(responseData['content'][0]['text']);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,8 +37,12 @@ class LocationController extends GetxController {
|
|||||||
void onInit() async {
|
void onInit() async {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
location = Location(); // Initialize the location object
|
location = Location(); // Initialize the location object
|
||||||
|
await location.changeSettings(
|
||||||
|
accuracy: LocationAccuracy.high,
|
||||||
|
interval: 5000, // 5 seconds
|
||||||
|
distanceFilter: 0);
|
||||||
await getLocation(); // Fetch the location immediately
|
await getLocation(); // Fetch the location immediately
|
||||||
startLocationUpdates(); // Start periodic location updates
|
await startLocationUpdates(); // Start periodic location updates
|
||||||
|
|
||||||
totalPoints = Get.put(CaptainWalletController()).totalPoints.toString();
|
totalPoints = Get.put(CaptainWalletController()).totalPoints.toString();
|
||||||
isActive = Get.put(HomeCaptainController()).isActive;
|
isActive = Get.put(HomeCaptainController()).isActive;
|
||||||
@@ -70,7 +74,6 @@ class LocationController extends GetxController {
|
|||||||
final locationData = location as Map<String, dynamic>;
|
final locationData = location as Map<String, dynamic>;
|
||||||
|
|
||||||
// Debugging: Print location data
|
// Debugging: Print location data
|
||||||
print('Location Data: $locationData');
|
|
||||||
|
|
||||||
// Convert string values to double
|
// Convert string values to double
|
||||||
final minLatitude =
|
final minLatitude =
|
||||||
@@ -83,7 +86,6 @@ class LocationController extends GetxController {
|
|||||||
double.tryParse(locationData['max_longitude'].toString()) ?? 0.0;
|
double.tryParse(locationData['max_longitude'].toString()) ?? 0.0;
|
||||||
|
|
||||||
// Debugging: Print converted values
|
// Debugging: Print converted values
|
||||||
// print(
|
|
||||||
// 'Converted Values: minLatitude=$minLatitude, maxLatitude=$maxLatitude, minLongitude=$minLongitude, maxLongitude=$maxLongitude');
|
// 'Converted Values: minLatitude=$minLatitude, maxLatitude=$maxLatitude, minLongitude=$minLongitude, maxLongitude=$maxLongitude');
|
||||||
|
|
||||||
if (latitude >= minLatitude &&
|
if (latitude >= minLatitude &&
|
||||||
@@ -92,7 +94,6 @@ class LocationController extends GetxController {
|
|||||||
longitude <= maxLongitude) {
|
longitude <= maxLongitude) {
|
||||||
box.write(BoxName.serverChosen,
|
box.write(BoxName.serverChosen,
|
||||||
EncryptionHelper.instance.decryptData(locationData['server_link']));
|
EncryptionHelper.instance.decryptData(locationData['server_link']));
|
||||||
// Log.print(
|
|
||||||
// 'locationData----server_link: ${locationData['server_link']}');
|
// 'locationData----server_link: ${locationData['server_link']}');
|
||||||
return locationData['name'];
|
return locationData['name'];
|
||||||
}
|
}
|
||||||
@@ -122,12 +123,10 @@ class LocationController extends GetxController {
|
|||||||
if (myLocation == null) {
|
if (myLocation == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// print(
|
|
||||||
// 'Latitude: ${myLocation.latitude}, Longitude: ${myLocation.longitude}');
|
// 'Latitude: ${myLocation.latitude}, Longitude: ${myLocation.longitude}');
|
||||||
|
|
||||||
String area =
|
String area =
|
||||||
getLocationArea(myLocation.latitude, myLocation.longitude);
|
getLocationArea(myLocation.latitude, myLocation.longitude);
|
||||||
print('Determined Area: $area');
|
|
||||||
|
|
||||||
if (box.read(BoxName.driverID) != null) {
|
if (box.read(BoxName.driverID) != null) {
|
||||||
await CRUD().post(
|
await CRUD().post(
|
||||||
@@ -160,9 +159,7 @@ class LocationController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {}
|
||||||
Log.print('Error during location update: $e');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -235,12 +235,7 @@ class SecurityHelper {
|
|||||||
// debugPrint("Bundle ID: $bundleId"); // Print the bundle ID
|
// debugPrint("Bundle ID: $bundleId"); // Print the bundle ID
|
||||||
|
|
||||||
// Check for security risks and potentially show a warning
|
// Check for security risks and potentially show a warning
|
||||||
if (isNotTrust ||
|
if (isJailBroken || isNotTrust || !isRealDevice || isTampered) {
|
||||||
isJailBroken ||
|
|
||||||
isTampered ||
|
|
||||||
isDevMode ||
|
|
||||||
isOnExternalStorage ||
|
|
||||||
!isRealDevice) {
|
|
||||||
// print("security_warning".tr); //using easy_localization
|
// print("security_warning".tr); //using easy_localization
|
||||||
// Use a more robust approach to show a warning, like a dialog:
|
// Use a more robust approach to show a warning, like a dialog:
|
||||||
_showSecurityWarning();
|
_showSecurityWarning();
|
||||||
|
|||||||
@@ -39,16 +39,13 @@ class AppInitializer {
|
|||||||
List<Map<String, dynamic>> links = [];
|
List<Map<String, dynamic>> links = [];
|
||||||
|
|
||||||
Future<void> initializeApp() async {
|
Future<void> initializeApp() async {
|
||||||
Log.print('box.read("jwt"): ${box.read(BoxName.jwt)}');
|
|
||||||
if (box.read(BoxName.jwt) == null) {
|
if (box.read(BoxName.jwt) == null) {
|
||||||
await LoginDriverController().getJWT();
|
await LoginDriverController().getJWT();
|
||||||
} else {
|
} else {
|
||||||
print('firstTimeLoadKey ${box.read(BoxName.firstTimeLoadKey)}');
|
|
||||||
bool isTokenExpired = JwtDecoder.isExpired(X
|
bool isTokenExpired = JwtDecoder.isExpired(X
|
||||||
.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs)
|
.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs)
|
||||||
.toString()
|
.toString()
|
||||||
.split(AppInformation.addd)[0]);
|
.split(AppInformation.addd)[0]);
|
||||||
Log.print('isTokenExpired: $isTokenExpired');
|
|
||||||
if (isTokenExpired) {
|
if (isTokenExpired) {
|
||||||
await LoginDriverController().getJWT();
|
await LoginDriverController().getJWT();
|
||||||
}
|
}
|
||||||
@@ -73,7 +70,6 @@ class AppInitializer {
|
|||||||
try {
|
try {
|
||||||
var res =
|
var res =
|
||||||
await CRUD().get(link: AppLink.getLocationAreaLinks, payload: {});
|
await CRUD().get(link: AppLink.getLocationAreaLinks, payload: {});
|
||||||
// Log.print('res: ${res}');
|
|
||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
links = List<Map<String, dynamic>>.from(jsonDecode(res)['message']);
|
links = List<Map<String, dynamic>>.from(jsonDecode(res)['message']);
|
||||||
await box.remove(BoxName.locationName);
|
await box.remove(BoxName.locationName);
|
||||||
@@ -93,8 +89,6 @@ class AppInitializer {
|
|||||||
await box.write(BoxName.paymentLink,
|
await box.write(BoxName.paymentLink,
|
||||||
EncryptionHelper.instance.decryptData(links[4]['server_link']));
|
EncryptionHelper.instance.decryptData(links[4]['server_link']));
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {}
|
||||||
print('Error fetching or decoding location data: $e');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ class SmsEgyptController extends GetxController {
|
|||||||
|
|
||||||
await Get.put(LoginDriverController()).loginWithGoogleCredential(
|
await Get.put(LoginDriverController()).loginWithGoogleCredential(
|
||||||
box.read(BoxName.driverID).toString(),
|
box.read(BoxName.driverID).toString(),
|
||||||
box.read(BoxName.emailDriver).toString(),
|
EncryptionHelper.instance
|
||||||
|
.encryptData(box.read(BoxName.emailDriver).toString()),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ class MyTranslation extends Translations {
|
|||||||
"Order Applied": "تم تطبيق الطلب",
|
"Order Applied": "تم تطبيق الطلب",
|
||||||
|
|
||||||
//firebase above
|
//firebase above
|
||||||
|
"cancel": "إلغاء",
|
||||||
'please order now': " الرجاء الطلب مرة أخرى",
|
'please order now': " الرجاء الطلب مرة أخرى",
|
||||||
'Session expired. Please log in again.':
|
'Session expired. Please log in again.':
|
||||||
'انتهت الجلسة. يرجى تسجيل الدخول مرة أخرى.',
|
'انتهت الجلسة. يرجى تسجيل الدخول مرة أخرى.',
|
||||||
@@ -209,6 +210,10 @@ class MyTranslation extends Translations {
|
|||||||
"How much longer will you be?": "قدامك قد إيه",
|
"How much longer will you be?": "قدامك قد إيه",
|
||||||
"Phone number is verified before": "تم التحقق من رقم الهاتف مسبقاً",
|
"Phone number is verified before": "تم التحقق من رقم الهاتف مسبقاً",
|
||||||
"Change Ride": "تغيير الرحلة",
|
"Change Ride": "تغيير الرحلة",
|
||||||
|
"Authentication failed": "فشل المصادقة",
|
||||||
|
"Biometric Authentication": "المصادقة البيومترية",
|
||||||
|
"You should use Touch ID or Face ID to confirm payment":
|
||||||
|
"يجب عليك استخدام Touch ID أو Face ID لتأكيد الدفع",
|
||||||
"Cost Of Trip IS": "تكلفة الرحلة هي",
|
"Cost Of Trip IS": "تكلفة الرحلة هي",
|
||||||
"You must be recharge your Account":
|
"You must be recharge your Account":
|
||||||
"رصيد حسابك غير كافٍ. يرجى إعادة الشحن للمتابعة",
|
"رصيد حسابك غير كافٍ. يرجى إعادة الشحن للمتابعة",
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import 'package:flutter_paypal/flutter_paypal.dart';
|
|||||||
import 'package:flutter_stripe/flutter_stripe.dart';
|
import 'package:flutter_stripe/flutter_stripe.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:local_auth/local_auth.dart';
|
import 'package:local_auth/local_auth.dart';
|
||||||
|
import 'package:sefer_driver/views/widgets/mydialoug.dart';
|
||||||
|
|
||||||
import '../../constant/box_name.dart';
|
import '../../constant/box_name.dart';
|
||||||
import '../../constant/colors.dart';
|
import '../../constant/colors.dart';
|
||||||
@@ -158,8 +159,7 @@ class PaymentController extends GetxController {
|
|||||||
billingDetails: BillingDetails(
|
billingDetails: BillingDetails(
|
||||||
name: EncryptionHelper.instance
|
name: EncryptionHelper.instance
|
||||||
.decryptData(box.read(BoxName.nameDriver)),
|
.decryptData(box.read(BoxName.nameDriver)),
|
||||||
email: EncryptionHelper.instance
|
email: (box.read(BoxName.emailDriver)),
|
||||||
.decryptData(box.read(BoxName.emailDriver)),
|
|
||||||
phone: EncryptionHelper.instance
|
phone: EncryptionHelper.instance
|
||||||
.decryptData(box.read(BoxName.phoneDriver)),
|
.decryptData(box.read(BoxName.phoneDriver)),
|
||||||
address: Address(
|
address: Address(
|
||||||
@@ -578,6 +578,9 @@ class PaymentController extends GetxController {
|
|||||||
// Authenticate the user
|
// Authenticate the user
|
||||||
bool didAuthenticate = await LocalAuthentication().authenticate(
|
bool didAuthenticate = await LocalAuthentication().authenticate(
|
||||||
localizedReason: 'Use Touch ID or Face ID to confirm payment',
|
localizedReason: 'Use Touch ID or Face ID to confirm payment',
|
||||||
|
options: const AuthenticationOptions(
|
||||||
|
biometricOnly: true, // Only biometrics (no fallback to PIN/pattern)
|
||||||
|
),
|
||||||
);
|
);
|
||||||
if (didAuthenticate) {
|
if (didAuthenticate) {
|
||||||
final PaymobResponseWallet? response =
|
final PaymobResponseWallet? response =
|
||||||
@@ -589,32 +592,10 @@ class PaymentController extends GetxController {
|
|||||||
billingData: PaymobBillingDataWallet(),
|
billingData: PaymobBillingDataWallet(),
|
||||||
onPayment: (PaymobResponseWallet response) {},
|
onPayment: (PaymobResponseWallet response) {},
|
||||||
);
|
);
|
||||||
// Log.print('message: ${response!.message}');
|
|
||||||
// Log.print('responseCode: ${response.responseCode}');
|
|
||||||
// Log.print('success: ${response.success}');
|
|
||||||
// Log.print('transactionID: ${response.transactionID}');
|
|
||||||
if (response!.success == true &&
|
if (response!.success == true &&
|
||||||
response.message.toString() == 'Approved') {
|
response.message.toString() == 'Approved') {
|
||||||
// Log.print('transactionID wewer: ${response.transactionID}');
|
|
||||||
Toast.show(context, 'Payment Successful'.tr, AppColor.greenColor);
|
Toast.show(context, 'Payment Successful'.tr, AppColor.greenColor);
|
||||||
method();
|
method();
|
||||||
// Get.defaultDialog(
|
|
||||||
// barrierDismissible: false,
|
|
||||||
// title: 'Payment Successful'.tr,
|
|
||||||
// titleStyle: AppStyle.title,
|
|
||||||
// content: Text(
|
|
||||||
// 'The payment was approved.'.tr,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// ),
|
|
||||||
// confirm: MyElevatedButton(
|
|
||||||
// title: 'OK'.tr,
|
|
||||||
// kolor: AppColor.greenColor,
|
|
||||||
// onPressed: () async {
|
|
||||||
// Get.back();
|
|
||||||
// method();
|
|
||||||
// },
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
} else {
|
} else {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
@@ -653,57 +634,64 @@ class PaymentController extends GetxController {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Authentication failed, handle accordingly
|
// Authentication failed, handle accordingly
|
||||||
|
MyDialog().getDialog('Authentication failed'.tr, ''.tr, () {
|
||||||
|
Get.back();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
final PaymobResponse? response = await PaymobPayment.instance.pay(
|
MyDialog().getDialog('Biometric Authentication'.tr,
|
||||||
context: context,
|
'You should use Touch ID or Face ID to confirm payment'.tr, () {
|
||||||
currency: currency, //"EGP",
|
Get.back();
|
||||||
amountInCents: newAmount, // 19.00 EGP
|
});
|
||||||
billingData: PaymobBillingData(),
|
// final PaymobResponse? response = await PaymobPayment.instance.pay(
|
||||||
onPayment: (PaymobResponse response) {},
|
// context: context,
|
||||||
);
|
// currency: currency, //"EGP",
|
||||||
|
// amountInCents: newAmount, // 19.00 EGP
|
||||||
|
// billingData: PaymobBillingData(),
|
||||||
|
// onPayment: (PaymobResponse response) {},
|
||||||
|
// );
|
||||||
|
|
||||||
// if (response!.responseCode == 'APPROVED') {
|
// // if (response!.responseCode == 'APPROVED') {
|
||||||
if (response!.responseCode == '200' && response.success == true) {
|
// if (response!.responseCode == '200' && response.success == true) {
|
||||||
Toast.show(context, 'Payment Successful'.tr, AppColor.greenColor);
|
// Toast.show(context, 'Payment Successful'.tr, AppColor.greenColor);
|
||||||
method();
|
// method();
|
||||||
// Get.defaultDialog(
|
// Get.defaultDialog(
|
||||||
// barrierDismissible: false,
|
// barrierDismissible: false,
|
||||||
// title: 'Payment Successful'.tr,
|
// title: 'Payment Successful'.tr,
|
||||||
// titleStyle: AppStyle.title,
|
// titleStyle: AppStyle.title,
|
||||||
// // backgroundColor: AppColor.greenColor,
|
// // backgroundColor: AppColor.greenColor,
|
||||||
// content: Text(
|
// content: Text(
|
||||||
// 'The payment was approved.'.tr,
|
// 'The payment was approved.'.tr,
|
||||||
// style: AppStyle.title,
|
// style: AppStyle.title,
|
||||||
// ),
|
// ),
|
||||||
// confirm: MyElevatedButton(
|
// confirm: MyElevatedButton(
|
||||||
// kolor: AppColor.greenColor,
|
// kolor: AppColor.greenColor,
|
||||||
// title: 'OK'.tr,
|
// title: 'OK'.tr,
|
||||||
// onPressed: () async {
|
// onPressed: () async {
|
||||||
// Get.back();
|
// Get.back();
|
||||||
// method();
|
// method();
|
||||||
// },
|
// },
|
||||||
// ),
|
// ),
|
||||||
// );
|
// );
|
||||||
} else {
|
// } else {
|
||||||
Get.defaultDialog(
|
// Get.defaultDialog(
|
||||||
barrierDismissible: false,
|
// barrierDismissible: false,
|
||||||
// backgroundColor: AppColor.redColor,
|
// // backgroundColor: AppColor.redColor,
|
||||||
title: 'Payment Failed'.tr,
|
// title: 'Payment Failed'.tr,
|
||||||
content: Text(
|
// content: Text(
|
||||||
'The payment was not approved. Please try again.'.tr,
|
// 'The payment was not approved. Please try again.'.tr,
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
style: AppStyle.title,
|
// style: AppStyle.title,
|
||||||
),
|
// ),
|
||||||
confirm: MyElevatedButton(
|
// confirm: MyElevatedButton(
|
||||||
title: 'OK'.tr,
|
// title: 'OK'.tr,
|
||||||
kolor: AppColor.redColor,
|
// kolor: AppColor.redColor,
|
||||||
onPressed: () async {
|
// onPressed: () async {
|
||||||
Get.back();
|
// Get.back();
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
|
|||||||
@@ -137,8 +137,7 @@ class PaymobManager extends GetxController {
|
|||||||
EncryptionHelper.instance.decryptData(box.read(BoxName.nameDriver)),
|
EncryptionHelper.instance.decryptData(box.read(BoxName.nameDriver)),
|
||||||
"last_name": EncryptionHelper.instance
|
"last_name": EncryptionHelper.instance
|
||||||
.decryptData(box.read(BoxName.lastNameDriver)),
|
.decryptData(box.read(BoxName.lastNameDriver)),
|
||||||
"email": EncryptionHelper.instance
|
"email": (box.read(BoxName.emailDriver)),
|
||||||
.decryptData(box.read(BoxName.emailDriver)),
|
|
||||||
"phone_number": EncryptionHelper.instance
|
"phone_number": EncryptionHelper.instance
|
||||||
.decryptData(box.read(BoxName.phoneDriver)),
|
.decryptData(box.read(BoxName.phoneDriver)),
|
||||||
"apartment": "NA",
|
"apartment": "NA",
|
||||||
|
|||||||
@@ -224,8 +224,7 @@ class PaymobBillingData {
|
|||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
return {
|
return {
|
||||||
"email":
|
"email": (box.read(BoxName.emailDriver)),
|
||||||
EncryptionHelper.instance.decryptData(box.read(BoxName.emailDriver)),
|
|
||||||
"first_name": box.read(BoxName.nameDriver),
|
"first_name": box.read(BoxName.nameDriver),
|
||||||
"last_name": box.read(BoxName.nameDriver),
|
"last_name": box.read(BoxName.nameDriver),
|
||||||
"phone_number":
|
"phone_number":
|
||||||
|
|||||||
@@ -267,8 +267,7 @@ class PaymobBillingDataWallet {
|
|||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
return {
|
return {
|
||||||
"email":
|
"email": (box.read(BoxName.emailDriver)),
|
||||||
EncryptionHelper.instance.decryptData(box.read(BoxName.emailDriver)),
|
|
||||||
"first_name": box.read(BoxName.name) ?? box.read(BoxName.nameDriver),
|
"first_name": box.read(BoxName.name) ?? box.read(BoxName.nameDriver),
|
||||||
"last_name": box.read(BoxName.name) ?? box.read(BoxName.nameDriver),
|
"last_name": box.read(BoxName.name) ?? box.read(BoxName.nameDriver),
|
||||||
"phone_number": (box.read(BoxName.phoneWallet)),
|
"phone_number": (box.read(BoxName.phoneWallet)),
|
||||||
|
|||||||
@@ -42,9 +42,7 @@ class RatingController extends GetxController {
|
|||||||
"name": box.read(BoxName.driverID) != null
|
"name": box.read(BoxName.driverID) != null
|
||||||
? box.read(BoxName.nameDriver)
|
? box.read(BoxName.nameDriver)
|
||||||
: box.read(BoxName.name),
|
: box.read(BoxName.name),
|
||||||
"email": EncryptionHelper.instance
|
"email": (box.read(BoxName.emailDriver)).toString(),
|
||||||
.decryptData(box.read(BoxName.emailDriver))
|
|
||||||
.toString(),
|
|
||||||
"phone": EncryptionHelper.instance
|
"phone": EncryptionHelper.instance
|
||||||
.decryptData(box.read(BoxName.phoneDriver))
|
.decryptData(box.read(BoxName.phoneDriver))
|
||||||
.toString(),
|
.toString(),
|
||||||
|
|||||||
@@ -135,9 +135,9 @@ void main() async {
|
|||||||
Stripe.publishableKey = AK.publishableKeyStripe;
|
Stripe.publishableKey = AK.publishableKeyStripe;
|
||||||
|
|
||||||
PermissionStatus status1 = await Permission.location.status;
|
PermissionStatus status1 = await Permission.location.status;
|
||||||
if (status1.isGranted) {
|
// if (status1.isGranted) {
|
||||||
await LocationController().startLocationUpdates();
|
await LocationController().startLocationUpdates();
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (Platform.isAndroid || Platform.isIOS) {
|
if (Platform.isAndroid || Platform.isIOS) {
|
||||||
NotificationController notificationController =
|
NotificationController notificationController =
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
import 'package:sefer_driver/constant/box_name.dart';
|
|
||||||
import 'package:sefer_driver/controller/functions/gemeni.dart';
|
|
||||||
import 'package:sefer_driver/controller/functions/tts.dart';
|
|
||||||
import 'package:sefer_driver/views/widgets/elevated_btn.dart';
|
|
||||||
import 'package:sefer_driver/views/widgets/my_circular_indicator_timer.dart';
|
|
||||||
import 'package:sefer_driver/views/widgets/mydialoug.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
import '../../../../constant/box_name.dart';
|
||||||
import '../../../../constant/colors.dart';
|
import '../../../../constant/colors.dart';
|
||||||
import '../../../../constant/links.dart';
|
import '../../../../constant/links.dart';
|
||||||
import '../../../../constant/style.dart';
|
import '../../../../constant/style.dart';
|
||||||
import '../../../../controller/functions/encrypt_decrypt.dart';
|
import '../../../../controller/functions/encrypt_decrypt.dart';
|
||||||
|
import '../../../../controller/functions/gemeni.dart';
|
||||||
import '../../../../controller/functions/package_info.dart';
|
import '../../../../controller/functions/package_info.dart';
|
||||||
|
import '../../../../controller/functions/tts.dart';
|
||||||
import '../../../../main.dart';
|
import '../../../../main.dart';
|
||||||
|
import '../../../widgets/elevated_btn.dart';
|
||||||
|
import '../../../widgets/my_circular_indicator_timer.dart';
|
||||||
import '../../../widgets/my_scafold.dart';
|
import '../../../widgets/my_scafold.dart';
|
||||||
|
import '../../../widgets/mydialoug.dart';
|
||||||
|
|
||||||
class EgyptCardAI extends StatelessWidget {
|
class EgyptCardAI extends StatelessWidget {
|
||||||
EgyptCardAI({super.key});
|
EgyptCardAI({super.key});
|
||||||
@@ -172,7 +172,7 @@ class EgyptCardAI extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Text(
|
Text(
|
||||||
'To become a ride-sharing driver on the Sefer app, you need to upload your driver\'s license, ID document, and car registration document. Our AI system will instantly review and verify their authenticity in just 2-3 minutes. If your documents are approved, you can start working as a driver on the Sefer app. Please note, submitting fraudulent documents is a serious offense and may result in immediate termination and legal consequences.'
|
'To become a ride-sharing driver on the Tripz app, you need to upload your driver\'s license, ID document, and car registration document. Our AI system will instantly review and verify their authenticity in just 2-3 minutes. If your documents are approved, you can start working as a driver on the Tripz app. Please note, submitting fraudulent documents is a serious offense and may result in immediate termination and legal consequences.'
|
||||||
.tr,
|
.tr,
|
||||||
style: AppStyle.title,
|
style: AppStyle.title,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
@@ -184,7 +184,7 @@ class EgyptCardAI extends StatelessWidget {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
controller.startTimer();
|
controller.startTimer();
|
||||||
await textToSpeechController.speakText(
|
await textToSpeechController.speakText(
|
||||||
'To become a ride-sharing driver on the Sefer app, you need to upload your driver\'s license, ID document, and car registration document. Our AI system will instantly review and verify their authenticity in just 2-3 minutes. If your documents are approved, you can start working as a driver on the Sefer app. Please note, submitting fraudulent documents is a serious offense and may result in immediate termination and legal consequences.'
|
'To become a ride-sharing driver on the Tripz app, you need to upload your driver\'s license, ID document, and car registration document. Our AI system will instantly review and verify their authenticity in just 2-3 minutes. If your documents are approved, you can start working as a driver on the Tripz app. Please note, submitting fraudulent documents is a serious offense and may result in immediate termination and legal consequences.'
|
||||||
.tr);
|
.tr);
|
||||||
},
|
},
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
|
|||||||
@@ -325,11 +325,8 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
User? user = await authController
|
User? user = await authController
|
||||||
.signInWithApple();
|
.signInWithApple();
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
box.write(
|
box.write(BoxName.emailDriver,
|
||||||
BoxName.emailDriver,
|
(user.email.toString()));
|
||||||
EncryptionHelper.instance
|
|
||||||
.encryptData(
|
|
||||||
user.email.toString()));
|
|
||||||
|
|
||||||
box.write(
|
box.write(
|
||||||
BoxName.driverID, user.uid);
|
BoxName.driverID, user.uid);
|
||||||
@@ -339,9 +336,10 @@ class LoginCaptin extends StatelessWidget {
|
|||||||
box
|
box
|
||||||
.read(BoxName.driverID)
|
.read(BoxName.driverID)
|
||||||
.toString(),
|
.toString(),
|
||||||
box
|
EncryptionHelper.instance
|
||||||
.read(BoxName.emailDriver)
|
.encryptData(box
|
||||||
.toString(),
|
.read(BoxName.emailDriver)
|
||||||
|
.toString()),
|
||||||
);
|
);
|
||||||
// Navigate to another screen or perform other actions
|
// Navigate to another screen or perform other actions
|
||||||
} else {}
|
} else {}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import 'package:sefer_driver/constant/api_key.dart';
|
|
||||||
import 'package:sefer_driver/constant/links.dart';
|
import 'package:sefer_driver/constant/links.dart';
|
||||||
import 'package:sefer_driver/constant/style.dart';
|
import 'package:sefer_driver/constant/style.dart';
|
||||||
import 'package:sefer_driver/controller/functions/encrypt_decrypt.dart';
|
|
||||||
import 'package:sefer_driver/controller/home/captin/home_captain_controller.dart';
|
import 'package:sefer_driver/controller/home/captin/home_captain_controller.dart';
|
||||||
import 'package:sefer_driver/views/Rate/rate_app_page.dart';
|
import 'package:sefer_driver/views/Rate/rate_app_page.dart';
|
||||||
import 'package:sefer_driver/views/auth/captin/contact_us_page.dart';
|
import 'package:sefer_driver/views/auth/captin/contact_us_page.dart';
|
||||||
@@ -536,9 +534,7 @@ class UserAccountHeader extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 4),
|
const SizedBox(height: 4),
|
||||||
Text(
|
Text(
|
||||||
EncryptionHelper.instance.decryptData(
|
box.read(BoxName.emailDriver),
|
||||||
box.read(BoxName.emailDriver),
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white.withOpacity(0.9),
|
color: Colors.white.withOpacity(0.9),
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
import 'dart:math';
|
||||||
|
import 'package:crypto/crypto.dart';
|
||||||
|
|
||||||
|
import 'package:location/location.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:sefer_driver/constant/box_name.dart';
|
import 'package:sefer_driver/constant/box_name.dart';
|
||||||
import 'package:sefer_driver/controller/firebase/local_notification.dart';
|
import 'package:sefer_driver/controller/firebase/local_notification.dart';
|
||||||
import 'package:sefer_driver/controller/functions/crud.dart';
|
import 'package:sefer_driver/controller/functions/encrypt_decrypt.dart';
|
||||||
import 'package:sefer_driver/main.dart';
|
import 'package:sefer_driver/main.dart';
|
||||||
import 'package:sefer_driver/views/auth/captin/cards/sms_signup.dart';
|
|
||||||
import 'package:sefer_driver/views/home/Captin/orderCaptin/vip_order_page.dart';
|
import 'package:sefer_driver/views/home/Captin/orderCaptin/vip_order_page.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||||
@@ -12,7 +15,8 @@ import 'package:get/get.dart';
|
|||||||
import 'package:sefer_driver/controller/home/captin/home_captain_controller.dart';
|
import 'package:sefer_driver/controller/home/captin/home_captain_controller.dart';
|
||||||
|
|
||||||
import '../../../../../constant/colors.dart';
|
import '../../../../../constant/colors.dart';
|
||||||
import '../../../../../controller/functions/encrypt_decrypt.dart';
|
import '../../../../../controller/functions/face_detect.dart';
|
||||||
|
import '../../../../../controller/functions/location_controller.dart';
|
||||||
import '../../../../../print.dart';
|
import '../../../../../print.dart';
|
||||||
import '../../../../Rate/ride_calculate_driver.dart';
|
import '../../../../Rate/ride_calculate_driver.dart';
|
||||||
|
|
||||||
@@ -96,27 +100,49 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
|||||||
)
|
)
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
// : const SizedBox(),
|
// : const SizedBox(),
|
||||||
// AnimatedContainer(
|
AnimatedContainer(
|
||||||
// duration: const Duration(microseconds: 200),
|
duration: const Duration(microseconds: 200),
|
||||||
// width: controller.widthMapTypeAndTraffic,
|
width: controller.widthMapTypeAndTraffic,
|
||||||
// decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
// color: AppColor.secondaryColor,
|
color: AppColor.secondaryColor,
|
||||||
// border: Border.all(color: AppColor.blueColor),
|
border: Border.all(color: AppColor.blueColor),
|
||||||
// borderRadius: BorderRadius.circular(15)),
|
borderRadius: BorderRadius.circular(15)),
|
||||||
// child: Builder(builder: (context) {
|
child: Builder(builder: (context) {
|
||||||
// return IconButton(
|
return IconButton(
|
||||||
// onPressed: () async {
|
onPressed: () async {
|
||||||
// await storage.deleteAll();
|
// String shortHash(String password) {
|
||||||
// box.erase();
|
// var bytes = utf8.encode(password);
|
||||||
// },
|
// var digest = sha256.convert(bytes);
|
||||||
// icon: const Icon(
|
// return base64UrlEncode(digest.bytes);
|
||||||
// FontAwesome5.grin_tears,
|
// }
|
||||||
// size: 29,
|
|
||||||
// color: AppColor.blueColor,
|
// String password =
|
||||||
// ),
|
// '${EncryptionHelper.instance.decryptData(box.read(BoxName.emailDriver))}${box.read(BoxName.driverID)}';
|
||||||
// );
|
// String hashedPassword = shortHash(password);
|
||||||
// }),
|
// Log.print('password: ${password}');
|
||||||
// ),
|
// print("Hashed Password: $hashedPassword");
|
||||||
|
Location location = Location();
|
||||||
|
LocationData _locationData = await location.getLocation();
|
||||||
|
Log.print('location: ${_locationData}');
|
||||||
|
print(
|
||||||
|
'Location: ${controller.myLocation.latitude}, ${controller.myLocation.longitude}');
|
||||||
|
var status1 = await Permission.location.status;
|
||||||
|
Log.print('status1: ${status1}');
|
||||||
|
// if (status1.isGranted) {
|
||||||
|
await LocationController().startLocationUpdates();
|
||||||
|
// } else {
|
||||||
|
// // openAppSettings();
|
||||||
|
// await Permission.locationAlways.request();
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
FontAwesome5.grin_tears,
|
||||||
|
size: 29,
|
||||||
|
color: AppColor.blueColor,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 5,
|
height: 5,
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ class CardSeferWalletDriver extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
// '${AppInformation.appName} Wallet',
|
// '${AppInformation.appName} Wallet',
|
||||||
'Sovo Wallet',
|
'Tripz Wallet',
|
||||||
style: AppStyle.headTitle.copyWith(
|
style: AppStyle.headTitle.copyWith(
|
||||||
color: AppColor.writeColor, fontSize: 26),
|
color: AppColor.writeColor, fontSize: 26),
|
||||||
),
|
),
|
||||||
|
|||||||
16
pubspec.lock
16
pubspec.lock
@@ -1064,10 +1064,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: google_maps_flutter
|
name: google_maps_flutter
|
||||||
sha256: "209856c8e5571626afba7182cf634b2910069dc567954e76ec3e3fb37f5e9db3"
|
sha256: "621125e35e81ca39ef600e45243d2be93167e61def72bc7207b0c4a635c58506"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.10.0"
|
version: "2.10.1"
|
||||||
google_maps_flutter_android:
|
google_maps_flutter_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -1456,26 +1456,26 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: location
|
name: location
|
||||||
sha256: ee57923720163324416ce0306b701db6d845d2c1a3bf44d25b607cbddbaa3973
|
sha256: c2c4304071ec860525d5c50d142410072f8620c1d9f74874811af2e804e1a9c8
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.0.1"
|
version: "8.0.0"
|
||||||
location_platform_interface:
|
location_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: location_platform_interface
|
name: location_platform_interface
|
||||||
sha256: "1e535ccc8b4a9612de4e4319871136b45d2b5d1fb0c2a8bf99687242bf7ca5f7"
|
sha256: a3404ea6d74e89b121630be62ed8edcc7b39fd108bd19805d0ae55c397135dd7
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.0"
|
version: "6.0.0"
|
||||||
location_web:
|
location_web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: location_web
|
name: location_web
|
||||||
sha256: e6435cfd175b0f6e94d6fdc43c104d13cec7e27b21a8cee00bd9516a3d6a4c81
|
sha256: "744bdff53dc455a2dc9a34474c49cde364d4fbef2aee009f8b0b4b68570c27a1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.4"
|
version: "6.0.0"
|
||||||
logging:
|
logging:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ dependencies:
|
|||||||
firebase_messaging: ^15.0.3
|
firebase_messaging: ^15.0.3
|
||||||
firebase_core: ^3.2.0
|
firebase_core: ^3.2.0
|
||||||
flutter_local_notifications: ^18.0.1
|
flutter_local_notifications: ^18.0.1
|
||||||
google_maps_flutter: ^2.5.0
|
google_maps_flutter: ^2.10.1
|
||||||
sqflite: ^2.3.0
|
sqflite: ^2.3.0
|
||||||
path: ^1.8.3
|
path: ^1.8.3
|
||||||
# lottie: ^2.5.0
|
# lottie: ^2.5.0
|
||||||
@@ -31,7 +31,7 @@ dependencies:
|
|||||||
get: ^4.6.5
|
get: ^4.6.5
|
||||||
get_storage: ^2.1.1
|
get_storage: ^2.1.1
|
||||||
url_launcher: ^6.1.12
|
url_launcher: ^6.1.12
|
||||||
location: ^7.0.0
|
location: ^8.0.0
|
||||||
google_polyline_algorithm: ^3.1.0
|
google_polyline_algorithm: ^3.1.0
|
||||||
# custom_searchable_dropdown: ^2.1.1
|
# custom_searchable_dropdown: ^2.1.1
|
||||||
animated_text_kit: ^4.2.2
|
animated_text_kit: ^4.2.2
|
||||||
|
|||||||
Reference in New Issue
Block a user