This commit is contained in:
Hamza-Ayed
2024-05-20 17:01:31 +03:00
parent a953aabd9c
commit 453863aa5d
73 changed files with 751 additions and 242 deletions

6
.env
View File

@@ -27,4 +27,8 @@ usernamePayMob=37319104052XrXlBl
passwordPayMob='g@nkD2#99!hD_.wXrXlBl'
integrationIdPayMob=0552355XrXlBl
payMobApikey='MDrGqKEWS1rVqHvEPDvPjJ7vZDBExrO7S3BEBgrlfUwTA3i5RnP5ZnvoL3M2S9rEBgrlNTdexH5pTPf7NJrvy1reZJv1Tn7zf7vTIDywjHg1C7Ley38HTDyNA3v7TPfdxJrax1rwPmPtMJyzqKEYZeghq3MuLUrFH3A1AgHcH15CZ9UaZTLOxnw0BTdzHHrBArisZerUMUUzZ1BnBeEijHvNjYLnS1BUICMhSmPhA15ifHyVqKEMHWyKLbyuIPvcH9UeL3vZyDf=XrXlBl'
integrationIdPayMobWallet=0552352XrXlBl
integrationIdPayMobWallet=0552352XrXlBl
ocpApimSubscriptionKey=17373j50x53u07q0830634f512j731yuXrXlBl
smsPasswordEgypt="J)Vh=qb/@MXrXlBl"
chatGPTkeySeferNew4=zg-vlie-2l1ZlpxiLJ6wQOvbb4TnC9XrxgUEyVQIu6TID4qP4FUUqoS5XrXlBl
anthropicAIkeySeferNew=zg-qbc-qvo39-n4VdMQ5nuJeIYhMN4PDYr7qox3-t2i1Lh7aNTDfYF-Gf8whUJZCs47EeelKn8_UcmUMmiSLaf0UJg0DvUlQrDt-76CRrkQQXrXlBl

View File

@@ -53,7 +53,7 @@ android {
applicationId "com.mobileapp.store.ride"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 23
minSdkVersion 22
targetSdkVersion flutter.targetSdkVersion
versionCode 25
versionName '1.4.8'

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 928 KiB

After

Width:  |  Height:  |  Size: 547 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 KiB

After

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 648 B

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

File diff suppressed because one or more lines are too long

View File

@@ -52,4 +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 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

@@ -6,6 +6,7 @@ class BoxName {
static const String lang = "lang";
static const String carType = "carType";
static const String carPlate = "carPlate";
static const String isVerified = 'false';
static const String statusDriverLocation = "statusDriverLocation";
static const String password = "password";
static const String arrivalTime = "arrivalTime";
@@ -28,6 +29,7 @@ class BoxName {
static const String locationPermission = "locationPermission";
static const String nameDriver = "nameDriver";
static const String driverPhotoUrl = "driverPhotoUrl";
static const String passengerPhotoUrl = "passengerPhotoUrl";
static const String email = "email";
static const String emailDriver = "emailDriver";
static const String tokens = "tokens";

View File

@@ -180,14 +180,19 @@ class AppLink {
static String login = "$auth/login.php";
static String signUp = "$auth/signup.php";
static String sendVerifyEmail = "$auth/sendVerifyEmail.php";
static String loginFromGooglePassenger = "$auth/loginFromGooglePassenger.php";
static String passengerRemovedAccountEmail =
"$auth/passengerRemovedAccountEmail.php";
static String verifyEmail = "$auth/verifyEmail.php";
//===================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";
static String verifyOtpMessage = "$server/auth/verifyOtpMessage.php";
static String verifyEmailCaptin = "$authCaptin/verifyEmail.php";
static String removeUser = "$authCaptin/removeAccount.php";
static String deletecaptainAccounr = "$authCaptin/deletecaptainAccounr.php";
@@ -208,4 +213,12 @@ class AppLink {
static String getRidesPerMonth =
"$server/Admin/AdminRide/getRidesPerMonth.php";
static String getRidesDetails = "$server/Admin/AdminRide/get.php";
//////////Sms egypt///////////
static String sendSms = "https://sms.kazumi.me/api/sms/send-sms";
static String senddlr = "https://sms.kazumi.me/api/sms/send-dlr";
static String sendvalidity = "https://sms.kazumi.me/api/sms/send-validity";
static String sendmany = "https://sms.kazumi.me/api/sms/send-many";
static String checkCredit = "https://sms.kazumi.me/api/sms/check-credit";
static String checkStatus = "https://sms.kazumi.me/api/sms/check-status";
}

View File

@@ -1,8 +1,11 @@
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/controller/auth/login_controller.dart';
import 'package:SEFER/main.dart';
import 'package:get/get.dart';
import 'package:google_sign_in/google_sign_in.dart';
import '../../onbording_page.dart';
class GoogleSignInHelper {
static final GoogleSignIn _googleSignIn = GoogleSignIn(
scopes: [
@@ -11,11 +14,18 @@ class GoogleSignInHelper {
],
);
// Method to handle Google Sign-In
static Future<GoogleSignInAccount?> signIn() async {
try {
final GoogleSignInAccount? googleUser = await _googleSignIn.signIn();
getDriverInfo();
// Get.to(() => AiPage());
if (googleUser != null) {
await _handleSignUp(googleUser);
// if (box.read(BoxName.countryCode) == 'Egypt') {
// Get.to(() => EgyptCardAI());
// } else if (box.read(BoxName.countryCode) == 'Jordan') {
// Get.to(() => AiPage());
// }
}
return googleUser;
} catch (error) {
print('Google Sign-In error: $error');
@@ -23,25 +33,85 @@ 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') {
await Get.put(LoginController()).loginFromSignInGoogle(
box.read(BoxName.passengerID).toString(),
box.read(BoxName.email).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 {
await _googleSignIn.signOut();
await _handleSignOut();
print('User signed out.');
} catch (error) {
print('Google Sign-Out error: $error');
}
}
// Method to get the current signed-in user
static GoogleSignInAccount? getCurrentUser() {
return _googleSignIn.currentUser;
}
static String? getDriverInfo() {
final GoogleSignInAccount? user = _googleSignIn.currentUser;
box.write(BoxName.driverID, user!.id);
box.write(BoxName.emailDriver, user.email);
box.write(BoxName.nameDriver, user.displayName);
box.write(BoxName.driverPhotoUrl, user.photoUrl);
print('emailDriver =${box.read(BoxName.emailDriver)}');
return user.displayName;
// Method to handle sign-up process
static Future<void> _handleSignUp(GoogleSignInAccount user) async {
// Store driver information
box.write(BoxName.passengerID, user.id);
box.write(BoxName.email, user.email);
box.write(BoxName.name, user.displayName);
box.write(BoxName.passengerPhotoUrl, user.photoUrl);
// Perform any additional sign-up tasks or API calls here
// For example, you can send the user data to your server for registration
print('passengerID = ${box.read(BoxName.passengerID)}');
print('email = ${box.read(BoxName.email)}');
print('name = ${box.read(BoxName.name)}');
print('passengerPhotoUrl = ${box.read(BoxName.passengerPhotoUrl)}');
}
// Method to handle sign-out process
static Future<void> _handleSignOut() async {
// Clear stored driver information
box.remove(BoxName.passengerPhotoUrl);
box.remove(BoxName.driverID);
box.remove(BoxName.email);
box.remove(BoxName.lang);
box.remove(BoxName.name);
box.remove(BoxName.passengerID);
box.remove(BoxName.phone);
box.remove(BoxName.tokenFCM);
box.remove(BoxName.tokens);
box.remove(BoxName.addHome);
box.remove(BoxName.addWork);
box.remove(BoxName.agreeTerms);
box.remove(BoxName.apiKeyRun);
box.remove(BoxName.countryCode);
box.remove(BoxName.accountIdStripeConnect);
box.remove(BoxName.passengerWalletTotal);
box.remove(BoxName.isVerified);
Get.offAll(OnBoardingPage());
// Perform any additional sign-out tasks or API calls here
// For example, you can notify your server about the user sign-out
print('User data cleared.');
}
}

View File

@@ -1,6 +1,9 @@
import 'dart:convert';
import 'dart:math';
import 'package:SEFER/controller/firebase/firbase_messge.dart';
import 'package:SEFER/views/auth/register_page.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';
@@ -41,6 +44,65 @@ class LoginController extends GetxController {
update();
}
loginFromSignInGoogle(String passengerID, email) async {
isloading = true;
update();
var res =
await CRUD().get(link: AppLink.loginFromGooglePassenger, payload: {
'email': email,
'id': passengerID,
});
print(res);
if (res == 'Failure') {
//Failure
Get.offAll(SmsSignupEgypt());
isloading = false;
update();
Get.snackbar("User does not exist.".tr, '', backgroundColor: Colors.red);
} else {
var jsonDecoeded = jsonDecode(res);
// print(jsonDecoeded['data'][0]['is_verified']);
if (jsonDecoeded.isNotEmpty) {
if (jsonDecoeded['status'] == 'success' &&
jsonDecoeded['data'][0]['verified'] == 1) {
//
Get.offAll(() => const MapPagePassenger());
print(box.read(BoxName.tokenFCM));
var token = await CRUD().get(link: AppLink.getTokens, payload: {
'passengerID': box.read(BoxName.passengerID).toString()
});
print(token);
if (token != 'failure') {
if (jsonDecode(token)['data'][0]['token'] !=
box.read(BoxName.tokenFCM)) {
Get.find<FirebaseMessagesController>()
.sendNotificationToAnyWithoutData(
'token change',
'change device',
jsonDecode(token)['data'][0]['token'].toString(),
);
}
}
await CRUD().post(link: AppLink.addTokens, payload: {
'token': box.read(BoxName.tokenFCM),
'passengerID': box.read(BoxName.passengerID).toString()
}).then((value) => print('cccc'));
} else {
Get.offAll(() => SmsSignupEgypt());
// Get.snackbar(jsonDecoeded['status'], jsonDecoeded['data'],
// backgroundColor: Colors.redAccent);
isloading = false;
update();
}
} else {
print('res is null');
isloading = false;
update();
}
}
}
// void adminDashboardOpen() async {
// if (formKeyAdmin.currentState!.validate()) {
// await DeviceInfoPlus.getDeviceInfo();

View File

@@ -1,6 +1,7 @@
import 'dart:convert';
import 'dart:math';
import 'package:SEFER/views/home/map_page_passenger.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/links.dart';
@@ -9,10 +10,14 @@ import 'package:SEFER/controller/functions/crud.dart';
import 'package:SEFER/views/auth/login_page.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import '../../constant/box_name.dart';
import '../../main.dart';
import '../../views/auth/verify_email_page.dart';
import '../functions/sms_controller.dart';
class RegisterController extends GetxController {
final formKey = GlobalKey<FormState>();
final formKey3 = GlobalKey<FormState>();
TextEditingController firstNameController = TextEditingController();
TextEditingController lastNameController = TextEditingController();
@@ -21,6 +26,10 @@ class RegisterController extends GetxController {
TextEditingController passwordController = TextEditingController();
TextEditingController siteController = TextEditingController();
TextEditingController verfyCode = TextEditingController();
TextEditingController verifyCode = TextEditingController();
bool isSent = false;
bool isLoading = false;
String birthDate = 'Birth Date'.tr;
String gender = 'Male'.tr;
@@ -59,6 +68,64 @@ class RegisterController extends GetxController {
update();
}
sendOtpMessage() async {
SmsEgyptController smsEgyptController = Get.put(SmsEgyptController());
int randomNumber = Random().nextInt(100000) + 1;
isLoading = true;
update();
if (formKey3.currentState!.validate()) {
if (box.read(BoxName.countryCode) == 'Egypt') {
await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: {
'phone_number': '+2${phoneController.text}',
'token': randomNumber.toString(),
});
// 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': '+2${phoneController.text}',
'token': verifyCode.text.toString(),
});
if (res != 'failure') {
// var dec = jsonDecode(res);
box.write(BoxName.phoneDriver, '+2${phoneController.text}');
var payload = {
'id': box.read(BoxName.passengerID),
'phone': '+2${phoneController.text}',
'email': box.read(BoxName.email),
'password': 'unknown',
'gender': 'unknown',
'birthdate': '2002-01-01',
'site': 'unknown',
'first_name': box.read(BoxName.name).toString().split(' ')[0],
'last_name': box.read(BoxName.name).toString().split(' ')[1],
};
var res1 = await CRUD().post(
link: AppLink.signUp,
payload: payload,
);
if (jsonDecode(res1)['status'] == 'success') {
box.write(BoxName.isVerified, 'true');
Get.offAll(const MapPagePassenger());
}
} else {
print(res);
Get.snackbar('Error'.tr, '', backgroundColor: Colors.redAccent);
}
}
}
sendVerifications() async {
var res = await CRUD().post(link: AppLink.verifyEmail, payload: {
'email': emailController.text,

View File

@@ -18,6 +18,7 @@ import '../../views/Rate/rate_captain.dart';
import '../../views/home/map_page_passenger.dart';
import '../../views/home/map_widget.dart/call_passenger_page.dart';
import '../../views/home/profile/promos_passenger_page.dart';
import '../auth/google_sign.dart';
import '../home/map_passenger_controller.dart';
import 'local_notification.dart';
@@ -141,6 +142,8 @@ class FirebaseMessagesController extends GetxController {
NotificationController()
.showNotification('Promo', 'Show latest promo'.tr, 'promo');
Get.to(const PromosPassengerPage());
} else if (message.notification!.title! == 'token change') {
GoogleSignInHelper.signOut();
} else if (message.notification!.title! == 'DriverIsGoingToPassenger') {
Get.find<MapPassengerController>().isDriverInPassengerWay = true;
Get.find<MapPassengerController>().update();

View File

@@ -93,6 +93,7 @@ class LogOutController extends GetxController {
),
onPressed: () {
// box.remove(BoxName.agreeTerms);
box.remove(BoxName.passengerPhotoUrl);
box.remove(BoxName.driverID);
box.remove(BoxName.email);
box.remove(BoxName.lang);
@@ -108,6 +109,7 @@ class LogOutController extends GetxController {
box.remove(BoxName.countryCode);
box.remove(BoxName.accountIdStripeConnect);
box.remove(BoxName.passengerWalletTotal);
box.remove(BoxName.isVerified);
Get.offAll(OnBoardingPage());
},
child: Text(

View File

@@ -0,0 +1,89 @@
import 'dart:convert';
import 'package:SEFER/constant/api_key.dart';
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/constant/info.dart';
import 'package:SEFER/constant/links.dart';
import 'package:SEFER/main.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:get/get.dart';
import 'package:http/http.dart' as http;
class SmsEgyptController extends GetxController {
var headers = {'Content-Type': 'application/json'};
Future<dynamic> sendSmsEgypt(String phone, otp) async {
var body = jsonEncode({
"username": AppInformation.appName,
"password": 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
"receiver": "2$phone"
});
var res = await http.post(
Uri.parse(AppLink.sendSms),
body: body,
headers: headers,
);
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,
middleText: '',
confirm: MyElevatedButton(
title: 'OK'.tr,
onPressed: () {
Get.back();
}));
}
}
Future checkCredit(String phone, otp) async {
var res = await http.post(
Uri.parse(AppLink.checkCredit),
body: {
"username": AppInformation.appName,
"password": AK.smsPasswordEgypt,
},
headers: headers,
);
print(res);
}
Future sendSmsWithValidaty(String phone, otp) async {
var res = await http.post(
Uri.parse(AppLink.checkCredit),
body: {
"username": AppInformation.appName,
"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
"receiver": "2$phone",
"validity": "10",
"StartTime": DateTime.now().toString() // "1/1/2024 10:00:00"
},
headers: headers,
);
print(res);
}
Future sendSmsStatus(String smsid) async {
var res = await http.post(
Uri.parse(AppLink.checkCredit),
body: {
"username": AppInformation.appName,
"password": AK.smsPasswordEgypt,
"smsid": smsid //"00b77dfc-5b8f-474d-9def-9f0158b70f98"
},
headers: headers,
);
print(res);
}
}

View File

@@ -8,6 +8,8 @@ import '../../constant/box_name.dart';
import '../../main.dart';
import '../../onbording_page.dart';
import '../../views/home/map_page_passenger.dart';
import '../auth/google_sign.dart';
import '../auth/login_controller.dart';
class SplashScreenController extends GetxController
with SingleGetTickerProviderMixin {
@@ -42,12 +44,18 @@ class SplashScreenController extends GetxController
startTimer();
}
void startTimer() {
Timer(const Duration(seconds: 5), () {
void startTimer() async {
Timer(const Duration(seconds: 5), () async {
box.read(BoxName.onBoarding) == null
? Get.off(() => OnBoardingPage())
: box.read(BoxName.email) != null
? Get.off(() => const MapPagePassenger())
: box.read(BoxName.email) != null &&
box.read(BoxName.phone) != null &&
box.read(BoxName.isVerified) != 'true'
// ? Get.off(() => const MapPagePassenger())
? await Get.put(LoginController()).loginFromSignInGoogle(
box.read(BoxName.passengerID).toString(),
box.read(BoxName.email).toString(),
)
: Get.off(() => LoginPage());
});
}

View File

@@ -4,48 +4,85 @@ class MyTranslation extends Translations {
@override
Map<String, Map<String, String>> get keys => {
"ar": {
'Pick or Tap to confirm': "اختر أو اضغط للتأكيد",
"To use Wallet charge it": "لاستخدام المحفظة، قم بشحنها.",
'\$ Next as Cash \$!': '\$ Cash \$ ',
'This trip just for girls only': "هذه الرحلة فقط للفتيات ",
'How do I request a ride?': 'كيف يمكنني طلب رحلة؟',
'Step-by-step instructions on how to request a ride through the Sefer app.':
'تعليمات خطوة بخطوة حول كيفية طلب رحلة من خلال تطبيق Sefer.',
'What types of vehicles are available?':
'ما هي أنواع السيارات المتاحة؟',
'Sefer offers a variety of vehicle options to suit your needs, including economy, comfort, and luxury. Choose the option that best fits your budget and passenger count.':
'يقدم Sefer مجموعة متنوعة من خيارات السيارات لتناسب احتياجاتك، بما في ذلك الاقتصادية والراحة والفخامة. اختر الخيار الذي يناسب ميزانيتك وعدد الركاب بشكل أفضل.',
'How can I pay for my ride?': 'كيف يمكنني الدفع لرحلتي؟',
'Sefer offers multiple payment methods for your convenience. Choose between cash payment or credit/debit card payment during ride confirmation.':
'يقدم Sefer طرق دفع متعددة لراحتك. اختر بين الدفع النقدي أو الدفع ببطاقة الائتمان/الخصم أثناء تأكيد الرحلة.',
'Can I cancel my ride?': 'هل يمكنني إلغاء رحلتي؟',
'Yes, you can cancel your ride under certain conditions (e.g., before driver is assigned). See the Sefer cancellation policy for details.':
'نعم، يمكنك إلغاء رحلتك في ظل ظروف معينة (على سبيل المثال، قبل تعيين السائق). اطلع على سياسة إلغاء Sefer لمزيد من التفاصيل.',
'Driver Registration & Requirements': 'تسجيل السائق والمتطلبات',
'How can I register as a driver?': 'كيف يمكنني التسجيل كسائق؟',
'What are the requirements to become a driver?':
'ما هي الشروط لتصبح سائق؟',
'Visit our website or contact Sefer support for information on driver registration and requirements.':
'قم بزيارة موقعنا على الويب أو اتصل بدعم Sefer للحصول على معلومات حول تسجيل السائق والمتطلبات.',
'How do I communicate with the other party (passenger/driver)?':
'كيف يمكنني التواصل مع الطرف الآخر (الراكب/السائق)؟',
'Sefer provides in-app chat functionality to allow you to communicate with your driver or passenger during your ride.':
'يوفر Sefer وظيفة الدردشة داخل التطبيق للسماح لك بالتواصل مع سائقك أو راكبك أثناء رحلتك.',
'What safety measures does Sefer offer?':
'ما هي التدابير الأمنية التي يقدمها Sefer؟',
'Sefer prioritizes your safety. We offer features like driver verification, in-app trip tracking, and emergency contact options.':
'يعمل Sefer على أولوية سلامتك. نحن نقدم ميزات مثل التحقق من السائق، وتتبع الرحلة داخل التطبيق، وخيارات الاتصال بالطوارئ.',
'Frequently Questions': 'الأسئلة المتكررة ',
'About Us': 'عننا',
'SEFER is a ride-sharing app designed with your safety and affordability in mind. We connect you with reliable drivers in your area, ensuring a convenient and stress-free travel experience.\n\nHere are some of the key features that set us apart:':
"سفر هو تطبيق مشاركة رحلات مصمم مع وضع سلامتك وإمكانياتك المادية في الاعتبار. نوفر لك اتصالًا بسائقين موثوقين في منطقتك ، مما يضمن تجربة سفر مريحة وخالية من التوتر.\n\n فيما يلي بعض الميزات الرئيسية التي تميزنا:",
"User does not exist.": '',
'We need your phone number to contact you and to help you.':
'نحتاج إلى رقم هاتفك للتواصل معك ولمساعدتك',
'You will recieve code in sms message': 'ستتلقى رمزًا في رسالة SMS',
'Please enter': 'يرجى إدخال',
'We need your phone number to contact you and to help you receive orders.':
"نحتاج إلى رقم هاتفك للتواصل معك ولمساعدتك في تلقي الطلبات.",
'The full name on your criminal record does not match the one on your drivers license. Please verify and provide the correct documents.':
'الاسم الكامل في سجلك الجنائي لا يتطابق مع الاسم الموجود في رخصة القيادة الخاصة بك. يرجى التحقق وتقديم الوثائق الصحيحة.',
"The national number on your drivers license does not match the one on your ID document. Please verify and provide the correct documents.":
"الرقم الوطني على رخصة القيادة الخاصة بك لا يتطابق مع الرقم الموجود على وثيقة الهوية الخاصة بك. يرجى التحقق وتقديم الوثائق الصحيحة.",
"Capture an Image of Your Criminal Record":
"التقط صورة لسجلك الجنائي",
"IssueDate": "تاريخ الإصدار",
"Capture an Image of Your car license front ":
"التقط صورة للواجهة الأمامية لرخصة سيارتك",
"Capture an Image of Your ID Document front":
"التقط صورة للواجهة الأمامية لوثيقة هويتك",
"NationalID": "الرقم القومي",
"FullName": "الاسم الكامل",
"InspectionResult": "نتيجة الفحص",
"Criminal Record": "السجل الجنائي",
"The email or phone number is already registered.":
"البريد الإلكتروني أو رقم الهاتف مسجل بالفعل.",
'To become a ride-sharing driver on the Sefer app, you need to upload your driver\'s license, ID document, and car registration document. Our AI system will instantly review and verify their authenticity in just 2-3 minutes. If your documents are approved, you can start working as a driver on the Sefer app. Please note, submitting fraudulent documents is a serious offense and may result in immediate termination and legal consequences.':
'لِتُصْبِحَ سَائِقَاً لِلرُّكوبِ المُشْتَرَكِ عَلَى تَطْبِيق سَفَر، يَجِبُ عَلَيْكَ تَحْمِيل رُخْصَةِ القِيَادَةِ، وَثِيقَةِ الهُوِيَّةِ، وَوَثِيقَةَ تَسْجِيل السَّيَّارَةِ. سَيَقُومُ نِظَامُ الذَّكَاءِ الاِصْطِنَاعِيِّ لَدَيْنَا بِمُرَاجَعَةِ وَتَحْقِيقِ صِحَّةِ الوَثَائِقِ فِي غُضُونِ ٢-٣ دَقَائِقَ فَقَطْ. إِذَا تَمَّتْ المُوَافَقَةُ عَلَى وَثَائِقِكَ، يُمْكِنُكَ البَدْءُ فِي العَمَلِ كَسَائِقٍ عَلَى تَطْبِيق سَفَر. يُرْجَى مُلَاحَظَةُ، تَقْدِيمُ وَثَائِقَ مُزَورَةٍ يُعَدُّ جَرِيمَةً خَطِيرَةً وَقَدْ يَتَرَتَّبُ عَلَيْهِ اِنهَاءُ الحِسَابِ فَوْرِيَّاً وَعَوَاقِبُ قَانُونِيَّة.',
"Documents check": "فحص الوثائق",
"Driver's License": "رخصة القيادة",
"License Type": "نوع الرخصة",
"National Number": "الرقم الوطني",
"Name (Arabic)": "الاسم بالعربي",
"Name (English)": "الاسم بالإنجليزية",
"Address": "العنوان",
"Issue Date": "تاريخ الإصدار",
"Expiry Date": "تاريخ الانتهاء",
"License Categories": "فئات الرخصة",
"driver_license": "رخصة القيادة",
"Capture an Image of Your Driver License": "التقط صورة لرخصة قيادتك",
"ID Documents Back": "الوجه الخلفي لوثائق الهوية",
"National ID": "البطاقة الوطنية",
"Occupation": "المهنة",
"Gender": "الجنس",
"Religion": "الديانة",
"Marital Status": "الحالة الاجتماعية",
"Full Name (Marital)": "الاسم الكامل (حسب الحالة الاجتماعية)",
"Expiration Date": "تاريخ الانتهاء",
"Capture an Image of Your ID Document Back":
"التقط صورة للوجه الخلفي لوثيقة الهوية الخاصة بك",
"ID Documents Front": "الوجه الأمامي لوثائق الهوية",
"First Name": "الاسم الأول",
"CardID": "رقم البطاقة",
"Full Name": "الاسم الكامل",
"Vehicle Details Front": "تفاصيل المركبة ‏الوجه الأمامية",
"Plate Number": "رقم اللوحة",
"Owner Name": "اسم المالك",
"Vehicle Details Back": "تفاصيل المركبة ‏الوجه الخلفي",
"Make": "المصنع",
"Model": "الطراز",
"Year": "السنة",
"Chassis": "الشاسيه",
"Color": "اللون",
"Displacement": "السعة",
"Fuel": "الوقود",
"Tax Expiry Date": "تاريخ انتهاء الضريبة",
"Inspection Date": "تاريخ الفحص",
"Capture an Image of Your car license back":
"التقط صورة للوجه الخلفي لرخصة سيارتك",
'Capture an Image of Your Drivers License':
'التقط صورة لرخصة قيادتك',
'Sign in with Google for easier email and name entry':
'سجل دخولك باستخدام جوجل لتسجيل بريدك الإلكتروني واسمك بسهولة',
'You will choose allow all the time to be ready receive orders':
'ستختار السماح طوال الوقت لتكون جاهزًا لاستقبال الطلبات',
'Welcome to Sefer!': 'مرحبا بكم في سفر!',
'Get to your destination quickly and easily.':
'وصول إلى وجهتك بسرعة وسهولة.',
'Enjoy a safe and comfortable ride.': 'استمتع برحلة آمنة ومريحة.',
"Choose Language": "اخْتَر اللُّغَة",
"Login": "تَسْجِيل الدُّخُول",
'\nWe also prioritize affordability, offering competitive pricing to make your rides accessible.':
"\nكما نضع في اعتبار القدرة على تحمل التكاليف ، ونقدم أسعارًا تنافسية لجعل رحلاتك في متناول الجميع.",
'Most Secure Methods': 'أساليب الأمان الأكثر',
'In-App VOIP Calls': 'مكالمات VOIP داخل التطبيق',
'Recorded Trips for Safety': 'تسجيل الرحلات من أجل السلامة',
"Pay with Wallet": 'ادْفَع بِاسْتِخْدَام المَحْفَظَة',
"Invalid MPIN": 'رَمْز PIN غَيْر صَحِيح',
"Invalid OTP": 'كود التَّحَقُّق خَاطِئ',

View File

@@ -32,7 +32,10 @@ class SplashScreen extends StatelessWidget {
splashScreenController.animationController.value < 0.2
? splashScreenController.zoomInAnimation.value
: splashScreenController.zoomOutAnimation.value,
child: Image.asset('assets/images/logo.gif'),
child: Image.asset(
'assets/images/logo.gif',
width: Get.width * .5,
),
);
},
);

View File

@@ -1,3 +1,6 @@
import 'dart:convert';
import 'package:SEFER/views/auth/sms_verfy_page.dart';
import 'package:animated_text_kit/animated_text_kit.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
@@ -11,7 +14,11 @@ import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:SEFER/views/widgets/my_scafold.dart';
import '../../constant/info.dart';
import '../../constant/links.dart';
import '../../controller/auth/google_sign.dart';
import '../../controller/auth/login_controller.dart';
import '../../controller/firebase/firbase_messge.dart';
import '../../controller/functions/crud.dart';
import '../home/profile/passenger_profile_page.dart';
import '../widgets/mycircular.dart';
import 'register_page.dart';
@@ -37,191 +44,211 @@ class LoginPage extends StatelessWidget {
locationPermissionDialog()
else
SingleChildScrollView(
child: Column(
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;
},
),
GetBuilder<LoginController>(
builder: (controller) => controller
.isloading
? const MyCircularProgressIndicator()
: MyElevatedButton(
onPressed: () {
if (controller
.formKey.currentState!
.validate()) {
controller.login();
}
},
title: 'Submit'.tr,
),
)
],
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
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;
// },
// ),
// GetBuilder<LoginController>(
// builder: (controller) => 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 * .7,
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,
),
),
),
),
)),
Text(
'if you dont have account'.tr,
style: AppStyle.subtitle,
),
AnimatedTextKit(
onTap: () => Get.to(() => const RegisterPage()),
animatedTexts: [
TypewriterAnimatedText(
'Register'.tr,
textStyle: AppStyle.headTitle2,
speed: const Duration(milliseconds: 200),
MyElevatedButton(
title: 'Sign In by Google'.tr,
onPressed: () async {
await GoogleSignInHelper.signInFromLogin();
},
kolor: AppColor.blueColor,
),
],
),
],
totalRepeatCount: 4,
pause: const Duration(milliseconds: 200),
displayFullTextOnTap: true,
stopPauseOnTap: true,
),
// const Spacer(),
const SizedBox(
height: 100,
),
// GestureDetector(
// onTap: () => Get.to(LoginCaptin()),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
// children: [
// const Icon(
// Icons.drive_eta_rounded,
// size: 50,
// ),
// Text(
// 'If You Want be Driver \nClick Here.'.tr,
// style: AppStyle.headTitle2,
// textAlign: TextAlign.center,
// ),
// ],
// ),
// ),
// IconButton(
// onPressed: () {
// box.remove(BoxName.countryCode);
// },
// icon: const Icon(Icons.delete),
// ),
],
)),
SizedBox(
height: Get.height * .1,
),
// Text(
// 'if you dont have account'.tr,
// style: AppStyle.subtitle,
// ),
// AnimatedTextKit(
// onTap: () => Get.to(() => SmsSignupEgypt()),
// animatedTexts: [
// TypewriterAnimatedText(
// 'Register'.tr,
// textStyle: AppStyle.headTitle2,
// speed: const Duration(milliseconds: 200),
// ),
// ],
// totalRepeatCount: 4,
// pause: const Duration(milliseconds: 200),
// displayFullTextOnTap: true,
// stopPauseOnTap: true,
// ),
// const Spacer(),
const SizedBox(
height: 100,
),
],
),
),
)
],

View File

@@ -0,0 +1,104 @@
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/controller/auth/register_controller.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:SEFER/views/widgets/my_scafold.dart';
import 'package:SEFER/views/widgets/my_textField.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class SmsSignupEgypt extends StatelessWidget {
SmsSignupEgypt({super.key});
@override
Widget build(BuildContext context) {
Get.put(RegisterController());
return MyScafolld(
title: 'Phone Check'.tr,
body: [
GetBuilder<RegisterController>(builder: (registerController) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// Logo at the top
Padding(
padding: const EdgeInsets.only(bottom: 20.0),
child: Image.asset(
'assets/images/logo.png', // Make sure you have a logo image in your assets folder
height: 100,
),
),
// Message to the driver
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
child: Text(
'We need your phone number to contact you and to help you.'
.tr,
textAlign: TextAlign.center,
style: AppStyle.title,
),
),
// Enter phone number text
Padding(
padding:
const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
child: Text(
'Enter your phone number'.tr,
textAlign: TextAlign.center,
style: AppStyle.title,
),
),
// Phone number input field
Padding(
padding: const EdgeInsets.all(16.0),
child: !registerController.isSent
? Form(
key: registerController.formKey3,
child: MyTextForm(
controller: registerController.phoneController,
label: 'Enter your phone number'.tr,
hint: 'Enter your phone number'.tr,
type: TextInputType.phone),
)
: Container(
decoration: AppStyle.boxDecoration1,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
registerController.phoneController.text,
style: AppStyle.title,
),
),
)),
const SizedBox(
height: 10,
),
Padding(
padding: const EdgeInsets.all(16.0),
child: registerController.isSent
? Form(
key: registerController.formKey3,
child: MyTextForm(
controller: registerController.verifyCode,
label: '5 digit'.tr,
hint: '5 digit'.tr,
type: TextInputType.number),
)
: const SizedBox()),
// Submit button
MyElevatedButton(
onPressed: () async {
!registerController.isSent
? await registerController.sendOtpMessage()
: await registerController.verifySMSCode();
},
title: 'Submit'.tr,
),
],
);
}),
],
isleading: true,
);
}
}

View File

@@ -168,10 +168,10 @@ class MapMenuWidget extends StatelessWidget {
final String driverAppUrl;
if (defaultTargetPlatform == TargetPlatform.android) {
driverAppUrl =
'https://play.google.com/store/apps/details?id=id6458734951'; // Replace with your driver app's Play Store URL
'https://play.google.com/store/apps/details?id=com.sefer_driver&pli=1'; // Replace with your driver app's Play Store URL
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
driverAppUrl =
'https://apps.apple.com/app/id6458734951'; // Replace with your driver app's App Store ID
'https://apps.apple.com/app/sefer-driver/id6502189302'; // Replace with your driver app's App Store ID
} else {
// Handle other platforms or unknown platform (optional)
return;

View File

@@ -1,3 +1,6 @@
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/main.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
@@ -40,10 +43,12 @@ class MyTextForm extends StatelessWidget {
borderRadius: BorderRadius.all(Radius.circular(12))),
labelText: label.tr,
hintText: hint.tr,
hintStyle: AppStyle.title,
labelStyle: AppStyle.title,
),
validator: (value) {
if (value!.isEmpty) {
return 'Please enter $label.'.tr;
return '${'Please enter'.tr} $label.'.tr;
}
if (type == TextInputType.emailAddress) {
@@ -51,7 +56,11 @@ class MyTextForm extends StatelessWidget {
return 'Please enter a valid email.'.tr;
}
} else if (type == TextInputType.phone) {
if (value.length != 10) {
if (box.read(BoxName.countryCode) == 'Egypt') {
if (value.length != 11) {
return 'Please enter a valid phone number.'.tr;
}
} else if (value.length != 10) {
return 'Please enter a valid phone number.'.tr;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 KiB

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 B

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 B

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB