6/27/1
This commit is contained in:
@@ -7,28 +7,40 @@ class AuthController extends GetxController {
|
||||
|
||||
Future<User?> signInWithApple() async {
|
||||
try {
|
||||
print('Starting Apple Sign In process');
|
||||
|
||||
final appleCredential = await SignInWithApple.getAppleIDCredential(
|
||||
scopes: [
|
||||
AppleIDAuthorizationScopes.email,
|
||||
AppleIDAuthorizationScopes.fullName,
|
||||
],
|
||||
);
|
||||
print('Apple ID Credential obtained');
|
||||
|
||||
final oAuthProvider = OAuthProvider('apple.com');
|
||||
final credential = oAuthProvider.credential(
|
||||
idToken: appleCredential.identityToken,
|
||||
accessToken: appleCredential.authorizationCode,
|
||||
);
|
||||
print('OAuth credential created');
|
||||
|
||||
UserCredential userCredential =
|
||||
await _auth.signInWithCredential(credential);
|
||||
print('User signed in successfully: ${userCredential.user?.uid}');
|
||||
|
||||
return userCredential.user;
|
||||
} catch (error) {
|
||||
print('Error during Apple Sign In: $error');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
void signOut() async {
|
||||
await _auth.signOut();
|
||||
Future<void> signOut() async {
|
||||
try {
|
||||
await _auth.signOut();
|
||||
print('User signed out successfully');
|
||||
} catch (error) {
|
||||
print('Error during sign out: $error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'dart:math';
|
||||
import 'package:SEFER/controller/firebase/firbase_messge.dart';
|
||||
import 'package:SEFER/views/auth/sms_verfy_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:SEFER/constant/box_name.dart';
|
||||
import 'package:SEFER/constant/links.dart';
|
||||
@@ -25,7 +24,6 @@ class LoginController extends GetxController {
|
||||
TextEditingController adminNameController = TextEditingController();
|
||||
bool isAgreeTerms = false;
|
||||
bool isloading = false;
|
||||
final FlutterSecureStorage _storage = const FlutterSecureStorage();
|
||||
|
||||
void changeAgreeTerm() {
|
||||
isAgreeTerms = !isAgreeTerms;
|
||||
@@ -74,8 +72,8 @@ class LoginController extends GetxController {
|
||||
box.read(BoxName.tokenFCM)) {
|
||||
Get.put(FirebaseMessagesController())
|
||||
.sendNotificationToAnyWithoutData(
|
||||
'token change',
|
||||
'change device',
|
||||
'token change'.tr,
|
||||
'change device'.tr,
|
||||
jsonDecode(token)['data'][0]['token'].toString(),
|
||||
);
|
||||
Future.delayed(const Duration(seconds: 1));
|
||||
@@ -83,10 +81,20 @@ class LoginController extends GetxController {
|
||||
'token': box.read(BoxName.tokenFCM),
|
||||
'passengerID': box.read(BoxName.passengerID).toString()
|
||||
});
|
||||
Get.offAll(() => const MapPagePassenger());
|
||||
Get.defaultDialog(
|
||||
title: 'Device Change Detected'.tr,
|
||||
middleText:
|
||||
'You can only use one device at a time. This device will now be set as your active device.'
|
||||
.tr,
|
||||
textConfirm: 'OK'.tr,
|
||||
confirmTextColor: Colors.white,
|
||||
onConfirm: () {
|
||||
Get.back();
|
||||
Get.offAll(() => const MapPagePassenger());
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Get.offAll(() => const MapPagePassenger());
|
||||
} else {
|
||||
Get.offAll(() => SmsSignupEgypt());
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:math';
|
||||
|
||||
@@ -27,10 +28,10 @@ class RegisterController extends GetxController {
|
||||
TextEditingController siteController = TextEditingController();
|
||||
TextEditingController verfyCode = TextEditingController();
|
||||
TextEditingController verifyCode = TextEditingController();
|
||||
|
||||
int remainingTime = 300; // 5 minutes in seconds
|
||||
bool isSent = false;
|
||||
bool isLoading = false;
|
||||
|
||||
Timer? _timer;
|
||||
String birthDate = 'Birth Date'.tr;
|
||||
String gender = 'Male'.tr;
|
||||
@override
|
||||
@@ -38,6 +39,17 @@ class RegisterController extends GetxController {
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
void startTimer() {
|
||||
_timer?.cancel(); // Cancel any existing timer
|
||||
_timer = Timer.periodic(const Duration(seconds: 1), (timer) {
|
||||
if (remainingTime > 0) {
|
||||
remainingTime--;
|
||||
} else {
|
||||
timer.cancel();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getBirthDate() {
|
||||
Get.defaultDialog(
|
||||
title: 'Select Date'.tr,
|
||||
@@ -84,6 +96,8 @@ class RegisterController extends GetxController {
|
||||
await smsEgyptController.sendSmsEgypt(
|
||||
phoneController.text.toString(), randomNumber.toString());
|
||||
isSent = true;
|
||||
remainingTime = 300; // Reset to 5 minutes
|
||||
startTimer();
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
@@ -159,4 +173,10 @@ class RegisterController extends GetxController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
_timer?.cancel();
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
|
||||
15
lib/controller/home/home_page_controller.dart
Normal file
15
lib/controller/home/home_page_controller.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../main.dart';
|
||||
|
||||
class HomePageController extends GetxController {
|
||||
late bool isVibrate = true;
|
||||
|
||||
void changeVibrateOption(bool value) {
|
||||
isVibrate = box.read(BoxName.isvibrate) ?? true;
|
||||
isVibrate = value;
|
||||
box.write(BoxName.isvibrate, value);
|
||||
update();
|
||||
}
|
||||
}
|
||||
@@ -110,6 +110,7 @@ class MapPassengerController extends GetxController {
|
||||
bool isDriverInPassengerWay = false;
|
||||
bool isDriverArrivePassenger = false;
|
||||
bool startLocationFromMap = false;
|
||||
bool isAnotherOreder = false;
|
||||
bool passengerStartLocationFromMap = false;
|
||||
bool workLocationFromMap = false;
|
||||
bool homeLocationFromMap = false;
|
||||
@@ -466,6 +467,11 @@ class MapPassengerController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
void changeisAnotherOreder(bool val) {
|
||||
isAnotherOreder = val;
|
||||
update();
|
||||
}
|
||||
|
||||
void sendSMS(String to) async {
|
||||
// Get the driver's phone number.
|
||||
String driverPhone =
|
||||
@@ -502,7 +508,7 @@ class MapPassengerController extends GetxController {
|
||||
void getDrawerMenu() {
|
||||
heightMenuBool = !heightMenuBool;
|
||||
widthMapTypeAndTraffic = heightMenuBool == true ? 0 : 50;
|
||||
heightMenu = heightMenuBool == true ? 100 : 0;
|
||||
heightMenu = heightMenuBool == true ? 70 : 0;
|
||||
widthMenu = heightMenuBool == true ? 110 : 0;
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,25 @@ class MyTranslation extends Translations {
|
||||
@override
|
||||
Map<String, Map<String, String>> get keys => {
|
||||
"ar": {
|
||||
"Pick from map destination": "حدد وجهتك على الخريطة",
|
||||
"Pick or Tap to confirm": "حدد أو انقر للتأكيد",
|
||||
"Select Order Type": "حدد نوع الطلب",
|
||||
"Choose who this order is for": "اختر لمن هذا الطلب",
|
||||
"I want to order for myself": "أريد أن أطلب لنفسي",
|
||||
"I want to order for someone else": "أريد أن أطلب لشخص آخر",
|
||||
|
||||
"If you want order to another person": "إذا كنت تريد الطلب لشخص آخر",
|
||||
"Wehaven'tfoundanydriversyet.Considerincreasingyourtripfeetomakeyouroffermoreattractivetodrivers.":
|
||||
"لم نجد أي سائقين بعد. ضع في اعتبارك زيادة رسوم رحلتك لجعل عرضك أكثر جاذبية للسائقين.",
|
||||
"IncreaseYourTripFee(Optional)": "زيادة رسوم رحلتك (اختياري)",
|
||||
'Vibration': "اهتزاز",
|
||||
'Resend code': "إعادة إرسال الرمز",
|
||||
"Sign in with Apple": "تسجيل الدخول باستخدام Apple",
|
||||
"token change": "تغيير الرمز",
|
||||
"change device": "تغيير الجهاز",
|
||||
"Device Change Detected": "تم اكتشاف تغيير الجهاز",
|
||||
"You can only use one device at a time. This device will now be set as your active device.":
|
||||
"يمكنك استخدام جهاز واحد في المرة الواحدة. سيتم الآن تعيين هذا الجهاز كجهازك النشط.",
|
||||
"Click here point": "انقر هنا", // Click here (literal translation)
|
||||
"Pick or Tap to confirm":
|
||||
"اختر أو اضغط للتأكيد", // Choose or Tap to confirm
|
||||
@@ -196,42 +215,39 @@ iOS [https://getapp.cc/app/6458734951]
|
||||
'Get to your destination quickly and easily.':
|
||||
'وصول إلى وجهتك بسرعة وسهولة.',
|
||||
'Enjoy a safe and comfortable ride.': 'استمتع برحلة آمنة ومريحة.',
|
||||
"Choose Language": "اخْتَر اللُّغَة",
|
||||
"Login": "تَسْجِيل الدُّخُول",
|
||||
"Pay with Wallet": 'ادْفَع بِاسْتِخْدَام المَحْفَظَة',
|
||||
"Invalid MPIN": 'رَمْز PIN غَيْر صَحِيح',
|
||||
"Invalid OTP": 'كود التَّحَقُّق خَاطِئ',
|
||||
"Enter your email address":
|
||||
"أدْخِل عُنْوَان بَرِيدِكَ الإلِكْتْرُونِي",
|
||||
"Please enter Your Email.":
|
||||
"يَرْجَى إِدْخَال بَرِيدِكَ الإلِكْتْرُونِي.",
|
||||
"Enter your phone number": "أدْخِل رَقْم هَاتِفِكَ",
|
||||
"Please enter your phone number.":
|
||||
"يَرْجَى إِدْخَال رَقْم هَاتِفِكَ.",
|
||||
"Please enter Your Password.": "يَرْجَى إِدْخَال كَلِمَة المُرُور.",
|
||||
"Submit": "إرْسَال",
|
||||
"if you dont have account": "إِذَا لَمْ يَكُن لَدَيْكَ حِسَاب",
|
||||
"Register": "تَسْجِيل",
|
||||
"Choose Language": "اختر اللغة",
|
||||
"Login": "تسجيل الدخول",
|
||||
"Pay with Wallet": "ادفع باستخدام المحفظة",
|
||||
"Invalid MPIN": "رمز PIN غير صحيح",
|
||||
"Invalid OTP": "كود التحقق خاطئ",
|
||||
"Enter your email address": "أدخل عنوان بريدك الإلكتروني",
|
||||
"Please enter Your Email.": "يرجى إدخال بريدك الإلكتروني.",
|
||||
"Enter your phone number": "أدخل رقم هاتفك",
|
||||
"Please enter your phone number.": "يرجى إدخال رقم هاتفك.",
|
||||
"Please enter Your Password.": "يرجى إدخال كلمة المرور.",
|
||||
"Submit": "إرسال",
|
||||
"if you dont have account": "إذا لم يكن لديك حساب",
|
||||
"Register": "تسجيل",
|
||||
"Accept Ride's Terms & Review Privacy Notice":
|
||||
"قَبُول شُرُوط الاسْتِخْدَام وَمُرَاجَعَة إِشْعَار الخُصُوصِيَّة",
|
||||
"قبول شروط الاستخدام ومراجعة إشعار الخصوصية",
|
||||
"By selecting 'I Agree' below, I have reviewed and agree to the Terms of Use and acknowledge the Privacy Notice. I am at least 18 years of age.":
|
||||
"مِنْ خِلَال اخْتِيَار 'أُوَافِق' أَدْنَاهُ، قُمْتُ بِمُرَاجَعَة وَقَبُول شُرُوط الاسْتِخْدَام وَأُقِرُّ بِإِشْعَار الخُصُوصِيَّة. أَنَا عَلَى الأَقَل 18 عَامًا.",
|
||||
"I Agree": "أُوَافِق",
|
||||
"First name": "الاسْم الأَوَّل",
|
||||
"Enter your first name": "أدْخِل اسْمَكَ الأَوَّل",
|
||||
"Please enter your first name.": "يَرْجَى إِدْخَال اسْمِكَ الأَوَّل.",
|
||||
"Last name": "اسْم العَائِلَة",
|
||||
"Enter your last name": "أدْخِل اسْمَكَ الأَخِير",
|
||||
"Please enter your last name.": "يَرْجَى إِدْخَال اسْمِكَ الأَخِير.",
|
||||
"City": "المَدِينَة",
|
||||
"Please enter your City.": "يَرْجَى إِدْخَال اسْم مَدِينَتِكَ.",
|
||||
"Male": "ذَكَر",
|
||||
"Female": "أُنْثَى",
|
||||
"Verify Email": "تَحَقَّق مِنْ البَرِيد الإلِكْتْرُونِي",
|
||||
"من خلال اختيار 'أوافق' أدناه، قمت بمراجعة وقبول شروط الاستخدام وأقر بإشعار الخصوصية. أنا على الأقل 18 عامًا.",
|
||||
"I Agree": "أوافق",
|
||||
"First name": "الاسم الأول",
|
||||
"Enter your first name": "أدخل اسمك الأول",
|
||||
"Please enter your first name.": "يرجى إدخال اسمك الأول.",
|
||||
"Last name": "اسم العائلة",
|
||||
"Enter your last name": "أدخل اسمك الأخير",
|
||||
"Please enter your last name.": "يرجى إدخال اسمك الأخير.",
|
||||
"City": "المدينة",
|
||||
"Please enter your City.": "يرجى إدخال اسم مدينتك.",
|
||||
"Male": "ذكر",
|
||||
"Female": "أنثى",
|
||||
"Verify Email": "تحقق من البريد الإلكتروني",
|
||||
"We sent 5 digit to your Email provided":
|
||||
"لَقَدْ أَرْسَلْنَا رَمْزًا مُؤَلَّفًا مِنْ 5 أَرْقَام إِلَى بَرِيدِكَ الإلِكْتْرُونِي المُدْخَل",
|
||||
"5 digit": "5 أَرْقَام",
|
||||
"Send Verification Code": "إرْسَال رَمْز التَّحَقُّق",
|
||||
"لقد أرسلنا رمزًا مؤلفًا من 5 أرقام إلى بريدك الإلكتروني المدخل",
|
||||
"5 digit": "5 أرقام",
|
||||
"Send Verification Code": "إرسال رمز التحقق",
|
||||
"Your Ride Duration is ": "مُدَّة رِحْلَتِكَ ",
|
||||
"You will be thier in": "سَتَكُون هُنَاكَ فِي",
|
||||
"You trip distance is": "مَسَافَة الرِّحْلَة",
|
||||
@@ -664,12 +680,12 @@ iOS [https://getapp.cc/app/6458734951]
|
||||
"Yes": 'نَعَمْ',
|
||||
"Insert Emergincy Number": "أَدْخِلِ رَقْمَ الطَّوَارِئِ",
|
||||
"Best choice for comfort car and flexible route and stops point":
|
||||
'أَفْضَلُ خِيَارٍ لِسَيَّارَةِ رَاحَةٍ وَمَسَارٍ مُرِنٍ وَنِقَاطِ تَوَقُّفٍ',
|
||||
"رحلة مكيفة ومسار متغير لرغبة العميل ونقاط توقف",
|
||||
"Insert": "إِدْرَاجُ",
|
||||
"This is for delivery or a motorcycle.":
|
||||
"هَذَا لِلتَّسْلِيمِ أَوِ الدَّرَّاجَةِ النَّارِيَّةِ",
|
||||
"This trip goes directly from your starting point to your destination for a fixed price. The driver must follow the planned route":
|
||||
'الرِّحْلَةُ دِي مِنْ نُقْطَةِ الْبِدَايَةِ لِنُقْطَةِ النِّهَايَةِ بِسِعْرٍ ثَابِتٍ وَالسَّوَّاقُ لَازِمٌ يَمْشِي بِنَفْسِ الطَّرِيقِ.',
|
||||
'رحلة محددة السعر والشريك السائق ملتزم بالمسار المحدد من خلال التطبيق',
|
||||
"You can decline a request without any cost":
|
||||
"يمكنك إلغاء الطلب بدون أي تكلفة",
|
||||
"Perfect for adventure seekers who want to experience something new and exciting":
|
||||
|
||||
Reference in New Issue
Block a user