This commit is contained in:
Hamza-Ayed
2024-05-19 18:43:45 +03:00
parent 83f7f7ab3c
commit e755cea0ae
64 changed files with 382 additions and 296 deletions

8
.env
View File

@@ -28,7 +28,7 @@ passwordPayMob='g@nkD2#99!hD_.wXrXlBl'
integrationIdPayMob=0552355XrXlBl integrationIdPayMob=0552355XrXlBl
payMobApikey='MDrGqKEWS1rVqHvEPDvPjJ7vZDBExrO7S3BEBgrlfUwTA3i5RnP5ZnvoL3M2S9rEBgrlNTdexH5pTPf7NJrvy1reZJv1Tn7zf7vTIDywjHg1C7Ley38HTDyNA3v7TPfdxJrax1rwPmPtMJyzqKEYZeghq3MuLUrFH3A1AgHcH15CZ9UaZTLOxnw0BTdzHHrBArisZerUMUUzZ1BnBeEijHvNjYLnS1BUICMhSmPhA15ifHyVqKEMHWyKLbyuIPvcH9UeL3vZyDf=XrXlBl' payMobApikey='MDrGqKEWS1rVqHvEPDvPjJ7vZDBExrO7S3BEBgrlfUwTA3i5RnP5ZnvoL3M2S9rEBgrlNTdexH5pTPf7NJrvy1reZJv1Tn7zf7vTIDywjHg1C7Ley38HTDyNA3v7TPfdxJrax1rwPmPtMJyzqKEYZeghq3MuLUrFH3A1AgHcH15CZ9UaZTLOxnw0BTdzHHrBArisZerUMUUzZ1BnBeEijHvNjYLnS1BUICMhSmPhA15ifHyVqKEMHWyKLbyuIPvcH9UeL3vZyDf=XrXlBl'
integrationIdPayMobWallet=0552352XrXlBl integrationIdPayMobWallet=0552352XrXlBl
Ocp-Apim-Subscription-Key=21010e54b50f41a4904708c526e102df ocpApimSubscriptionKey=17373j50x53u07q0830634f512j731yuXrXlBl
smsPasswordEgypt="E)Pu=an/@Z" smsPasswordEgypt="J)Vh=qb/@MXrXlBl"
chatGPTkeySeferNew=sk-proj-6r2SrvboRE7hAIpnn8WmT3BlbkFJdPAOf7WOX8aV8CFFaiY5 chatGPTkeySeferNew4=zg-vlie-2l1ZlpxiLJ6wQOvbb4TnC9XrxgUEyVQIu6TID4qP4FUUqoS5XrXlBl
anthropicAIkeySeferNew=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 anthropicAIkeySeferNew=zg-qbc-qvo39-n4VdMQ5nuJeIYhMN4PDYr7qox3-t2i1Lh7aNTDfYF-Gf8whUJZCs47EeelKn8_UcmUMmiSLaf0UJg0DvUlQrDt-76CRrkQQXrXlBl

View File

@@ -55,8 +55,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 22 minSdkVersion 22
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode 23 versionCode 24
versionName '1.4.7' versionName '1.4.8'
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml'] // manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 928 KiB

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -0,0 +1,28 @@
# flutter pub run flutter_launcher_icons
flutter_launcher_icons:
image_path: "assets/images/logo.png"
android: "launcher_icon"
# image_path_android: "assets/icon/icon.png"
min_sdk_android: 21 # android min sdk min:16, default 21
# adaptive_icon_background: "assets/icon/background.png"
# adaptive_icon_foreground: "assets/icon/foreground.png"
ios: true
# image_path_ios: "assets/icon/icon.png"
remove_alpha_channel_ios: true
web:
generate: true
image_path: "path/to/image.png"
background_color: "#hexcode"
theme_color: "#hexcode"
windows:
generate: true
image_path: "path/to/image.png"
icon_size: 48 # min:48, max:256, default: 48
macos:
generate: true
image_path: "path/to/image.png"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 493 B

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 661 B

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -21,7 +21,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>25</string> <string>26</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
@@ -36,7 +36,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>2.0.13</string> <string>2.0.2</string>
<key>FirebaseAppDelegateProxyEnabled</key> <key>FirebaseAppDelegateProxyEnabled</key>
<string>NO</string> <string>NO</string>
<key>GMSApiKey</key> <key>GMSApiKey</key>

View File

@@ -52,6 +52,12 @@ class AK {
a.r(a.r(a.r(Env.payMobApikey, cn), cC), cs); a.r(a.r(a.r(Env.payMobApikey, cn), cC), cs);
static final String integrationIdPayMobWallet = static final String integrationIdPayMobWallet =
a.r(a.r(a.r(Env.integrationIdPayMobWallet, cn), cC), cs); a.r(a.r(a.r(Env.integrationIdPayMobWallet, cn), cC), cs);
static final String smsPassword = static final String smsPasswordEgypt =
a.r(a.r(a.r(Env.integrationIdPayMobWallet, cn), cC), cs); a.r(a.r(a.r(Env.smsPasswordEgypt, cn), cC), cs);
static final String ocpApimSubscriptionKey =
a.r(a.r(a.r(Env.ocpApimSubscriptionKey, cn), cC), cs);
static final String chatGPTkeySeferNew4 =
a.r(a.r(a.r(Env.chatGPTkeySeferNew4, cn), cC), cs);
static final String anthropicAIkeySeferNew =
a.r(a.r(a.r(Env.anthropicAIkeySeferNew, cn), cC), cs);
} }

View File

@@ -5,6 +5,8 @@ class BoxName {
static const String lang = "lang"; static const String lang = "lang";
static const String carType = "carType"; static const String carType = "carType";
static const String deviceInfo = "deviceInfo";
static const String phoneVerified = "phoneVerified";
static const String carPlate = "carPlate"; static const String carPlate = "carPlate";
static const String statusDriverLocation = "statusDriverLocation"; static const String statusDriverLocation = "statusDriverLocation";
static const String password = "password"; static const String password = "password";

View File

@@ -186,6 +186,7 @@ class AppLink {
//===================Auth Captin============ //===================Auth Captin============
static String authCaptin = '$server/auth/captin'; static String authCaptin = '$server/auth/captin';
static String loginCaptin = "$authCaptin/login.php"; static String loginCaptin = "$authCaptin/login.php";
static String loginFromGoogleCaptin = "$authCaptin/loginFromGoogle.php";
static String signUpCaptin = "$authCaptin/register.php"; static String signUpCaptin = "$authCaptin/register.php";
static String sendVerifyEmailCaptin = "$authCaptin/sendVerifyEmail.php"; static String sendVerifyEmailCaptin = "$authCaptin/sendVerifyEmail.php";
static String sendVerifyOtpMessage = "$server/auth/otpmessage.php"; static String sendVerifyOtpMessage = "$server/auth/otpmessage.php";

View File

@@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:math'; import 'dart:math';
import 'package:SEFER/controller/functions/location_background_controller.dart'; import 'package:SEFER/controller/functions/location_background_controller.dart';
import 'package:SEFER/views/auth/captin/register_captin.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@@ -113,6 +114,42 @@ class LoginCaptinController extends GetxController {
} }
} }
void loginFromSignInGoogle(String driverID, email) async {
isloading = true;
update();
var res = await CRUD().get(link: AppLink.loginFromGoogleCaptin, payload: {
'email': email,
'id': driverID,
});
print(res);
if (res == 'failure') {
//Failure
Get.offAll(const RegisterCaptin());
isloading = false;
update();
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) {
//
Get.offAll(const MyApp());
} else {
Get.snackbar(jsonDecoeded['status'], jsonDecoeded['data'],
backgroundColor: Colors.redAccent);
isloading = false;
update();
}
} else {
print('res is null');
isloading = false;
update();
}
}
}
void loginByBoxData() async { void loginByBoxData() async {
Get.to(() => HomeCaptain()); Get.to(() => HomeCaptain());
await CRUD().post(link: AppLink.addTokensDriver, payload: { await CRUD().post(link: AppLink.addTokensDriver, payload: {

View File

@@ -84,29 +84,36 @@ class RegisterCaptainController extends GetxController {
isLoading = true; isLoading = true;
update(); update();
if (formKey3.currentState!.validate()) { if (formKey3.currentState!.validate()) {
await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: { if (box.read(BoxName.countryCode) == 'Egypt') {
'phone_number': phoneController.text, await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: {
'token_code': randomNumber.toString(), 'phone_number': '+2${phoneController.text}',
}); 'token_code': randomNumber.toString(),
});
await smsEgyptController.sendSmsEgypt( await smsEgyptController.sendSmsEgypt(
phoneController.toString(), randomNumber.toString()); phoneController.text.toString(), randomNumber.toString());
isSent = true; isSent = true;
isLoading = false; isLoading = false;
update(); update();
}
} }
} }
verifySMSCode() async { verifySMSCode() async {
if (formKey3.currentState!.validate()) { if (formKey3.currentState!.validate()) {
var res = await CRUD().post(link: AppLink.verifyOtpMessage, payload: { var res = await CRUD().post(link: AppLink.verifyOtpMessage, payload: {
'phone_number': phoneController.text, 'phone_number': '+2${phoneController.text}',
'token_code': verifyCode.text.toString(), 'token_code': verifyCode.text.toString(),
}); });
if (res != 'failure') { if (res != 'failure') {
// var dec = jsonDecode(res); // var dec = jsonDecode(res);
box.write(BoxName.phoneDriver, '+2${phoneController.text}'); box.write(BoxName.phoneDriver, '+2${phoneController.text}');
Get.to(const RegisterCaptin()); var res1 = await CRUD().post(
link: AppLink.updateAccountBank,
payload: {'phone': '+2${phoneController.text}'});
if (jsonDecode(res1)['status'] == 'success') {
Get.to(LoginCaptin());
}
} }
} }
} }

View File

@@ -1,10 +1,11 @@
import 'package:SEFER/constant/box_name.dart'; import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/controller/auth/captin/login_captin_controller.dart';
import 'package:SEFER/main.dart'; import 'package:SEFER/main.dart';
import 'package:SEFER/views/auth/captin/cards_egypt/egypt_card_a_i.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:google_sign_in/google_sign_in.dart'; import 'package:google_sign_in/google_sign_in.dart';
import '../../views/auth/captin/ai_page.dart'; import '../../views/auth/captin/ai_page.dart';
import '../../views/auth/captin/cards/egypt_card_a_i.dart';
class GoogleSignInHelper { class GoogleSignInHelper {
static final GoogleSignIn _googleSignIn = GoogleSignIn( static final GoogleSignIn _googleSignIn = GoogleSignIn(
@@ -33,6 +34,27 @@ class GoogleSignInHelper {
} }
} }
static Future<GoogleSignInAccount?> signInFromLogin() async {
try {
final GoogleSignInAccount? googleUser = await _googleSignIn.signIn();
if (googleUser != null) {
await _handleSignUp(googleUser);
// if (box.read(BoxName.countryCode) == 'Egypt') {
Get.find<LoginCaptinController>().loginFromSignInGoogle(
box.read(BoxName.driverID).toString(),
box.read(BoxName.emailDriver).toString(),
);
// } else if (box.read(BoxName.countryCode) == 'Jordan') {
// // Get.to(() => AiPage());
// }
}
return googleUser;
} catch (error) {
print('Google Sign-In error: $error');
return null;
}
}
// Method to handle Google Sign-Out // Method to handle Google Sign-Out
static Future<void> signOut() async { static Future<void> signOut() async {
try { try {

View File

@@ -138,7 +138,7 @@ class CRUD {
}) async { }) async {
var headers = { var headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '21010e54b50f41a4904708c526e102df' 'Ocp-Apim-Subscription-Key': AK.ocpApimSubscriptionKey
}; };
String imagePathFull = String imagePathFull =

View File

@@ -1,104 +1,25 @@
import 'dart:io'; import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart'; import 'package:device_info_plus/device_info_plus.dart';
import 'package:get_storage/get_storage.dart';
class DeviceInfoPlus { import '../../constant/box_name.dart';
static List<Map<String, dynamic>> deviceDataList = [];
static Future<List<Map<String, dynamic>>> getDeviceInfo() async { class DeviceController {
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin(); String deviceSerialNumber = '';
final box = GetStorage();
try { void getDeviceSerialNumber() async {
if (Platform.isAndroid) { DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo; if (Platform.isAndroid) {
Map<String, dynamic> deviceData = { AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
'platform': 'Android', deviceSerialNumber = androidInfo.serialNumber;
'brand': androidInfo.brand, box.write(BoxName.deviceInfo, deviceSerialNumber.toString());
'model': androidInfo.model, } else if (Platform.isIOS) {
'androidId': androidInfo.device, IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
'versionRelease': androidInfo.version.release, deviceSerialNumber = iosInfo.identifierForVendor!;
'sdkVersion': androidInfo.version.sdkInt, box.write(BoxName.deviceInfo, deviceSerialNumber.toString());
'manufacturer': androidInfo.manufacturer,
'isPhysicalDevice': androidInfo.isPhysicalDevice,
'serialNumber': androidInfo.serialNumber,
'fingerprint': androidInfo.fingerprint,
'type': androidInfo.type,
'data': androidInfo.data,
'version': androidInfo.version,
'tags': androidInfo.tags,
'display': androidInfo.display,
};
deviceDataList.add(deviceData);
} else if (Platform.isIOS) {
IosDeviceInfo iosInfo = await deviceInfoPlugin.iosInfo;
Map<String, dynamic> deviceData = {
'brand': 'Apple',
'model': iosInfo.model,
'systemName': iosInfo.systemName,
'systemVersion': iosInfo.systemVersion,
'utsname': iosInfo.utsname,
'isPhysicalDevice': iosInfo.isPhysicalDevice,
'identifierForVendor': iosInfo.identifierForVendor,
'name': iosInfo.name,
'localizedModel': iosInfo.localizedModel,
};
deviceDataList.add(deviceData);
} else if (Platform.isMacOS) {
MacOsDeviceInfo macInfo = await deviceInfoPlugin.macOsInfo;
Map<String, dynamic> deviceData = {
'platform': 'macOS',
'model': macInfo.model,
'version': macInfo.systemGUID,
};
deviceDataList.add(deviceData);
} else if (Platform.isWindows) {
WindowsDeviceInfo windowsInfo = await deviceInfoPlugin.windowsInfo;
Map<String, dynamic> deviceData = {
'platform': 'Windows',
'manufacturer': windowsInfo.computerName,
'version': windowsInfo.majorVersion,
'deviceId': windowsInfo.deviceId,
'userName': windowsInfo.userName,
'productName': windowsInfo.productName,
'installDate': windowsInfo.installDate,
'productId': windowsInfo.productId,
'numberOfCores': windowsInfo.numberOfCores,
'systemMemoryInMegabytes': windowsInfo.systemMemoryInMegabytes,
};
deviceDataList.add(deviceData);
} else if (Platform.isLinux) {
LinuxDeviceInfo linuxInfo = await deviceInfoPlugin.linuxInfo;
Map<String, dynamic> deviceData = {
'platform': 'Linux',
'manufacturer': linuxInfo.name,
'version': linuxInfo.version,
};
deviceDataList.add(deviceData);
}
} catch (e) {
print('Failed to get device info: $e');
}
return deviceDataList;
}
// Method to print all device data
static void printDeviceInfo() {
for (Map<String, dynamic> deviceData in deviceDataList) {
print('Platform: ${deviceData['platform']}');
print('Brand: ${deviceData['brand']}');
print('Model: ${deviceData['model']}');
print(
'Version: ${deviceData['version'] ?? deviceData['versionRelease'] ?? 'N/A'}');
print('Manufacturer: ${deviceData['manufacturer'] ?? 'N/A'}');
print('Is Physical Device: ${deviceData['isPhysicalDevice']}');
print('Serial Number: ${deviceData['serialNumber'] ?? 'N/A'}');
print('Fingerprint: ${deviceData['fingerprint'] ?? 'N/A'}');
print('Type: ${deviceData['type'] ?? 'N/A'}');
print('Data: ${deviceData['data'] ?? 'N/A'}');
print('Tags: ${deviceData['tags'] ?? 'N/A'}');
print('Display: ${deviceData['display'] ?? 'N/A'}');
print('--------------------');
} }
print(deviceSerialNumber);
} }
} }

View File

@@ -4,6 +4,7 @@ import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/constant/links.dart'; import 'package:SEFER/constant/links.dart';
import 'package:SEFER/constant/style.dart'; import 'package:SEFER/constant/style.dart';
import 'package:SEFER/controller/functions/crud.dart'; import 'package:SEFER/controller/functions/crud.dart';
import 'package:SEFER/controller/functions/device_info.dart';
import 'package:SEFER/main.dart'; import 'package:SEFER/main.dart';
import 'package:SEFER/views/home/Captin/home_captain/home_captin.dart'; import 'package:SEFER/views/home/Captin/home_captain/home_captin.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@@ -197,7 +198,10 @@ class AI extends GetxController {
await addRegistrationCarEgypt(); await addRegistrationCarEgypt();
if (isCarSaved && isDriverSaved) { if (isCarSaved && isDriverSaved) {
Get.to(() => HomeCaptain()); DeviceController().getDeviceSerialNumber();
box.write(BoxName.phoneVerified, '1');
Get.offAll(() => const MyApp());
// Get.offAll(() => HomeCaptain());
} }
} }
} }
@@ -520,8 +524,7 @@ class AI extends GetxController {
final response = await http.post( final response = await http.post(
Uri.parse('https://api.anthropic.com/v1/messages'), Uri.parse('https://api.anthropic.com/v1/messages'),
headers: { headers: {
'x-api-key': 'x-api-key': AK.anthropicAIkeySeferNew,
'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',
'anthropic-version': '2023-06-01', 'anthropic-version': '2023-06-01',
'content-type': 'application/json' 'content-type': 'application/json'
}, },

View File

@@ -1,9 +1,8 @@
import 'dart:async'; import 'dart:async';
import 'package:SEFER/constant/box_name.dart'; import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/controller/auth/captin/login_captin_controller.dart'; import 'package:SEFER/controller/auth/captin/login_captin_controller.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:background_location/background_location.dart'; import 'package:background_location/background_location.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
@@ -13,7 +12,7 @@ class LocationBackgroundController extends GetxController {
@override @override
Future<void> onInit() async { Future<void> onInit() async {
super.onInit(); super.onInit();
// await requestLocationPermission(); await requestLocationPermission();
await configureBackgroundLocation(); await configureBackgroundLocation();
} }
@@ -23,10 +22,33 @@ class LocationBackgroundController extends GetxController {
if (status == PermissionStatus.denied || if (status == PermissionStatus.denied ||
status == PermissionStatus.restricted) { status == PermissionStatus.restricted) {
// Request permission // Show dialog to inform the driver about background GPS location usage
status = await Permission.locationAlways.request(); await Get.dialog(
print('Requested status: $status'); AlertDialog(
title: Text('Location Permission'.tr),
content: Text(
'We use GPS location in the background to enable you to receive orders.'
.tr),
actions: [
TextButton(
onPressed: () async {
Get.back(); // Close the dialog
// Request permission
status = await Permission.locationAlways.request();
print('Requested status: $status');
_handlePermissionStatus(status);
},
child: Text('OK'),
),
],
),
);
} else {
_handlePermissionStatus(status);
} }
}
void _handlePermissionStatus(PermissionStatus status) async {
status = await Permission.locationAlways.status; status = await Permission.locationAlways.status;
if (!status.isGranted) { if (!status.isGranted) {
// Open app settings if permission is permanently denied // Open app settings if permission is permanently denied

View File

@@ -15,7 +15,7 @@ class SmsEgyptController extends GetxController {
Future<dynamic> sendSmsEgypt(String phone, otp) async { Future<dynamic> sendSmsEgypt(String phone, otp) async {
var body = jsonEncode({ var body = jsonEncode({
"username": AppInformation.appName, "username": AppInformation.appName,
"password": AK.smsPassword, "password": 'E)Pu=an/@Z', // AK.smsPasswordEgypt,
"message": "${AppInformation.appName} app code is $otp\ncopy it to app", "message": "${AppInformation.appName} app code is $otp\ncopy it to app",
"language": box.read(BoxName.lang) == 'en' ? "e" : 'r', "language": box.read(BoxName.lang) == 'en' ? "e" : 'r',
"sender": "Kazumi", // todo add sefer sender name "sender": "Kazumi", // todo add sefer sender name
@@ -31,6 +31,7 @@ class SmsEgyptController extends GetxController {
print(res.reasonPhrase); print(res.reasonPhrase);
print(res.request); print(res.request);
print(res.body); print(res.body);
print(body);
if (res.statusCode == 200) { if (res.statusCode == 200) {
Get.defaultDialog( Get.defaultDialog(
title: 'You will recieve code in sms message'.tr, title: 'You will recieve code in sms message'.tr,
@@ -48,7 +49,7 @@ class SmsEgyptController extends GetxController {
Uri.parse(AppLink.checkCredit), Uri.parse(AppLink.checkCredit),
body: { body: {
"username": AppInformation.appName, "username": AppInformation.appName,
"password": AK.smsPassword, "password": AK.smsPasswordEgypt,
}, },
headers: headers, headers: headers,
); );
@@ -60,7 +61,7 @@ class SmsEgyptController extends GetxController {
Uri.parse(AppLink.checkCredit), Uri.parse(AppLink.checkCredit),
body: { body: {
"username": AppInformation.appName, "username": AppInformation.appName,
"password": AK.smsPassword, "password": AK.smsPasswordEgypt,
"message": "This is an example SMS message.", "message": "This is an example SMS message.",
"language": box.read(BoxName.lang) == 'en' ? "e" : 'r', "language": box.read(BoxName.lang) == 'en' ? "e" : 'r',
"sender": "Kazumi", // todo add sefer sender name "sender": "Kazumi", // todo add sefer sender name
@@ -78,7 +79,7 @@ class SmsEgyptController extends GetxController {
Uri.parse(AppLink.checkCredit), Uri.parse(AppLink.checkCredit),
body: { body: {
"username": AppInformation.appName, "username": AppInformation.appName,
"password": AK.smsPassword, "password": AK.smsPasswordEgypt,
"smsid": smsid //"00b77dfc-5b8f-474d-9def-9f0158b70f98" "smsid": smsid //"00b77dfc-5b8f-474d-9def-9f0158b70f98"
}, },
headers: headers, headers: headers,

View File

@@ -19,7 +19,13 @@ class ImageController extends GetxController {
final picker = ImagePicker(); final picker = ImagePicker();
var image; var image;
choosImage(String link, String imageType) async { choosImage(String link, String imageType) async {
final pickedImage = await picker.pickImage(source: ImageSource.gallery); final pickedImage = await picker.pickImage(
source: ImageSource.camera,
preferredCameraDevice: CameraDevice.rear,
// maxHeight: Get.height * .3,
// maxWidth: Get.width * .9,
// imageQuality: 100,
);
image = File(pickedImage!.path); image = File(pickedImage!.path);
croppedFile = await ImageCropper().cropImage( croppedFile = await ImageCropper().cropImage(

View File

@@ -1,15 +1,12 @@
import 'dart:async'; import 'dart:async';
import 'package:SEFER/controller/functions/gemeni.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/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:SEFER/views/auth/login_page.dart';
import '../../constant/box_name.dart'; import '../../constant/box_name.dart';
import '../../main.dart'; import '../../main.dart';
import '../../onbording_page.dart'; import '../../onbording_page.dart';
import '../../views/auth/captin/cards_egypt/sms_signup.dart';
import '../../views/auth/captin/login_captin.dart'; import '../../views/auth/captin/login_captin.dart';
import '../../views/home/Captin/home_captain/home_captin.dart'; import '../../views/home/Captin/home_captain/home_captin.dart';
@@ -50,9 +47,12 @@ class SplashScreenController extends GetxController
Timer(const Duration(seconds: 5), () { Timer(const Duration(seconds: 5), () {
box.read(BoxName.onBoarding) == null box.read(BoxName.onBoarding) == null
? Get.off(() => OnBoardingPage()) ? Get.off(() => OnBoardingPage())
: box.read(BoxName.emailDriver) != null : box.read(BoxName.emailDriver) != null &&
? Get.off(() => SmsSignupEgypt()) box.read(BoxName.deviceInfo) != null &&
: Get.off(() => LoginCaptin()); box.read(BoxName.phoneVerified) == '1'
// ? Get.off(() => SmsSignupEgypt())
? Get.off(() => HomeCaptain())
: Get.off(() => SmsSignupEgypt());
}); });
} }

View File

@@ -74,7 +74,7 @@ void main() async {
print(Get.deviceLocale!.countryCode); print(Get.deviceLocale!.countryCode);
Stripe.publishableKey = AK.publishableKey; Stripe.publishableKey = AK.publishableKey;
// Get.put(LocationBackgroundController()); Get.put(LocationBackgroundController());
if (Platform.isAndroid || Platform.isIOS) { if (Platform.isAndroid || Platform.isIOS) {
await Firebase.initializeApp( await Firebase.initializeApp(
@@ -118,12 +118,6 @@ void main() async {
userTokenExpiration: 200, userTokenExpiration: 200,
iFrameID: 837992, iFrameID: 837992,
); );
// Get device information
List<Map<String, dynamic>> deviceDataList =
await DeviceInfoPlus.getDeviceInfo();
// Print all device data
DeviceInfoPlus.printDeviceInfo();
runApp(const MyApp()); runApp(const MyApp());
} }

View File

@@ -100,7 +100,7 @@ class SmsSignupEgypt extends StatelessWidget {
); );
}), }),
], ],
isleading: false, isleading: true,
); );
} }
} }

View File

@@ -1,3 +1,4 @@
import 'package:SEFER/views/auth/captin/register_captin.dart';
import 'package:animated_text_kit/animated_text_kit.dart'; import 'package:animated_text_kit/animated_text_kit.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@@ -9,12 +10,11 @@ import '../../../constant/colors.dart';
import '../../../constant/info.dart'; import '../../../constant/info.dart';
import '../../../constant/style.dart'; import '../../../constant/style.dart';
import '../../../controller/auth/captin/login_captin_controller.dart'; import '../../../controller/auth/captin/login_captin_controller.dart';
import '../../../controller/auth/google_sign.dart';
import '../../../main.dart'; import '../../../main.dart';
import '../../widgets/elevated_btn.dart'; import '../../widgets/elevated_btn.dart';
import '../../widgets/my_scafold.dart'; import '../../widgets/my_scafold.dart';
import '../../widgets/mycircular.dart';
import '../country_widget.dart'; import '../country_widget.dart';
import 'register_captin.dart';
class LoginCaptin extends StatelessWidget { class LoginCaptin extends StatelessWidget {
// final controller = Get.put(LoginCaptinController()); // final controller = Get.put(LoginCaptinController());
@@ -42,137 +42,177 @@ class LoginCaptin extends StatelessWidget {
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(25), padding: const EdgeInsets.all(25),
child: Container( child:
decoration: const BoxDecoration( // Container(
boxShadow: [ // decoration: const BoxDecoration(
BoxShadow( // boxShadow: [
offset: Offset(3, 3), // BoxShadow(
color: AppColor.accentColor, // offset: Offset(3, 3),
blurRadius: 3) // color: AppColor.accentColor,
], // blurRadius: 3)
color: AppColor.secondaryColor, // ],
), // color: AppColor.secondaryColor,
child: Form( // ),
key: controller.formKey, // child: Form(
child: Padding( // key: controller.formKey,
padding: const EdgeInsets.all(16.0), // child: Padding(
child: SingleChildScrollView( // padding: const EdgeInsets.all(16.0),
child: Column( // child: SingleChildScrollView(
children: [ // child: Column(
TextFormField( // children: [
keyboardType: TextInputType.emailAddress, // TextFormField(
controller: controller.emailController, // keyboardType: TextInputType.emailAddress,
decoration: InputDecoration( // controller: controller.emailController,
focusedBorder: OutlineInputBorder( // decoration: InputDecoration(
borderSide: const BorderSide( // focusedBorder: OutlineInputBorder(
color: AppColor.primaryColor, // borderSide: const BorderSide(
width: 2.0, // color: AppColor.primaryColor,
), // width: 2.0,
borderRadius: BorderRadius.circular(10), // ),
), // borderRadius: BorderRadius.circular(10),
fillColor: AppColor.accentColor, // ),
hoverColor: AppColor.accentColor, // fillColor: AppColor.accentColor,
focusColor: AppColor.accentColor, // hoverColor: AppColor.accentColor,
border: const OutlineInputBorder( // focusColor: AppColor.accentColor,
borderRadius: BorderRadius.all( // border: const OutlineInputBorder(
Radius.circular(12))), // borderRadius: BorderRadius.all(
labelText: 'Email'.tr, // Radius.circular(12))),
hintText: 'Enter your email address'.tr, // labelText: 'Email'.tr,
), // hintText: 'Enter your email address'.tr,
validator: (value) { // ),
if (value!.isEmpty || // validator: (value) {
(!value.contains('@') || // if (value!.isEmpty ||
!value.contains('.'))) { // (!value.contains('@') ||
return 'Please enter Your Email.'.tr; // !value.contains('.'))) {
} // return 'Please enter Your Email.'.tr;
return null; // }
}, // return null;
), // },
const SizedBox( // ),
height: 30, // const SizedBox(
), // height: 30,
TextFormField( // ),
keyboardType: TextInputType.phone, // TextFormField(
cursorColor: AppColor.accentColor, // keyboardType: TextInputType.phone,
controller: controller.phoneController, // cursorColor: AppColor.accentColor,
decoration: InputDecoration( // controller: controller.phoneController,
focusedBorder: OutlineInputBorder( // decoration: InputDecoration(
borderSide: const BorderSide( // focusedBorder: OutlineInputBorder(
color: AppColor.primaryColor, // borderSide: const BorderSide(
width: 2.0, // color: AppColor.primaryColor,
), // width: 2.0,
borderRadius: BorderRadius.circular(10), // ),
), // borderRadius: BorderRadius.circular(10),
focusColor: AppColor.accentColor, // ),
fillColor: AppColor.accentColor, // focusColor: AppColor.accentColor,
border: const OutlineInputBorder( // fillColor: AppColor.accentColor,
borderRadius: BorderRadius.all( // border: const OutlineInputBorder(
Radius.circular(12))), // borderRadius: BorderRadius.all(
labelText: 'Phone'.tr, // Radius.circular(12))),
hintText: 'Enter your phone number'.tr, // labelText: 'Phone'.tr,
), // hintText: 'Enter your phone number'.tr,
validator: (value) { // ),
if (value!.isEmpty || // validator: (value) {
value.length != 10) { // if (value!.isEmpty ||
return 'Please enter your phone number.' // value.length != 10) {
.tr; // return 'Please enter your phone number.'
} // .tr;
return null; // }
}, // return null;
), // },
const SizedBox( // ),
height: 15, // const SizedBox(
), // height: 15,
TextFormField( // ),
obscureText: true, // TextFormField(
keyboardType: TextInputType.emailAddress, // obscureText: true,
controller: controller.passwordController, // keyboardType: TextInputType.emailAddress,
decoration: InputDecoration( // controller: controller.passwordController,
focusedBorder: OutlineInputBorder( // decoration: InputDecoration(
borderSide: const BorderSide( // focusedBorder: OutlineInputBorder(
color: AppColor.primaryColor, // borderSide: const BorderSide(
width: 2.0, // color: AppColor.primaryColor,
), // width: 2.0,
borderRadius: BorderRadius.circular(10), // ),
), // borderRadius: BorderRadius.circular(10),
fillColor: AppColor.accentColor, // ),
hoverColor: AppColor.accentColor, // fillColor: AppColor.accentColor,
focusColor: AppColor.accentColor, // hoverColor: AppColor.accentColor,
border: const OutlineInputBorder( // focusColor: AppColor.accentColor,
borderRadius: BorderRadius.all( // border: const OutlineInputBorder(
Radius.circular(12))), // borderRadius: BorderRadius.all(
labelText: 'Password'.tr, // Radius.circular(12))),
hintText: // labelText: 'Password'.tr,
'Please enter your phone number.'.tr, // hintText:
), // 'Please enter your phone number.'.tr,
validator: (value) { // ),
if (value!.isEmpty) { // validator: (value) {
return 'Please enter Your Password.'.tr; // if (value!.isEmpty) {
} // return 'Please enter Your Password.'.tr;
if (value.length < 6) { // }
return 'Password must br at least 6 character.' // if (value.length < 6) {
.tr; // return 'Password must br at least 6 character.'
} // .tr;
return null; // }
}, // return null;
), // },
controller.isloading // ),
? const MyCircularProgressIndicator() // controller.isloading
: MyElevatedButton( // ? const MyCircularProgressIndicator()
onPressed: () { // : MyElevatedButton(
if (controller.formKey.currentState! // onPressed: () {
.validate()) { // if (controller.formKey.currentState!
controller.login(); // .validate()) {
} // controller.login();
}, // }
title: 'Submit'.tr, // },
), // title: 'Submit'.tr,
], // ),
// ],
// ),
// ),
// ),
// ),
// )
Center(
child: Container(
decoration: AppStyle.boxDecoration1,
height: Get.height * .6,
width: Get.width * .9,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Image.asset(
'assets/images/logo.gif',
height: Get.width * .3,
width: Get.width * .3,
fit: BoxFit.fill,
),
Container(
decoration: AppStyle.boxDecoration1,
height: Get.height * .3,
width: Get.width * .8,
child: Center(
child: Text(
'Sign in with Google for easier email and name entry'
.tr,
textAlign: TextAlign.center,
style: AppStyle.title,
),
), ),
), ),
), MyElevatedButton(
title: 'Sign In by Google'.tr,
onPressed: () async {
await GoogleSignInHelper.signInFromLogin();
},
kolor: AppColor.blueColor,
),
],
), ),
)), ))),
Text( Text(
'if you don\'t have account'.tr, 'if you don\'t have account'.tr,
style: AppStyle.subtitle, style: AppStyle.subtitle,

View File

@@ -4,7 +4,9 @@ import 'package:get/get.dart';
import 'package:SEFER/controller/home/captin/home_captain_controller.dart'; import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import '../../../../../constant/char_map.dart';
import '../../../../../constant/colors.dart'; import '../../../../../constant/colors.dart';
import '../../../../../constant/credential.dart';
import '../../../../Rate/ride_calculate_driver.dart'; import '../../../../Rate/ride_calculate_driver.dart';
import '../../../../../controller/functions/location_controller.dart'; import '../../../../../controller/functions/location_controller.dart';
@@ -24,26 +26,20 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
borderRadius: BorderRadius.circular(15)), borderRadius: BorderRadius.circular(15)),
child: IconButton( child: IconButton(
onPressed: () { onPressed: () {
// AudioController audio = Get.put(AudioController()); AC credentials = AC();
// audio.startRecording(); String apiKey = '21010e54b50f41a4904708c526e102df';
// AC credentials = AC(); String convertedStringN = credentials.c(
// String apiKey = ''; credentials.c(credentials.c(apiKey, cs), cC), cn);
// String convertedStringN = credentials.c( print('Converted v: $convertedStringN');
// credentials.c(credentials.c(apiKey, cs), cC), cn);
// print('Converted v: $convertedStringN'); String retrievedStringS = credentials.r(
credentials.r(credentials.r(convertedStringN, cn), cC),
cs);
print('Retrieved String: $retrievedStringS');
// //
// String retrievedStringS = credentials.r( if (retrievedStringS == apiKey) {
// credentials.r(credentials.r(convertedStringN, cn), cC), print('same');
// cs); }
// print('Retrieved String: $retrievedStringS');
// //
// if (retrievedStringS == apiKey) {
// print('same');
// }
// Get.to((OrderRequestPage()));
// ZonesController mapDriverController =
// Get.put(ZonesController());
// mapDriverController.getJsonOfZones();
}, },
icon: const Icon( icon: const Icon(
FontAwesome.map_signs, FontAwesome.map_signs,