This commit is contained in:
Hamza-Ayed
2024-07-05 04:51:14 +03:00
parent b48bcfdebb
commit fec02b13ee
40 changed files with 652 additions and 194 deletions

74
.env
View File

@@ -39,3 +39,77 @@ payMobOutClientSecrret='wcP2bUQBRYy254hjCJhNlOatefDzifNDnXRQSiu6UhhcXfZdyCyiBaUr
payMobOutClient_id='gnBTH5kGzR4RGPwzEUxIKCJx9SA5zAwpXiX4vaiTXrXlBl'
payMobOutPassword='#f9vZtxHdIGvAbl5wWMQkvgZTXrXlBl'
payMobOutUserName='zjujl_qvo_fwjfgjlXrXlBl'
import '../controller/functions/encrypt.dart';
import '../env/env.dart';
import 'char_map.dart';
import 'credential.dart';
class AK {
static final AC a = AC();
static final String publishableKey =
KeyEncryption.decryptKey(Env.stripePublishableKe);
static final String secretKey = KeyEncryption.decryptKey(Env.secretKey);
static final String basicAuthCredentials =
KeyEncryption.decryptKey(Env.basicAuthCredentials);
static final String accountSIDTwillo =
KeyEncryption.decryptKey(Env.accountSIDTwillo);
static final String serverAPI = KeyEncryption.decryptKey(Env.serverAPI);
static final String mapAPIKEY = KeyEncryption.decryptKey(Env.mapAPIKEY);
static final String twilloRecoveryCode =
KeyEncryption.decryptKey(Env.twilloRecoveryCode);
static final String authTokenTwillo =
KeyEncryption.decryptKey(Env.authTokenTwillo);
static final String chatGPTkey = KeyEncryption.decryptKey(Env.chatGPTkey);
static final String transactionCloude =
KeyEncryption.decryptKey(Env.transactionCloude);
static final String visionApi = KeyEncryption.decryptKey(Env.visionApi);
static final String chatGPTkeySefer =
KeyEncryption.decryptKey(Env.chatGPTkeySefer);
static final String chatGPTkeySeferNew =
KeyEncryption.decryptKey(Env.chatGPTkeySeferNew);
static final String serverPHP = Env.serverPHP;
static final String llamaKey = KeyEncryption.decryptKey(Env.llamaKey);
static final String cohere = KeyEncryption.decryptKey(Env.cohere);
static final String claudeAiAPI = KeyEncryption.decryptKey(Env.claudeAiAPI);
static final String payPalClientId =
KeyEncryption.decryptKey(Env.payPalClientId);
static final String payPalSecret = KeyEncryption.decryptKey(Env.payPalSecret);
static final String geminiApi = KeyEncryption.decryptKey(Env.geminiApi);
static final String agoraAppId = KeyEncryption.decryptKey(Env.agoraAppId);
static final String agoraAppCertificate =
KeyEncryption.decryptKey(Env.agoraAppCertificate);
static final String payPalClientIdLive =
KeyEncryption.decryptKey(Env.payPalClientIdLive);
static final String payPalSecretLive =
KeyEncryption.decryptKey(Env.payPalSecretLive);
static final String integrationIdPayMob =
KeyEncryption.decryptKey(Env.integrationIdPayMob);
static final String passwordPayMob =
KeyEncryption.decryptKey(Env.passwordPayMob);
static final String usernamePayMob =
KeyEncryption.decryptKey(Env.usernamePayMob);
static final String payMobApikey = KeyEncryption.decryptKey(Env.payMobApikey);
static final String integrationIdPayMobWallet =
KeyEncryption.decryptKey(Env.integrationIdPayMobWallet);
static final String smsPasswordEgypt =
KeyEncryption.decryptKey(Env.smsPasswordEgypt);
static final String ocpApimSubscriptionKey = Env.ocpApimSubscriptionKey;
static final String chatGPTkeySeferNew4 =
KeyEncryption.decryptKey(Env.chatGPTkeySeferNew4);
static final String anthropicAIkeySeferNew =
KeyEncryption.decryptKey(Env.anthropicAIkeySeferNew);
static final String llama3Key = KeyEncryption.decryptKey(Env.llama3Key);
static final String payMobOutClientSecrret =
KeyEncryption.decryptKey(Env.payMobOutClientSecrret);
static final String payMobOutClient_id =
KeyEncryption.decryptKey(Env.payMobOutClient_id);
static final String payMobOutPassword =
KeyEncryption.decryptKey(Env.payMobOutPassword);
static final String payMobOutUserName =
KeyEncryption.decryptKey(Env.payMobOutUserName);
}

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 17 KiB

BIN
assets/images/lady1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

After

Width:  |  Height:  |  Size: 61 KiB

BIN
assets/images/moto1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -37,11 +37,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>40</string>
<string>41</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>4.3.40</string>
<string>4.3.41</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<string>NO</string>
<key>GMSApiKey</key>

View File

@@ -190,9 +190,13 @@ class AppLink {
static String auth = '$server/auth';
static String login = "$auth/login.php";
static String getTesterApp = "$auth/Tester/getTesterApp.php";
static String updateTesterApp = "$auth/Tester/updateTesterApp.php";
static String signUp = "$auth/signup.php";
static String sendVerifyEmail = "$auth/sendVerifyEmail.php";
static String loginFromGooglePassenger = "$auth/loginFromGooglePassenger.php";
static String checkPhoneNumberISVerfiedPassenger =
"$auth/checkPhoneNumberISVerfiedPassenger.php";
static String passengerRemovedAccountEmail =
"$auth/passengerRemovedAccountEmail.php";

View File

@@ -1,16 +1,15 @@
import 'dart:convert';
import 'dart:math';
import 'package:SEFER/constant/info.dart';
import 'package:SEFER/controller/firebase/firbase_messge.dart';
import 'package:SEFER/views/auth/login_page.dart';
import 'package:SEFER/views/auth/sms_verfy_page.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/constant/links.dart';
import 'package:SEFER/controller/functions/crud.dart';
import 'package:SEFER/controller/functions/secure_storage.dart';
import 'package:SEFER/main.dart';
import 'package:SEFER/views/auth/verify_email_page.dart';
import 'package:SEFER/views/home/map_page_passenger.dart';
import 'package:location/location.dart';
@@ -24,12 +23,30 @@ class LoginController extends GetxController {
TextEditingController adminNameController = TextEditingController();
bool isAgreeTerms = false;
bool isloading = false;
late int isTest = 1;
void changeAgreeTerm() {
isAgreeTerms = !isAgreeTerms;
update();
}
getAppTester(String appPlatform) async {
var res = await CRUD()
.get(link: AppLink.getTesterApp, payload: {'appPlatform': appPlatform});
if (res != 'failure') {
var d = jsonDecode(res);
isTest = d['message'][0]['isTest'];
update();
} else {
return false;
}
}
updateAppTester(String appPlatform) async {
await CRUD().post(
link: AppLink.updateTesterApp, payload: {'appPlatform': appPlatform});
}
void saveAgreementTerms() {
box.write(BoxName.agreeTerms, 'agreed');
update();
@@ -49,7 +66,6 @@ class LoginController extends GetxController {
'id': passengerID,
});
if (res == 'Failure') {
//Failure
Get.offAll(SmsSignupEgypt());
isloading = false;
update();
@@ -142,57 +158,41 @@ class LoginController extends GetxController {
void login() async {
isloading = true;
update();
var res = await CRUD().get(link: AppLink.login, payload: {
'email': emailController.text,
'phone': phoneController.text,
'password': passwordController.text
});
var res = await CRUD().get(
link: AppLink.loginFromGooglePassenger,
payload: {
'email': emailController.text,
'id': passwordController.text
});
isloading = false;
update();
if (res == 'Failure') {
Get.snackbar('Failure', '', backgroundColor: Colors.red);
//Failure
Get.offAll(() => LoginPage());
isloading = false;
update();
// Get.snackbar("User does not exist.".tr, '', backgroundColor: Colors.red);
} else {
var jsonDecoeded = jsonDecode(res);
if (jsonDecoeded.isNotEmpty) {
if (jsonDecoeded['status'] == 'success') {
if (jsonDecoeded['data'][0]['verified'] == 1) {
box.write(BoxName.passengerID, jsonDecoeded['data'][0]['id']);
box.write(BoxName.email, jsonDecoeded['data'][0]['email']);
box.write(
BoxName.name,
jsonDecoeded['data'][0]['first_name'] +
' ' +
jsonDecoeded['data'][0]['last_name']);
box.write(BoxName.phone, jsonDecoeded['data'][0]['phone']);
SecureStorage().saveData(BoxName.password, passwordController.text);
Get.offAll(() => const MapPagePassenger());
isloading = false;
update();
if (jsonDecoeded['status'] == 'success' &&
jsonDecoeded['data'][0]['verified'] == 1) {
//
box.write(BoxName.isVerified, '1');
box.write(BoxName.email, jsonDecoeded['data'][0]['email']);
box.write(BoxName.phone, jsonDecoeded['data'][0]['phone']);
box.write(BoxName.passengerID, passwordController.text);
// var token = await CRUD().get(link: AppLink.getTokens, payload: {
// 'passengerID': box.read(BoxName.passengerID).toString()
// });
await updateAppTester(AppInformation.appName);
await CRUD().post(link: AppLink.addTokens, payload: {
'token': box.read(BoxName.tokenFCM),
'passengerID': box.read(BoxName.passengerID).toString()
});
} else {
isloading = false;
update();
Get.defaultDialog(
title: 'You must Verify email !.'.tr,
middleText: '',
backgroundColor: Colors.yellow[300],
onConfirm: () async {
int randomNumber = Random().nextInt(100000) + 1;
await CRUD().post(link: AppLink.sendVerifyEmail, payload: {
'email': emailController.text,
'token': randomNumber.toString(),
});
Get.to(() => const VerifyEmailPage());
},
);
}
} else if (jsonDecoeded['status'] == 'Failure') {
Get.snackbar(jsonDecoeded['status'], jsonDecoeded['data'],
backgroundColor: Colors.redAccent);
Get.offAll(() => const MapPagePassenger());
} else {
// Get.offAll(() => SmsSignupEgypt());
// Get.snackbar(jsonDecoeded['status'], jsonDecoeded['data'],
// backgroundColor: Colors.redAccent);
isloading = false;
update();
}
@@ -245,7 +245,11 @@ class LoginController extends GetxController {
@override
void onInit() async {
// permissionLocation = await Permission.locationWhenInUse.isGranted;
await getAppTester(AppInformation.appName);
if (isTest == 0 && box.read(BoxName.passengerID) != null) {
await loginUsingCredentials(
box.read(BoxName.passengerID), box.read(BoxName.email));
}
super.onInit();
}
}

View File

@@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:convert';
import 'dart:math';
import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/views/home/map_page_passenger.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@@ -88,18 +89,33 @@ class RegisterController extends GetxController {
update();
if (formKey3.currentState!.validate()) {
if (box.read(BoxName.countryCode) == 'Egypt') {
await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: {
var responseCheker = await CRUD()
.post(link: AppLink.checkPhoneNumberISVerfiedPassenger, payload: {
'phone_number': '+2${phoneController.text}',
'token': randomNumber.toString(),
});
if (responseCheker != 'failure') {
var d = jsonDecode(responseCheker);
if (d['message'][0]['verified'] == 1) {
Get.snackbar('Phone number is verified before'.tr, '',
backgroundColor: AppColor.greenColor);
box.write(BoxName.isVerified, '1');
box.write(BoxName.phone, '+2${phoneController.text}');
Get.offAll(const MapPagePassenger());
}
} else {
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;
remainingTime = 300; // Reset to 5 minutes
startTimer();
isLoading = false;
update();
await smsEgyptController.sendSmsEgypt(
phoneController.text.toString(), randomNumber.toString());
isSent = true;
remainingTime = 300; // Reset to 5 minutes
startTimer();
isLoading = false;
update();
}
}
}
}
@@ -129,7 +145,7 @@ class RegisterController extends GetxController {
link: AppLink.signUp,
payload: payload,
);
if (jsonDecode(res1)['status'] == 'success') {
if (res1 != 'failure') {
box.write(BoxName.isVerified, '1');
box.write(BoxName.phone, '+2${phoneController.text}');
Get.offAll(const MapPagePassenger());

View File

@@ -117,8 +117,8 @@ class FirebaseMessagesController extends GetxController {
}
void fireBaseTitles(RemoteMessage message) {
if (message.notification!.title! == 'Order') {
} else if (message.notification!.title! == 'Apply Ride') {
if (message.notification!.title! == 'Order'.tr) {
} else if (message.notification!.title! == 'Apply Ride'.tr) {
var passengerList = message.data['passengerList'];
var myList = jsonDecode(passengerList) as List<dynamic>;
@@ -130,7 +130,7 @@ class FirebaseMessagesController extends GetxController {
NotificationController().showNotification(
'Apply Order'.tr, 'Driver Applied the Ride for You'.tr, 'order1');
// driverAppliedTripSnakBar();
} else if (message.notification!.title! == 'Promo') {
} else if (message.notification!.title! == 'Promo'.tr) {
NotificationController()
.showNotification('Promo', 'Show latest promo'.tr, 'promo');
Get.to(const PromosPassengerPage());
@@ -143,11 +143,11 @@ class FirebaseMessagesController extends GetxController {
'rideId': myList[0].toString(),
'driverId': myList[1].toString(),
});
} else if (message.notification!.title! == 'token change') {
} else if (message.notification!.title! == 'token change'.tr) {
NotificationController()
.showNotification('token change', 'token change', 'cancel');
.showNotification('token change'.tr, 'token change'.tr, 'cancel');
GoogleSignInHelper.signOut();
} else if (message.notification!.title! == 'DriverIsGoingToPassenger') {
} else if (message.notification!.title! == 'DriverIsGoingToPassenger'.tr) {
Get.find<MapPassengerController>().isDriverInPassengerWay = true;
Get.find<MapPassengerController>().update();
NotificationController().showNotification('Driver is Going To You'.tr,
@@ -160,32 +160,32 @@ class FirebaseMessagesController extends GetxController {
passengerDialog(message.notification!.body!);
update();
} else if (message.notification!.title! == 'message From Driver'.tr) {
} else if (message.notification!.title! == 'message From Driver') {
NotificationController()
.showNotification('message From passenger'.tr, ''.tr, 'tone2');
passengerDialog(message.notification!.body!);
update();
} else if (message.notification!.title! == 'RideIsBegin') {
} else if (message.notification!.title! == 'RideIsBegin'.tr) {
Get.find<MapPassengerController>().getBeginRideFromDriver();
// Get.snackbar('RideIsBegin', '', backgroundColor: AppColor.greenColor);
box.write(BoxName.passengerWalletTotal, '0');
NotificationController()
.showNotification('Trip is Begin'.tr, ''.tr, 'start');
update();
} else if (message.notification!.title! == 'Hi ,I will go now') {
} else if (message.notification!.title! == 'Hi ,I will go now'.tr) {
// Get.snackbar('Hi ,I will go now', '',
// backgroundColor: AppColor.greenColor);
NotificationController().showNotification(
'Passenger come to you'.tr, 'Hi ,I will go now'.tr, 'tone2');
update();
} else if (message.notification!.title! == 'Hi ,I Arrive your site') {
} else if (message.notification!.title! == 'Hi ,I Arrive your site'.tr) {
NotificationController()
.showNotification('Hi ,I Arrive your site'.tr, ''.tr, 'tone2');
driverArrivePassengerDialoge();
update();
} else if (message.notification!.title! == 'Driver Finish Trip') {
} else if (message.notification!.title! == 'Driver Finish Trip'.tr) {
var myListString = message.data['passengerList'];
var driverList = jsonDecode(myListString) as List<dynamic>;
NotificationController().showNotification(
@@ -204,7 +204,7 @@ class FirebaseMessagesController extends GetxController {
'price': driverList[3].toString()
});
// }
} else if (message.notification!.title! == "Finish Monitor") {
} else if (message.notification!.title! == "Finish Monitor".tr) {
Get.defaultDialog(
titleStyle: AppStyle.title,
title: 'Trip finished '.tr,
@@ -214,6 +214,8 @@ class FirebaseMessagesController extends GetxController {
onPressed: () {
Get.offAll(() => const MapPagePassenger());
}));
} else if (message.notification!.title! == "Trip Monitoring".tr) {
Get.to(() => const TripMonitor());
} else if (message.notification!.title! == 'Call Income') {
try {
var myListString = message.data['passengerList'];
@@ -232,7 +234,7 @@ class FirebaseMessagesController extends GetxController {
remoteID: driverList[2].toString(),
));
} catch (e) {}
} else if (message.notification!.title! == 'Call Income from Driver') {
} else if (message.notification!.title! == 'Call Income from Driver'.tr) {
try {
var myListString = message.data['passengerList'];
var driverList = jsonDecode(myListString) as List<dynamic>;
@@ -250,7 +252,7 @@ class FirebaseMessagesController extends GetxController {
remoteID: driverList[2].toString(),
));
} catch (e) {}
} else if (message.notification!.title! == 'Call End') {
} else if (message.notification!.title! == 'Call End'.tr) {
try {
var myListString = message.data['passengerList'];
var driverList = jsonDecode(myListString) as List<dynamic>;
@@ -264,7 +266,7 @@ class FirebaseMessagesController extends GetxController {
// Assuming GetMaterialApp is initialized and context is valid for navigation
// Get.off(const CallPage());
} catch (e) {}
} else if (message.notification!.title! == 'Driver Cancel Your Trip') {
} else if (message.notification!.title! == 'Driver Cancel Your Trip'.tr) {
// Get.snackbar(
// 'You will be pay the cost to driver or we will get it from you on next trip'
// .tr,
@@ -294,7 +296,7 @@ class FirebaseMessagesController extends GetxController {
// );
// }
else if (message.notification!.title! == 'Order Applied') {
else if (message.notification!.title! == 'Order Applied'.tr) {
NotificationController().showNotification(
'The order Accepted by another Driver'.tr,
'We regret to inform you that another driver has accepted this order.'

View File

@@ -28,6 +28,7 @@ class CRUD {
},
);
print(response.request);
print(response.body);
// if (response.statusCode == 200) {
var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') {
@@ -227,7 +228,8 @@ class CRUD {
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
},
);
print(response.request);
print(response.body);
var jsonData = jsonDecode(response.body);
if (response.statusCode == 200) {
if (jsonData['status'] == 'success') {

View File

@@ -45,7 +45,9 @@ class MapPassengerController extends GetxController {
TextEditingController wayPoint4Controller = TextEditingController();
TextEditingController sosPhonePassengerProfile = TextEditingController();
TextEditingController whatsAppLocationText = TextEditingController();
TextEditingController messageToDriver = TextEditingController();
final sosFormKey = GlobalKey<FormState>();
final messagesFormKey = GlobalKey<FormState>();
final increaseFeeFormKey = GlobalKey<FormState>();
List data = [];
List<LatLng> bounds = [];
@@ -96,6 +98,8 @@ class MapPassengerController extends GetxController {
BitmapDescriptor startIcon = BitmapDescriptor.defaultMarker;
BitmapDescriptor endIcon = BitmapDescriptor.defaultMarker;
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
BitmapDescriptor motoIcon = BitmapDescriptor.defaultMarker;
BitmapDescriptor ladyIcon = BitmapDescriptor.defaultMarker;
double height = 150;
DateTime currentTime = DateTime.now();
final location = Location();
@@ -1235,6 +1239,7 @@ class MapPassengerController extends GetxController {
void timerEnded() async {
runEvery30SecondsUntilConditionMet();
isCancelRidePageShown = false;
print('isCancelRidePageShown: ${isCancelRidePageShown}');
update();
}
@@ -1266,7 +1271,7 @@ class MapPassengerController extends GetxController {
driversToken.remove(driverToken);
for (var i = 1; i < driversToken.length; i++) {
FirebaseMessagesController().sendNotificationToAnyWithoutData(
'Order Applied',
'Order Applied'.tr,
'$driverName Apply order\nTake attention in other order'.tr,
driversToken[i],
'start.wav',
@@ -1345,9 +1350,9 @@ class MapPassengerController extends GetxController {
i < dataCarsLocationByPassenger['message'].length;
i++) {
var json = dataCarsLocationByPassenger['message'][i];
CarLocationModel model = CarLocationModel.fromJson(json);
// CarLocationModel model = CarLocationModel.fromJson(json);
if (carLocationsModels.length < i + 1) {
carLocationsModels.add(model);
// carLocationsModels.add(model);
markers.add(
Marker(
markerId: MarkerId(json['latitude']),
@@ -1356,13 +1361,17 @@ class MapPassengerController extends GetxController {
double.parse(json['longitude']),
),
rotation: double.parse(json['heading']),
icon: carIcon,
icon: json['model'].toString().contains('دراجة')
? motoIcon
: json['gender'] == 'Male'
? carIcon
: ladyIcon,
),
);
driversToken.add(json['token']);
// driversToken = json['token'];
} else {
carLocationsModels[i] = model;
// carLocationsModels[i] = model;
markers[i] = Marker(
markerId: MarkerId(json['latitude']),
position: LatLng(
@@ -1370,7 +1379,11 @@ class MapPassengerController extends GetxController {
double.parse(json['longitude']),
),
rotation: double.parse(json['heading']),
icon: carIcon,
icon: json['model'].contains('دراجة')
? motoIcon
: json['gender'] == 'Male'
? carIcon
: ladyIcon,
);
// driversToken = json['token'];
driversToken.add(json['token']);
@@ -1517,7 +1530,7 @@ class MapPassengerController extends GetxController {
for (var i = 0; i < loopCount; i++) {
// Wait for 50 seconds.
await Future.delayed(const Duration(seconds: 4));
if (rideTimerBegin == true) {
if (rideTimerBegin == true || statusRide == 'Apply') {
await getDriverCarsLocationToPassengerAfterApplied();
}
reloadMarkerDriverCarsLocationToPassengerAfterApplied();
@@ -1566,8 +1579,16 @@ class MapPassengerController extends GetxController {
rotation: double.parse(
datadriverCarsLocationToPassengerAfterApplied['message'][0]
['heading']),
icon: carIcon,
icon: datadriverCarsLocationToPassengerAfterApplied['message'][0]['model']
.contains('دراجة')
? motoIcon
: datadriverCarsLocationToPassengerAfterApplied['message'][0]
['gender'] ==
'Male'
? carIcon
: ladyIcon, // Default to carIcon if gender is not Male or Female
);
markers.add(driverAcceptedMarker);
// update();
mapController?.animateCamera(CameraUpdate.newLatLng(driverPosition));
@@ -1620,8 +1641,9 @@ class MapPassengerController extends GetxController {
"order_id": rideId.toString(), // Convert to String
"status": 'Cancel'
});
print('Cancel');
FirebaseMessagesController().sendNotificationToDriverMAP(
'Cancel Trip'.tr,
'Cancel Trip',
'Trip Cancelled'.tr,
driverToken,
[],
@@ -1922,6 +1944,28 @@ class MapPassengerController extends GetxController {
});
}
void addCustomMotoIcon() {
ImageConfiguration config = ImageConfiguration(
size: const Size(30, 30), devicePixelRatio: Get.pixelRatio);
BitmapDescriptor.fromAssetImage(config, 'assets/images/moto1.png',
mipmaps: false)
.then((value) {
motoIcon = value;
update();
});
}
void addCustomLadyIcon() {
ImageConfiguration config = ImageConfiguration(
size: const Size(30, 30), devicePixelRatio: Get.pixelRatio);
BitmapDescriptor.fromAssetImage(config, 'assets/images/lady1.png',
mipmaps: false)
.then((value) {
ladyIcon = value;
update();
});
}
void addCustomStepIcon() {
ImageConfiguration config = ImageConfiguration(
size: const Size(30, 30), devicePixelRatio: Get.pixelRatio);
@@ -2253,7 +2297,7 @@ class MapPassengerController extends GetxController {
isLoading = false;
update();
var url =
('${AppLink.googleMapsLink}directions/json?&language=${box.read(BoxName.lang)}&avoid=tolls|ferries&destination=$destination&origin=$origin&key=${AK.mapAPIKEY}');
('${AppLink.googleMapsLink}directions/json?&language=ar&avoid=tolls|ferries&destination=$destination&origin=$origin&key=${AK.mapAPIKEY}');
var response = await CRUD().getGoogleApi(link: url, payload: {});
data = response['routes'][0]['legs'];
@@ -2342,14 +2386,17 @@ class MapPassengerController extends GetxController {
// Initialize the short address
String shortAddress = '';
// Add the first part (usually the most specific location)
if (parts.isNotEmpty) {
// Add the first part (usually the most specific location)
shortAddress += parts[0];
}
// Add the district or area name (usually the third part in this format)
if (parts.length > 2) {
// Add the district or area name (usually the third part in Arabic format)
shortAddress += '، ${parts[2]}';
} else if (parts.length > 1) {
// Add the second part for English or shorter addresses
shortAddress += '، ${parts[1]}';
}
// Add the country (usually the last part)
@@ -2363,6 +2410,21 @@ class MapPassengerController extends GetxController {
.where((part) => !RegExp(r'^[0-9 ]+$').hasMatch(part.trim()))
.join('،');
// Check if the address is in English
bool isEnglish =
RegExp(r'^[a-zA-Z0-9 ]+$').hasMatch(shortAddress.replaceAll('،', ''));
if (isEnglish) {
// Further processing for English addresses
List<String> englishParts = shortAddress.split('،');
if (englishParts.length > 2) {
shortAddress =
'${englishParts[0]}، ${englishParts[1]}، ${englishParts.last}';
} else if (englishParts.length > 1) {
shortAddress = '${englishParts[0]}، ${englishParts.last}';
}
}
return shortAddress;
}
@@ -2809,6 +2871,8 @@ class MapPassengerController extends GetxController {
readyWayPoints();
addCustomPicker();
addCustomCarIcon();
addCustomLadyIcon();
addCustomMotoIcon();
addCustomStepIcon();
addCustomStartIcon();
addCustomEndIcon();

View File

@@ -17,6 +17,8 @@ class TripMonitorController extends GetxController {
late Timer timer;
late LatLng parentLocation;
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
BitmapDescriptor motoIcon = BitmapDescriptor.defaultMarker;
BitmapDescriptor ladyIcon = BitmapDescriptor.defaultMarker;
double rotation = 0;
double speed = 0;
@@ -65,6 +67,27 @@ class TripMonitorController extends GetxController {
carIcon = value;
update();
});
void addCustomMotoIcon() {
ImageConfiguration config = ImageConfiguration(
size: const Size(30, 30), devicePixelRatio: Get.pixelRatio);
BitmapDescriptor.fromAssetImage(config, 'assets/images/moto1.png',
mipmaps: false)
.then((value) {
motoIcon = value;
update();
});
}
void addCustomLadyIcon() {
ImageConfiguration config = ImageConfiguration(
size: const Size(30, 30), devicePixelRatio: Get.pixelRatio);
BitmapDescriptor.fromAssetImage(config, 'assets/images/lady1.png',
mipmaps: false)
.then((value) {
ladyIcon = value;
update();
});
}
}
@override

View File

@@ -4,6 +4,22 @@ class MyTranslation extends Translations {
@override
Map<String, Map<String, String>> get keys => {
"ar": {
'message From Driver': '‏رسالة من السائق',
'message From passenger': "رسالة من الراكب",
"Where are you, sir?": "أنا وصلت حضرتك فين.",
"I've been trying to reach you but your phone is off.":
"بحاول أكلمك التلفون مغلق.",
"Please don't be late": "أرجو عدم التأخير",
"Please don't be late, I'm waiting for you at the specified location.":
"أرجو عدم التأخير، أنا منتظرك على ال لوكيشن المحدد.",
"My location is correct. You can search for me using the navigation app":
"موقعي صحيح. يمكنك البحث عني باستخدام تطبيق الملاحة",
"Hello, I'm at the agreed-upon location":
"مرحباً، أنا في المكان المتفق عليه",
"message From Driver": "رسالة من السائق",
"How much longer will you be?": "‏قدامك قد إيه",
'Phone number is verified before': "تم التحقق من رقم الهاتف مسبقاً",
'Change Ride': 'تغيير الرحلة',
'You can change the destination by long-pressing any point on the map':
'يمكنك تغيير الوجهة بالضغط مطولاً على أي نقطة على الخريطة',
@@ -423,7 +439,7 @@ iOS [https://getapp.cc/app/6458734951]
"تَلْتَزِم سَفَر بِالسَّلَامَة، وَيَتِمُّ فَحْص جَمِيع قَبَاطِنِنَا بِعِنَايَة وَفَحْص خَلْفِيَّتِهِم.",
"Driver Applied the Ride for You": "طَلَبَ السَّائِق الرِّحْلَة لَك",
"Show latest promo": "أَظْهِر آخِر عَرْض تَرْوِيجِي",
"Cancel Trip": "إِلْغَاء الرِّحْلَة",
"Cancel Trip": "إلغاء الرحلة",
"Passenger Cancel Trip": "الرَّاكِب أَلْغَى الرِّحْلَة",
"Please stay on the picked point.":
"الرَّجَاء الْبَقَاء فِي النُّقْطَة الْمُحَدَّدَة.",

View File

@@ -69,6 +69,7 @@ class ProfileController extends GetxController {
MyElevatedButton(
title: 'Update'.tr,
onPressed: () async {
Get.back();
await updateColumn({
'id': box.read(BoxName.passengerID),
columnName: txtController.text,
@@ -76,7 +77,7 @@ class ProfileController extends GetxController {
if (columnName == 'first_name') {
box.write(BoxName.name, txtController.text);
}
Get.back();
txtController.clear();
},
)

View File

@@ -3,6 +3,7 @@ import 'dart:io';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_font_icons/flutter_font_icons.dart';
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/box_name.dart';
@@ -17,6 +18,7 @@ import '../../controller/auth/apple_signin_controller.dart';
import '../../controller/auth/google_sign.dart';
import '../../controller/auth/login_controller.dart';
import '../home/profile/passenger_profile_page.dart';
import '../widgets/mycircular.dart';
class LoginPage extends StatelessWidget {
final controller = Get.put(LoginController());
@@ -58,26 +60,194 @@ class LoginPage extends StatelessWidget {
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,
Platform.isIOS && controller.isTest == 0
? Container(
decoration: AppStyle.boxDecoration,
child: Column(
children: [
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: 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,
),
)
],
),
),
),
),
const SizedBox(
height: 10,
),
],
),
)
: 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,
// ),
InkWell(
onTap: () async {
await GoogleSignInHelper.signInFromLogin();
},
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 16, vertical: 10),
decoration: BoxDecoration(
color: AppColor.redColor,
borderRadius: BorderRadius.circular(8),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(
FontAwesome.google,
color: AppColor.blueColor,
),
const SizedBox(width: 8),
Text(
'Sign In by Google'.tr,
style: const TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
],
),
),
),
MyElevatedButton(
title: 'Sign In by Google'.tr,
onPressed: () async {
await GoogleSignInHelper.signInFromLogin();
},
kolor: AppColor.blueColor,
),
!Platform.isAndroid
? GestureDetector(
onTap: () async {

View File

@@ -36,7 +36,14 @@ class TripMonitor extends StatelessWidget {
markerId: MarkerId('start'.tr),
position: tripMonitorController.parentLocation,
draggable: true,
icon: tripMonitorController.carIcon,
icon: tripMonitorController.tripData['message'][0]['model']
.contains('دراجة')
? tripMonitorController.motoIcon
: tripMonitorController.tripData['message'][0]['model']
['gender'] ==
'Male'
? tripMonitorController.carIcon
: tripMonitorController.ladyIcon,
rotation: tripMonitorController.rotation,
),
},

View File

@@ -10,6 +10,7 @@ import 'package:get/get.dart';
import '../../../constant/box_name.dart';
import '../../../controller/functions/launch.dart';
import '../../widgets/my_textField.dart';
class ApplyOrderWidget extends StatelessWidget {
const ApplyOrderWidget({super.key});
@@ -184,10 +185,9 @@ class ApplyOrderWidget extends StatelessWidget {
title: 'Select one message'.tr,
titleStyle: AppStyle.title,
content: SizedBox(
width: Get.width * .6,
height: Get.height * .5,
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
child: ListView(
children: [
InkWell(
onTap: () {
@@ -216,11 +216,14 @@ class ApplyOrderWidget extends StatelessWidget {
),
),
),
const SizedBox(
height: 5,
),
InkWell(
onTap: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
'message From passenger',
'message From passenger'.tr,
'My location is correct. You can search for me using the navigation app'
.tr,
controller.driverToken,
@@ -243,12 +246,16 @@ class ApplyOrderWidget extends StatelessWidget {
),
),
),
const SizedBox(
height: 5,
),
InkWell(
onTap: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
'message From passenger',
'I\'m waiting for you'.tr,
'My location is correct. You can search for me using the navigation app'
.tr,
controller.driverToken,
'ding.wav',
);
@@ -268,6 +275,84 @@ class ApplyOrderWidget extends StatelessWidget {
),
),
),
const SizedBox(
height: 5,
),
InkWell(
onTap: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
'message From passenger',
"How much longer will you be?"
.tr,
controller.driverToken,
'ding.wav',
);
Get.back();
},
child: Container(
decoration:
AppStyle.boxDecoration1,
child: Padding(
padding:
const EdgeInsets.all(
10),
child: Text(
"How much longer will you be?"
.tr,
style: AppStyle.title,
),
),
),
),
const SizedBox(
height: 5,
),
SizedBox(
width: Get.width * .5,
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Form(
key: controller
.messagesFormKey,
child: SizedBox(
width: Get.width * .4,
child: MyTextForm(
controller: controller
.messageToDriver,
label:
'Type Any thing'
.tr,
hint:
'Type Any thing'
.tr,
type:
TextInputType
.name),
)),
IconButton(
onPressed: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
'message From passenger',
controller
.messageToDriver
.text,
controller
.driverToken,
'ding.wav');
controller
.messageToDriver
.clear();
Get.back();
},
icon: const Icon(
Icons.send))
],
),
)
],
),
));

View File

@@ -595,7 +595,7 @@ class HeaderDestination extends StatelessWidget {
right: 5,
child: Container(
decoration: AppStyle.boxDecoration1,
height: Get.height * .1,
height: Get.height * .15,
width: Get.width * .8,
child: InkWell(
onTap: () {
@@ -618,7 +618,7 @@ class HeaderDestination extends StatelessWidget {
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 2),
child: SizedBox(
height: Get.height * .06,
height: Get.height * .08,
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
//

View File

@@ -1,10 +1,9 @@
import 'package:SEFER/main.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import '../../../constant/box_name.dart';
import '../../../constant/char_map.dart';
import '../../../constant/colors.dart';
import '../../../controller/functions/launch.dart';
import '../../../constant/credential.dart';
import '../../../controller/functions/tts.dart';
import '../../../controller/home/map_passenger_controller.dart';
@@ -83,23 +82,23 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
const SizedBox(
width: 5,
),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () async {
makePhoneCall('+201023248456');
},
icon: const Icon(
Icons.voice_chat,
size: 29,
),
),
),
// AnimatedContainer(
// duration: const Duration(microseconds: 200),
// width: controller.widthMapTypeAndTraffic,
// decoration: BoxDecoration(
// color: AppColor.secondaryColor,
// border: Border.all(),
// borderRadius: BorderRadius.circular(15)),
// child: IconButton(
// onPressed: () async {
// makePhoneCall('+201023248456');
// },
// icon: const Icon(
// Icons.voice_chat,
// size: 29,
// ),
// ),
// ),
// AnimatedContainer(
// duration: const Duration(microseconds: 200),
// width: controller.widthMapTypeAndTraffic,
@@ -120,59 +119,50 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
// ),
// ),
// ),
// AnimatedContainer(
// duration: const Duration(microseconds: 200),
// width: controller.widthMapTypeAndTraffic,
// decoration: BoxDecoration(
// color: AppColor.secondaryColor,
// border: Border.all(),
// borderRadius: BorderRadius.circular(15)),
// child: IconButton(
// onPressed: () async {
// await CRUD().allMethodForAI(
// 'name,fullName,address,idNumber,cardId,dob',
// AppLink.uploadEgypt,
// 'idFront');
//
// // await ImageController().choosImage(
// // 'https://api.sefer.live/sefer/uploadEgypt.php',
// // 'FrontId');
// // AC credentials = AC();
// // String apiKey = AK.payPalSecret;
// // String convertedStringN = credentials.c(
// // credentials.c(credentials.c(apiKey, cs), cC), cn);
//
// // String retrievedStringS = credentials.r(
// // credentials.r(credentials.r(convertedStringN, cn), cC),
// // cs);
// // //
// // if (retrievedStringS == apiKey) {
// // }
//
// // await Get.find<PaymentController>()
// // .payWithPayMob(context, '1100', 'EGP');
// // Initiates a payment with a card using the FlutterPaymob instance
//
// // NotificationController()
// // .showNotification('Order', 'hi this is', 'tone1');
// // Get.to(() => DriverCallPage());
// // controller.getKazanPercent();
// // PassengerCallPage(
// // channelName: '',
// // token: '',
// // remoteID: '',
// // )
// // Get.to(() => const CallPage());
// await Get.find<AudioRecorderController>().startRecording();
// },
// icon: Icon(
// Get.put(AudioRecorderController()).isRecording
// ? Icons.stop
// : Icons.start,
// size: 29,
// ),
// ),
// ),
AnimatedContainer(
duration: const Duration(microseconds: 200),
width: controller.widthMapTypeAndTraffic,
decoration: BoxDecoration(
color: AppColor.secondaryColor,
border: Border.all(),
borderRadius: BorderRadius.circular(15)),
child: IconButton(
onPressed: () async {
// await CRUD().allMethodForAI(
// 'name,fullName,address,idNumber,cardId,dob',
// AppLink.uploadEgypt,
// 'idFront');
//
// // await ImageController().choosImage(
// // 'https://api.sefer.live/sefer/uploadEgypt.php',
// // 'FrontId');
AC credentials = AC();
String apiKey = 'zjujl_qvo_fwjfgjlXrXlBl';
String convertedStringN = credentials.c(
credentials.c(credentials.c(apiKey, cs), cC), cn);
String retrievedStringS = credentials.r(
credentials.r(credentials.r(convertedStringN, cn), cC),
cs);
//
if (retrievedStringS == apiKey) {
print('convertedStringN --- $convertedStringN');
print('retrievedStringS ---$retrievedStringS');
print('same');
}
//
// // await Get.find<PaymentController>()
// // .payWithPayMob(context, '1100', 'EGP');
// // Initiates a payment with a card using the FlutterPaymob instance
//
},
icon: const Icon(
// Get.put(AudioRecorderController()).isRecording
Icons.start,
size: 29,
),
),
),
],
);
})),

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1005 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@@ -29,7 +29,7 @@ dependencies:
geolocator: ^10.0.0
flutter_paypal: ^0.2.0
google_fonts: ^4.0.4
flutter_launcher_icons: #^0.13.1
flutter_launcher_icons: ^0.13.1
flutter_rating_bar: ^4.0.1
flutter_font_icons: ^2.2.5
image_picker: ^1.0.4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB