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
payMobApikey='MDrGqKEWS1rVqHvEPDvPjJ7vZDBExrO7S3BEBgrlfUwTA3i5RnP5ZnvoL3M2S9rEBgrlNTdexH5pTPf7NJrvy1reZJv1Tn7zf7vTIDywjHg1C7Ley38HTDyNA3v7TPfdxJrax1rwPmPtMJyzqKEYZeghq3MuLUrFH3A1AgHcH15CZ9UaZTLOxnw0BTdzHHrBArisZerUMUUzZ1BnBeEijHvNjYLnS1BUICMhSmPhA15ifHyVqKEMHWyKLbyuIPvcH9UeL3vZyDf=XrXlBl'
integrationIdPayMobWallet=0552352XrXlBl
Ocp-Apim-Subscription-Key=21010e54b50f41a4904708c526e102df
smsPasswordEgypt="E)Pu=an/@Z"
chatGPTkeySeferNew=sk-proj-6r2SrvboRE7hAIpnn8WmT3BlbkFJdPAOf7WOX8aV8CFFaiY5
anthropicAIkeySeferNew=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
ocpApimSubscriptionKey=17373j50x53u07q0830634f512j731yuXrXlBl
smsPasswordEgypt="J)Vh=qb/@MXrXlBl"
chatGPTkeySeferNew4=zg-vlie-2l1ZlpxiLJ6wQOvbb4TnC9XrxgUEyVQIu6TID4qP4FUUqoS5XrXlBl
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.
minSdkVersion 22
targetSdkVersion flutter.targetSdkVersion
versionCode 23
versionName '1.4.7'
versionCode 24
versionName '1.4.8'
// 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>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>25</string>
<string>26</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@@ -36,7 +36,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>2.0.13</string>
<string>2.0.2</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<string>NO</string>
<key>GMSApiKey</key>

View File

@@ -52,6 +52,12 @@ class AK {
a.r(a.r(a.r(Env.payMobApikey, cn), cC), cs);
static final String integrationIdPayMobWallet =
a.r(a.r(a.r(Env.integrationIdPayMobWallet, cn), cC), cs);
static final String smsPassword =
a.r(a.r(a.r(Env.integrationIdPayMobWallet, cn), cC), cs);
static final String smsPasswordEgypt =
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 carType = "carType";
static const String deviceInfo = "deviceInfo";
static const String phoneVerified = "phoneVerified";
static const String carPlate = "carPlate";
static const String statusDriverLocation = "statusDriverLocation";
static const String password = "password";

View File

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

View File

@@ -2,6 +2,7 @@ import 'dart:convert';
import 'dart:math';
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_secure_storage/flutter_secure_storage.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 {
Get.to(() => HomeCaptain());
await CRUD().post(link: AppLink.addTokensDriver, payload: {

View File

@@ -84,29 +84,36 @@ class RegisterCaptainController extends GetxController {
isLoading = true;
update();
if (formKey3.currentState!.validate()) {
await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: {
'phone_number': phoneController.text,
'token_code': randomNumber.toString(),
});
if (box.read(BoxName.countryCode) == 'Egypt') {
await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: {
'phone_number': '+2${phoneController.text}',
'token_code': randomNumber.toString(),
});
await smsEgyptController.sendSmsEgypt(
phoneController.toString(), randomNumber.toString());
isSent = true;
isLoading = false;
update();
await smsEgyptController.sendSmsEgypt(
phoneController.text.toString(), randomNumber.toString());
isSent = true;
isLoading = false;
update();
}
}
}
verifySMSCode() async {
if (formKey3.currentState!.validate()) {
var res = await CRUD().post(link: AppLink.verifyOtpMessage, payload: {
'phone_number': phoneController.text,
'phone_number': '+2${phoneController.text}',
'token_code': verifyCode.text.toString(),
});
if (res != 'failure') {
// var dec = jsonDecode(res);
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/controller/auth/captin/login_captin_controller.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:google_sign_in/google_sign_in.dart';
import '../../views/auth/captin/ai_page.dart';
import '../../views/auth/captin/cards/egypt_card_a_i.dart';
class GoogleSignInHelper {
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
static Future<void> signOut() async {
try {

View File

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

View File

@@ -1,104 +1,25 @@
import 'dart:io';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:get_storage/get_storage.dart';
class DeviceInfoPlus {
static List<Map<String, dynamic>> deviceDataList = [];
import '../../constant/box_name.dart';
static Future<List<Map<String, dynamic>>> getDeviceInfo() async {
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
class DeviceController {
String deviceSerialNumber = '';
final box = GetStorage();
try {
if (Platform.isAndroid) {
AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo;
Map<String, dynamic> deviceData = {
'platform': 'Android',
'brand': androidInfo.brand,
'model': androidInfo.model,
'androidId': androidInfo.device,
'versionRelease': androidInfo.version.release,
'sdkVersion': androidInfo.version.sdkInt,
'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('--------------------');
void getDeviceSerialNumber() async {
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
if (Platform.isAndroid) {
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
deviceSerialNumber = androidInfo.serialNumber;
box.write(BoxName.deviceInfo, deviceSerialNumber.toString());
} else if (Platform.isIOS) {
IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
deviceSerialNumber = iosInfo.identifierForVendor!;
box.write(BoxName.deviceInfo, deviceSerialNumber.toString());
}
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/style.dart';
import 'package:SEFER/controller/functions/crud.dart';
import 'package:SEFER/controller/functions/device_info.dart';
import 'package:SEFER/main.dart';
import 'package:SEFER/views/home/Captin/home_captain/home_captin.dart';
import 'package:flutter/material.dart';
@@ -197,7 +198,10 @@ class AI extends GetxController {
await addRegistrationCarEgypt();
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(
Uri.parse('https://api.anthropic.com/v1/messages'),
headers: {
'x-api-key':
'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',
'x-api-key': AK.anthropicAIkeySeferNew,
'anthropic-version': '2023-06-01',
'content-type': 'application/json'
},

View File

@@ -1,9 +1,8 @@
import 'dart:async';
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/views/widgets/elevated_btn.dart';
import 'package:background_location/background_location.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart';
@@ -13,7 +12,7 @@ class LocationBackgroundController extends GetxController {
@override
Future<void> onInit() async {
super.onInit();
// await requestLocationPermission();
await requestLocationPermission();
await configureBackgroundLocation();
}
@@ -23,10 +22,33 @@ class LocationBackgroundController extends GetxController {
if (status == PermissionStatus.denied ||
status == PermissionStatus.restricted) {
// Request permission
status = await Permission.locationAlways.request();
print('Requested status: $status');
// Show dialog to inform the driver about background GPS location usage
await Get.dialog(
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;
if (!status.isGranted) {
// 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 {
var body = jsonEncode({
"username": AppInformation.appName,
"password": AK.smsPassword,
"password": 'E)Pu=an/@Z', // AK.smsPasswordEgypt,
"message": "${AppInformation.appName} app code is $otp\ncopy it to app",
"language": box.read(BoxName.lang) == 'en' ? "e" : 'r',
"sender": "Kazumi", // todo add sefer sender name
@@ -31,6 +31,7 @@ class SmsEgyptController extends GetxController {
print(res.reasonPhrase);
print(res.request);
print(res.body);
print(body);
if (res.statusCode == 200) {
Get.defaultDialog(
title: 'You will recieve code in sms message'.tr,
@@ -48,7 +49,7 @@ class SmsEgyptController extends GetxController {
Uri.parse(AppLink.checkCredit),
body: {
"username": AppInformation.appName,
"password": AK.smsPassword,
"password": AK.smsPasswordEgypt,
},
headers: headers,
);
@@ -60,7 +61,7 @@ class SmsEgyptController extends GetxController {
Uri.parse(AppLink.checkCredit),
body: {
"username": AppInformation.appName,
"password": AK.smsPassword,
"password": AK.smsPasswordEgypt,
"message": "This is an example SMS message.",
"language": box.read(BoxName.lang) == 'en' ? "e" : 'r',
"sender": "Kazumi", // todo add sefer sender name
@@ -78,7 +79,7 @@ class SmsEgyptController extends GetxController {
Uri.parse(AppLink.checkCredit),
body: {
"username": AppInformation.appName,
"password": AK.smsPassword,
"password": AK.smsPasswordEgypt,
"smsid": smsid //"00b77dfc-5b8f-474d-9def-9f0158b70f98"
},
headers: headers,

View File

@@ -19,7 +19,13 @@ class ImageController extends GetxController {
final picker = ImagePicker();
var image;
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);
croppedFile = await ImageCropper().cropImage(

View File

@@ -1,15 +1,12 @@
import 'dart:async';
import 'package:SEFER/controller/functions/gemeni.dart';
import 'package:SEFER/views/auth/captin/register_captin.dart';
import 'package:SEFER/views/auth/captin/cards/sms_signup.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/views/auth/login_page.dart';
import '../../constant/box_name.dart';
import '../../main.dart';
import '../../onbording_page.dart';
import '../../views/auth/captin/cards_egypt/sms_signup.dart';
import '../../views/auth/captin/login_captin.dart';
import '../../views/home/Captin/home_captain/home_captin.dart';
@@ -50,9 +47,12 @@ class SplashScreenController extends GetxController
Timer(const Duration(seconds: 5), () {
box.read(BoxName.onBoarding) == null
? Get.off(() => OnBoardingPage())
: box.read(BoxName.emailDriver) != null
? Get.off(() => SmsSignupEgypt())
: Get.off(() => LoginCaptin());
: box.read(BoxName.emailDriver) != null &&
box.read(BoxName.deviceInfo) != null &&
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);
Stripe.publishableKey = AK.publishableKey;
// Get.put(LocationBackgroundController());
Get.put(LocationBackgroundController());
if (Platform.isAndroid || Platform.isIOS) {
await Firebase.initializeApp(
@@ -118,12 +118,6 @@ void main() async {
userTokenExpiration: 200,
iFrameID: 837992,
);
// Get device information
List<Map<String, dynamic>> deviceDataList =
await DeviceInfoPlus.getDeviceInfo();
// Print all device data
DeviceInfoPlus.printDeviceInfo();
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:flutter/gestures.dart';
import 'package:flutter/material.dart';
@@ -9,12 +10,11 @@ import '../../../constant/colors.dart';
import '../../../constant/info.dart';
import '../../../constant/style.dart';
import '../../../controller/auth/captin/login_captin_controller.dart';
import '../../../controller/auth/google_sign.dart';
import '../../../main.dart';
import '../../widgets/elevated_btn.dart';
import '../../widgets/my_scafold.dart';
import '../../widgets/mycircular.dart';
import '../country_widget.dart';
import 'register_captin.dart';
class LoginCaptin extends StatelessWidget {
// final controller = Get.put(LoginCaptinController());
@@ -42,137 +42,177 @@ class LoginCaptin extends StatelessWidget {
children: [
Padding(
padding: const EdgeInsets.all(25),
child: Container(
decoration: const BoxDecoration(
boxShadow: [
BoxShadow(
offset: Offset(3, 3),
color: AppColor.accentColor,
blurRadius: 3)
],
color: AppColor.secondaryColor,
),
child: Form(
key: controller.formKey,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: Column(
children: [
TextFormField(
keyboardType: TextInputType.emailAddress,
controller: controller.emailController,
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: AppColor.primaryColor,
width: 2.0,
),
borderRadius: BorderRadius.circular(10),
),
fillColor: AppColor.accentColor,
hoverColor: AppColor.accentColor,
focusColor: AppColor.accentColor,
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(12))),
labelText: 'Email'.tr,
hintText: 'Enter your email address'.tr,
),
validator: (value) {
if (value!.isEmpty ||
(!value.contains('@') ||
!value.contains('.'))) {
return 'Please enter Your Email.'.tr;
}
return null;
},
),
const SizedBox(
height: 30,
),
TextFormField(
keyboardType: TextInputType.phone,
cursorColor: AppColor.accentColor,
controller: controller.phoneController,
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: AppColor.primaryColor,
width: 2.0,
),
borderRadius: BorderRadius.circular(10),
),
focusColor: AppColor.accentColor,
fillColor: AppColor.accentColor,
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(12))),
labelText: 'Phone'.tr,
hintText: 'Enter your phone number'.tr,
),
validator: (value) {
if (value!.isEmpty ||
value.length != 10) {
return 'Please enter your phone number.'
.tr;
}
return null;
},
),
const SizedBox(
height: 15,
),
TextFormField(
obscureText: true,
keyboardType: TextInputType.emailAddress,
controller: controller.passwordController,
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(
color: AppColor.primaryColor,
width: 2.0,
),
borderRadius: BorderRadius.circular(10),
),
fillColor: AppColor.accentColor,
hoverColor: AppColor.accentColor,
focusColor: AppColor.accentColor,
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(12))),
labelText: 'Password'.tr,
hintText:
'Please enter your phone number.'.tr,
),
validator: (value) {
if (value!.isEmpty) {
return 'Please enter Your Password.'.tr;
}
if (value.length < 6) {
return 'Password must br at least 6 character.'
.tr;
}
return null;
},
),
controller.isloading
? const MyCircularProgressIndicator()
: MyElevatedButton(
onPressed: () {
if (controller.formKey.currentState!
.validate()) {
controller.login();
}
},
title: 'Submit'.tr,
),
],
child:
// Container(
// decoration: const BoxDecoration(
// boxShadow: [
// BoxShadow(
// offset: Offset(3, 3),
// color: AppColor.accentColor,
// blurRadius: 3)
// ],
// color: AppColor.secondaryColor,
// ),
// child: Form(
// key: controller.formKey,
// child: Padding(
// padding: const EdgeInsets.all(16.0),
// child: SingleChildScrollView(
// child: Column(
// children: [
// TextFormField(
// keyboardType: TextInputType.emailAddress,
// controller: controller.emailController,
// decoration: InputDecoration(
// focusedBorder: OutlineInputBorder(
// borderSide: const BorderSide(
// color: AppColor.primaryColor,
// width: 2.0,
// ),
// borderRadius: BorderRadius.circular(10),
// ),
// fillColor: AppColor.accentColor,
// hoverColor: AppColor.accentColor,
// focusColor: AppColor.accentColor,
// border: const OutlineInputBorder(
// borderRadius: BorderRadius.all(
// Radius.circular(12))),
// labelText: 'Email'.tr,
// hintText: 'Enter your email address'.tr,
// ),
// validator: (value) {
// if (value!.isEmpty ||
// (!value.contains('@') ||
// !value.contains('.'))) {
// return 'Please enter Your Email.'.tr;
// }
// return null;
// },
// ),
// const SizedBox(
// height: 30,
// ),
// TextFormField(
// keyboardType: TextInputType.phone,
// cursorColor: AppColor.accentColor,
// controller: controller.phoneController,
// decoration: InputDecoration(
// focusedBorder: OutlineInputBorder(
// borderSide: const BorderSide(
// color: AppColor.primaryColor,
// width: 2.0,
// ),
// borderRadius: BorderRadius.circular(10),
// ),
// focusColor: AppColor.accentColor,
// fillColor: AppColor.accentColor,
// border: const OutlineInputBorder(
// borderRadius: BorderRadius.all(
// Radius.circular(12))),
// labelText: 'Phone'.tr,
// hintText: 'Enter your phone number'.tr,
// ),
// validator: (value) {
// if (value!.isEmpty ||
// value.length != 10) {
// return 'Please enter your phone number.'
// .tr;
// }
// return null;
// },
// ),
// const SizedBox(
// height: 15,
// ),
// TextFormField(
// obscureText: true,
// keyboardType: TextInputType.emailAddress,
// controller: controller.passwordController,
// decoration: InputDecoration(
// focusedBorder: OutlineInputBorder(
// borderSide: const BorderSide(
// color: AppColor.primaryColor,
// width: 2.0,
// ),
// borderRadius: BorderRadius.circular(10),
// ),
// fillColor: AppColor.accentColor,
// hoverColor: AppColor.accentColor,
// focusColor: AppColor.accentColor,
// border: const OutlineInputBorder(
// borderRadius: BorderRadius.all(
// Radius.circular(12))),
// labelText: 'Password'.tr,
// hintText:
// 'Please enter your phone number.'.tr,
// ),
// validator: (value) {
// if (value!.isEmpty) {
// return 'Please enter Your Password.'.tr;
// }
// if (value.length < 6) {
// return 'Password must br at least 6 character.'
// .tr;
// }
// return null;
// },
// ),
// controller.isloading
// ? const MyCircularProgressIndicator()
// : MyElevatedButton(
// onPressed: () {
// if (controller.formKey.currentState!
// .validate()) {
// controller.login();
// }
// },
// 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(
'if you don\'t have account'.tr,
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:google_maps_flutter/google_maps_flutter.dart';
import '../../../../../constant/char_map.dart';
import '../../../../../constant/colors.dart';
import '../../../../../constant/credential.dart';
import '../../../../Rate/ride_calculate_driver.dart';
import '../../../../../controller/functions/location_controller.dart';
@@ -24,26 +26,20 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () {
// AudioController audio = Get.put(AudioController());
// audio.startRecording();
// AC credentials = AC();
// String apiKey = '';
// String convertedStringN = credentials.c(
// credentials.c(credentials.c(apiKey, cs), cC), cn);
// print('Converted v: $convertedStringN');
AC credentials = AC();
String apiKey = '21010e54b50f41a4904708c526e102df';
String convertedStringN = credentials.c(
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(
// credentials.r(credentials.r(convertedStringN, cn), cC),
// cs);
// print('Retrieved String: $retrievedStringS');
// //
// if (retrievedStringS == apiKey) {
// print('same');
// }
// Get.to((OrderRequestPage()));
// ZonesController mapDriverController =
// Get.put(ZonesController());
// mapDriverController.getJsonOfZones();
if (retrievedStringS == apiKey) {
print('same');
}
},
icon: const Icon(
FontAwesome.map_signs,