diff --git a/.env b/.env
index 8b68186..d252c67 100644
--- a/.env
+++ b/.env
@@ -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
diff --git a/android/app/build.gradle b/android/app/build.gradle
index 0e688b2..8a2d87c 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -55,8 +55,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 22
targetSdkVersion flutter.targetSdkVersion
- versionCode 23
- versionName '1.4.7'
+ versionCode 24
+ versionName '1.4.8'
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
}
diff --git a/android/app/src/main/res/mipmap-hdpi/launcher_icon.png b/android/app/src/main/res/mipmap-hdpi/launcher_icon.png
index 11c1b82..09aaa8b 100644
Binary files a/android/app/src/main/res/mipmap-hdpi/launcher_icon.png and b/android/app/src/main/res/mipmap-hdpi/launcher_icon.png differ
diff --git a/android/app/src/main/res/mipmap-mdpi/launcher_icon.png b/android/app/src/main/res/mipmap-mdpi/launcher_icon.png
index 9528d0a..2601845 100644
Binary files a/android/app/src/main/res/mipmap-mdpi/launcher_icon.png and b/android/app/src/main/res/mipmap-mdpi/launcher_icon.png differ
diff --git a/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png b/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png
index 9ff18dd..2cd6364 100644
Binary files a/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png and b/android/app/src/main/res/mipmap-xhdpi/launcher_icon.png differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png b/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png
index 4966c7a..43412f8 100644
Binary files a/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png and b/android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png b/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png
index bd0a373..ba8dfea 100644
Binary files a/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png and b/android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png differ
diff --git a/assets/images/logo.gif b/assets/images/logo.gif
index 598c907..9f4d92b 100644
Binary files a/assets/images/logo.gif and b/assets/images/logo.gif differ
diff --git a/assets/images/logo.png b/assets/images/logo.png
index 91a856a..0b6fdcb 100644
Binary files a/assets/images/logo.png and b/assets/images/logo.png differ
diff --git a/flutter_launcher_icons.yaml b/flutter_launcher_icons.yaml
new file mode 100644
index 0000000..9903b15
--- /dev/null
+++ b/flutter_launcher_icons.yaml
@@ -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"
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png
index 9d66a9b..013aad8 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/100.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/102.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/102.png
index b607dd4..1ebae82 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/102.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/102.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png
index a78fcd1..32a4b58 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/1024.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png
index 23f1b27..dfb7eff 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/114.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png
index da44c83..779fce1 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/120.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png
index 1dc5ebb..34712ee 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/128.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png
index 00eb0c3..e650051 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/144.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png
index 3f2002a..68f033c 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/152.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png
index 870177f..2ba5870 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/16.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png
index 0b15bb6..3b5ac36 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/167.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/172.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/172.png
index 40af6a4..161140e 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/172.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/172.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png
index d869f6b..370656e 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/180.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/196.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/196.png
index 68c9f71..149f054 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/196.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/196.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png
index 9311906..af849d1 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/20.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/216.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/216.png
index 40e3f99..f7e456a 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/216.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/216.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png
index e675a56..781df85 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/256.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png
index 63c3df6..72345f1 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/29.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png
index e142d50..58698d8 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/32.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png
index 6aedfae..06331c8 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/40.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/48.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/48.png
index 5a388ed..5429738 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/48.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/48.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png
index 7d21ba4..31d85e6 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/50.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png
index 91a856a..e496920 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/512.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/55.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/55.png
index 03bcce0..17d4a60 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/55.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/55.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png
index f73db5e..4600427 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/57.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png
index 658f67f..b56af1e 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/58.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png
index 873faa5..8e123ce 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/60.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png
index aef0f2e..39388cf 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/64.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/66.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/66.png
index f5c3bf4..867b153 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/66.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/66.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png
index 09f67b3..2b59d8f 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/72.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png
index 0714ca6..b8f9102 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/76.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png
index ec0928b..7a8a4de 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/80.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png
index cca097a..35f2966 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/87.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/88.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/88.png
index b6a465e..a4e132f 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/88.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/88.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/92.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/92.png
index fafcfc3..b4a9ce6 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/92.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/92.png differ
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 4a4d5f6..9e5a4f6 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -21,7 +21,7 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 25
+ 26
CFBundleSignature
????
CFBundleURLTypes
@@ -36,7 +36,7 @@
CFBundleVersion
- 2.0.13
+ 2.0.2
FirebaseAppDelegateProxyEnabled
NO
GMSApiKey
diff --git a/lib/constant/api_key.dart b/lib/constant/api_key.dart
index e07f9d8..03bdf83 100644
--- a/lib/constant/api_key.dart
+++ b/lib/constant/api_key.dart
@@ -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);
}
diff --git a/lib/constant/box_name.dart b/lib/constant/box_name.dart
index 4c598a4..c98f7bf 100644
--- a/lib/constant/box_name.dart
+++ b/lib/constant/box_name.dart
@@ -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";
diff --git a/lib/constant/links.dart b/lib/constant/links.dart
index f242e84..3994eb5 100644
--- a/lib/constant/links.dart
+++ b/lib/constant/links.dart
@@ -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";
diff --git a/lib/controller/auth/captin/login_captin_controller.dart b/lib/controller/auth/captin/login_captin_controller.dart
index b4e58b1..3009cb9 100644
--- a/lib/controller/auth/captin/login_captin_controller.dart
+++ b/lib/controller/auth/captin/login_captin_controller.dart
@@ -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: {
diff --git a/lib/controller/auth/captin/register_captin_controller.dart b/lib/controller/auth/captin/register_captin_controller.dart
index 9226c84..a6e297e 100644
--- a/lib/controller/auth/captin/register_captin_controller.dart
+++ b/lib/controller/auth/captin/register_captin_controller.dart
@@ -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());
+ }
}
}
}
diff --git a/lib/controller/auth/google_sign.dart b/lib/controller/auth/google_sign.dart
index 72d99e0..2dcd1d2 100644
--- a/lib/controller/auth/google_sign.dart
+++ b/lib/controller/auth/google_sign.dart
@@ -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 signInFromLogin() async {
+ try {
+ final GoogleSignInAccount? googleUser = await _googleSignIn.signIn();
+ if (googleUser != null) {
+ await _handleSignUp(googleUser);
+ // if (box.read(BoxName.countryCode) == 'Egypt') {
+ Get.find().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 signOut() async {
try {
diff --git a/lib/controller/functions/crud.dart b/lib/controller/functions/crud.dart
index ef73d36..4efd55a 100644
--- a/lib/controller/functions/crud.dart
+++ b/lib/controller/functions/crud.dart
@@ -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 =
diff --git a/lib/controller/functions/device_info.dart b/lib/controller/functions/device_info.dart
index 4618260..3ac8c4e 100644
--- a/lib/controller/functions/device_info.dart
+++ b/lib/controller/functions/device_info.dart
@@ -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