This commit is contained in:
Hamza-Ayed
2024-12-08 18:16:31 +03:00
parent 630d0c4afb
commit e0c242bd77
34 changed files with 1876 additions and 1345 deletions

1
.env
View File

@@ -5,6 +5,7 @@ accountSIDTwillo=QFx0qy456juj3839xuy2194q629q1fj0y7XrXlBl
serverAPI=QQQQobSrrFi:QVQ87xU7zwCvmZzZdaxuS2f23Y4mz7MzyOzr8od2br6KYyeFaTVLG3K3hx5ZaUyx7eYvAYpAVdKk-286NTRi3zs9iSOnXtXRIxswg3KecBmsl3VxJ9wO-vIpwu4Pv7dkHkXniuxMSDgWXrXlBl serverAPI=QQQQobSrrFi:QVQ87xU7zwCvmZzZdaxuS2f23Y4mz7MzyOzr8od2br6KYyeFaTVLG3K3hx5ZaUyx7eYvAYpAVdKk-286NTRi3zs9iSOnXtXRIxswg3KecBmsl3VxJ9wO-vIpwu4Pv7dkHkXniuxMSDgWXrXlBl
mapAPIKEY=QOmqZsFsutLDCtZCRIUAZAkB5v6AMkKEPMbJGa3XrXlBl mapAPIKEY=QOmqZsFsutLDCtZCRIUAZAkB5v6AMkKEPMbJGa3XrXlBl
twilloRecoveryCode=CAU79DHPH1BE9PUH4ETXTSXZXrXlBl twilloRecoveryCode=CAU79DHPH1BE9PUH4ETXTSXZXrXlBl
apiKeyHere=g_WNUb5L-7-F8oHpUmgIzH7ETeH9xZ8RwGG9_G8zX9A
authTokenTwillo=70u98ju0214xx4q0u74028u021u4qu65XrXlBl authTokenTwillo=70u98ju0214xx4q0u74028u021u4qu65XrXlBl
chatGPTkey=zg-4C26q4SYBKQeHZDqkWowC9XrxgUEfUy9JRw2rm6Q2adb3kjwXrXlBl chatGPTkey=zg-4C26q4SYBKQeHZDqkWowC9XrxgUEfUy9JRw2rm6Q2adb3kjwXrXlBl
transactionCloude=Qhcwilomqcoib:QVO_JNYED2XWA26YXKC2TP:YK1DVH6SJB31N3PE1UXrXlBl transactionCloude=Qhcwilomqcoib:QVO_JNYED2XWA26YXKC2TP:YK1DVH6SJB31N3PE1UXrXlBl

View File

@@ -148,8 +148,8 @@ android {
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdk = 23 minSdk = 23
targetSdk = flutter.targetSdkVersion targetSdk = flutter.targetSdkVersion
versionCode = 99 versionCode = 106
versionName = '1.5.99' versionName = '1.6.106'
multiDexEnabled =true multiDexEnabled =true
// manifestPlaceholders can be specified here if needed // manifestPlaceholders can be specified here if needed

BIN
assets/images/car3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

View File

@@ -41,11 +41,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>71</string> <string>77</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>4.3.71</string> <string>4.3.77</string>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>
<string></string> <string></string>
<key>FirebaseAppDelegateProxyEnabled</key> <key>FirebaseAppDelegateProxyEnabled</key>

View File

@@ -51,6 +51,7 @@ class AK {
X.r(X.r(X.r(Env.payMobApikey, cn), cC), cs); X.r(X.r(X.r(Env.payMobApikey, cn), cC), cs);
static final String integrationIdPayMobWallet = static final String integrationIdPayMobWallet =
X.r(X.r(X.r(Env.integrationIdPayMobWallet, cn), cC), cs); X.r(X.r(X.r(Env.integrationIdPayMobWallet, cn), cC), cs);
static final String apiKeyHere = Env.apiKeyHere;
static final String smsPasswordEgypt = static final String smsPasswordEgypt =
X.r(X.r(X.r(Env.smsPasswordEgypt, cn), cC), cs); X.r(X.r(X.r(Env.smsPasswordEgypt, cn), cC), cs);
static final String ocpApimSubscriptionKey = Env.ocpApimSubscriptionKey; static final String ocpApimSubscriptionKey = Env.ocpApimSubscriptionKey;

View File

@@ -24,6 +24,7 @@ class BoxName {
static const String agreeTerms = "agreeTerms"; static const String agreeTerms = "agreeTerms";
static const String addWork = 'addWork'; static const String addWork = 'addWork';
static const String addHome = 'addHome'; static const String addHome = 'addHome';
static const String placesDestination = 'placesDestination';
static const String tipPercentage = 'tipPercentage'; static const String tipPercentage = 'tipPercentage';
static const String accountIdStripeConnect = "accountIdStripeConnect"; static const String accountIdStripeConnect = "accountIdStripeConnect";
static const String faceDetectTimes = "faceDetectTimes"; static const String faceDetectTimes = "faceDetectTimes";

View File

@@ -14,6 +14,8 @@ class AppLink {
// static final String server = Env.serverPHP; // static final String server = Env.serverPHP;
static String googleMapsLink = 'https://maps.googleapis.com/maps/api/'; static String googleMapsLink = 'https://maps.googleapis.com/maps/api/';
static String searcMaps =
'https://autosuggest.search.hereapi.com/v1/autosuggest';
static String llama = 'https://api.llama-api.com/chat/completions'; static String llama = 'https://api.llama-api.com/chat/completions';
static String gemini = static String gemini =
'https://generativelanguage.googleapis.com/v1beta3/models/text-bison-001:generateText'; 'https://generativelanguage.googleapis.com/v1beta3/models/text-bison-001:generateText';
@@ -185,6 +187,8 @@ class AppLink {
// ===================================== // =====================================
static String addRateToPassenger = "$ride/rate/add.php"; static String addRateToPassenger = "$ride/rate/add.php";
static String savePlacesServer = "$ride/places/add.php";
static String getapiKey = "$ride/apiKey/get.php";
static String addRateToDriver = "$ride/rate/addRateToDriver.php"; static String addRateToDriver = "$ride/rate/addRateToDriver.php";
static String getDriverRate = "$ride/rate/getDriverRate.php"; static String getDriverRate = "$ride/rate/getDriverRate.php";
static String getPassengerRate = "$ride/rate/getPassengerRate.php"; static String getPassengerRate = "$ride/rate/getPassengerRate.php";
@@ -265,6 +269,8 @@ class AppLink {
static String getAccount = "$authCaptin/getAccount.php"; static String getAccount = "$authCaptin/getAccount.php";
static String updatePassengersInvitation = static String updatePassengersInvitation =
"$server/ride/invitor/updatePassengersInvitation.php"; "$server/ride/invitor/updatePassengersInvitation.php";
static String updateDriverInvitationDirectly =
"$server/ride/invitor/updateDriverInvitationDirectly.php";
//===================Admin Captin============ //===================Admin Captin============
static String getPassengerDetailsByPassengerID = static String getPassengerDetailsByPassengerID =

View File

@@ -5,35 +5,39 @@ import 'package:google_fonts/google_fonts.dart';
import 'colors.dart'; import 'colors.dart';
class AppStyle { class AppStyle {
static TextStyle headTitle = TextStyle( static TextStyle headTitle = const TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 40, fontSize: 40,
color: AppColor.accentColor, color: AppColor.accentColor,
fontFamily: box.read(BoxName.lang) == 'ar' // fontFamily: box.read(BoxName.lang) == 'ar'
// ?GoogleFonts.notoNaskhArabic().fontFamily // // ?GoogleFonts.notoNaskhArabic().fontFamily
? GoogleFonts.notoNaskhArabic().fontFamily // ? GoogleFonts.notoNaskhArabic().fontFamily
: GoogleFonts.roboto().fontFamily); // : GoogleFonts.roboto().fontFamily,
static TextStyle headTitle2 = TextStyle( );
fontWeight: FontWeight.bold, static TextStyle headTitle2 = const TextStyle(
fontSize: 26, fontWeight: FontWeight.bold,
color: AppColor.writeColor, fontSize: 22,
fontFamily: box.read(BoxName.lang) == 'ar' color: AppColor.writeColor,
? GoogleFonts.notoNaskhArabic().fontFamily // fontFamily: box.read(BoxName.lang) == 'ar'
: GoogleFonts.roboto().fontFamily); // ? GoogleFonts.notoNaskhArabic().fontFamily
// : GoogleFonts.roboto().fontFamily
);
static TextStyle title = TextStyle( static TextStyle title = TextStyle(
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: box.read(BoxName.lang) == 'ar' ? 14 : 16, fontSize: box.read(BoxName.lang) == 'ar' ? 14 : 16,
color: AppColor.writeColor, color: AppColor.writeColor,
fontFamily: box.read(BoxName.lang) == 'ar' // fontFamily: box.read(BoxName.lang) == 'ar'
? GoogleFonts.notoNaskhArabic().fontFamily // ? GoogleFonts.notoNaskhArabic().fontFamily
: GoogleFonts.roboto().fontFamily); // : GoogleFonts.roboto().fontFamily
static TextStyle subtitle = TextStyle( );
fontWeight: FontWeight.bold, static TextStyle subtitle = const TextStyle(
fontSize: 13, fontWeight: FontWeight.bold,
color: AppColor.writeColor, fontSize: 13,
fontFamily: box.read(BoxName.lang) == 'ar' color: AppColor.writeColor,
? GoogleFonts.notoNaskhArabic().fontFamily // fontFamily: box.read(BoxName.lang) == 'ar'
: GoogleFonts.roboto().fontFamily); // ? GoogleFonts.notoNaskhArabic().fontFamily
// : GoogleFonts.roboto().fontFamily
);
static TextStyle number = const TextStyle( static TextStyle number = const TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,

View File

@@ -166,7 +166,7 @@ class RegisterController extends GetxController {
await sendOtp(phoneNumber, randomNumber, isEgyptianNumber, await sendOtp(phoneNumber, randomNumber, isEgyptianNumber,
smsEgyptController); smsEgyptController);
} }
} else { } else if (phoneNumber.length > 9) {
sendOtp( sendOtp(
phoneNumber, randomNumber, isEgyptianNumber, smsEgyptController); phoneNumber, randomNumber, isEgyptianNumber, smsEgyptController);
} }
@@ -191,12 +191,57 @@ class RegisterController extends GetxController {
SmsEgyptController controller) async { SmsEgyptController controller) async {
// Trim any leading or trailing whitespace from the phone number // Trim any leading or trailing whitespace from the phone number
phoneNumber = phoneNumber.trim(); phoneNumber = phoneNumber.trim();
await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: { var dd = await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: {
'phone_number': phoneNumber, 'phone_number': phoneNumber,
'token': otp.toString(), 'token': otp.toString(),
}); });
Log.print('dd: ${dd}');
if (isEgyptian) { if (isEgyptian) {
await controller.sendSmsEgypt(phoneNumber, otp.toString()); await CRUD().post(link: AppLink.updatePhoneInvalidSMSPassenger, payload: {
"phone_number": Get.find<RegisterController>().phoneController.text
});
box.write(BoxName.phoneDriver, phoneController.text);
var nameParts = box.read(BoxName.name).toString().split(' ');
var firstName = nameParts.isNotEmpty ? nameParts[0] : 'unknown';
var lastName = nameParts.length > 1 ? nameParts[1] : 'unknown';
var payload = {
'id': box.read(BoxName.passengerID),
'phone': phoneController.text,
'email': box.read(BoxName.email),
'password': 'unknown',
'gender': 'unknown',
'birthdate': '2002-01-01',
'site': box.read(BoxName.passengerPhotoUrl) ?? 'unknown',
'first_name': firstName,
'last_name': lastName,
};
var res1 = await CRUD().post(
link: AppLink.signUp,
payload: payload,
);
if (res1 != 'failure') {
await CRUD().post(
link: '${AppLink.seferAlexandriaServer}/auth/signup.php',
payload: payload,
);
await CRUD().post(
link: '${AppLink.seferGizaServer}/auth/signup.php',
payload: payload,
);
box.write(BoxName.isVerified, '1');
box.write(BoxName.isFirstTime, '0');
box.write(BoxName.phone, phoneController.text);
Get.put(LoginController()).loginUsingCredentials(
box.read(BoxName.passengerID).toString(),
box.read(BoxName.email).toString(),
);
}
// await controller.sendSmsEgypt(phoneNumber, otp.toString());
} else { } else {
await CRUD().sendWhatsAppAuth(phoneNumber, otp.toString()); await CRUD().sendWhatsAppAuth(phoneNumber, otp.toString());
} }

View File

@@ -214,7 +214,7 @@ class FirebaseMessagesController extends GetxController {
driverArrivePassengerDialoge(); driverArrivePassengerDialoge();
update(); update();
} else if (message.notification!.title! == "Cancel Trip from driver".tr) { } else if (message.notification!.title! == "Cancel Trip from driver") {
Get.back(); Get.back();
if (Platform.isAndroid) { if (Platform.isAndroid) {
notificationController.showNotification("Cancel Trip from driver".tr, notificationController.showNotification("Cancel Trip from driver".tr,
@@ -243,7 +243,7 @@ class FirebaseMessagesController extends GetxController {
// .searchNewDriverAfterRejectingFromDriver(); // .searchNewDriverAfterRejectingFromDriver();
); );
} else if (message.notification!.title! == 'Driver Finish Trip'.tr) { } else if (message.notification!.title! == 'Driver Finish Trip'.tr) {
var myListString = message.data['passengerList']; var myListString = message.data['DriverList'];
var driverList = jsonDecode(myListString) as List<dynamic>; var driverList = jsonDecode(myListString) as List<dynamic>;
if (Platform.isAndroid) { if (Platform.isAndroid) {
notificationController.showNotification( notificationController.showNotification(
@@ -262,6 +262,11 @@ class FirebaseMessagesController extends GetxController {
'rideId': driverList[1].toString(), 'rideId': driverList[1].toString(),
'price': driverList[3].toString() 'price': driverList[3].toString()
}); });
notificationController.showNotification(
'Dont forget your personal belongings.'.tr,
'Please make sure you have all your personal belongings and that any remaining fare, if applicable, has been added to your wallet before leaving. Thank you for choosing the Sefer app'
.tr,
'ding');
// } // }
} else if (message.notification!.title! == "Finish Monitor".tr) { } else if (message.notification!.title! == "Finish Monitor".tr) {
Get.defaultDialog( Get.defaultDialog(

View File

@@ -99,7 +99,7 @@ class NotificationController extends GetxController {
for (int day = 0; day < 7; day++) { for (int day = 0; day < 7; day++) {
// Schedule for 8:00 AM // Schedule for 8:00 AM
await _scheduleNotificationForTime( await _scheduleNotificationForTime(
day, 8, 0, title, message, details, day * 1000 + 1); // Unique ID day, 8, 0, title, message, details, day * 1000 + 1);
// Schedule for 3:00 PM // Schedule for 3:00 PM
await _scheduleNotificationForTime( await _scheduleNotificationForTime(

View File

@@ -509,6 +509,26 @@ class CRUD {
return (jsonData['status']); return (jsonData['status']);
} }
Future<dynamic> getHereMap({
required String link,
}) async {
var url = Uri.parse(link);
try {
var response = await http.get(url);
if (response.statusCode == 200) {
// Ensure the response body is decoded as UTF-8
var decodedBody = utf8.decode(response.bodyBytes);
var data = jsonDecode(decodedBody);
return data;
} else {
return null;
}
} catch (e) {
return null;
}
}
Future<dynamic> update({ Future<dynamic> update({
required String endpoint, required String endpoint,
required Map<String, dynamic> data, required Map<String, dynamic> data,

View File

@@ -11,6 +11,7 @@ import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import '../../print.dart';
import '../auth/register_controller.dart'; import '../auth/register_controller.dart';
import 'crud.dart'; import 'crud.dart';

File diff suppressed because it is too large Load Diff

View File

@@ -58,15 +58,15 @@ class VipOrderController extends GetxController {
tripData.value = decodedResponse['message']; tripData.value = decodedResponse['message'];
} else { } else {
tripData.clear(); // Ensure empty list if no data tripData.clear(); // Ensure empty list if no data
mySnackeBarError('No trip data found'); // mySnackeBarError('No trip data found');
} }
} else { } else {
tripData.clear(); tripData.clear();
mySnackeBarError('Failed to fetch trip data'); // mySnackeBarError('Failed to fetch trip data');
} }
} catch (e) { } catch (e) {
tripData.clear(); tripData.clear();
mySnackeBarError('An error occurred: $e'); // mySnackeBarError('An error occurred: $e');
} finally { } finally {
isLoading.value = false; isLoading.value = false;
} }

View File

@@ -4,6 +4,13 @@ class MyTranslation extends Translations {
@override @override
Map<String, Map<String, String>> get keys => { Map<String, Map<String, String>> get keys => {
"ar": { "ar": {
"Home Page": "الصفحة الرئيسية",
"To change Language the App": "لتغيير لغة التطبيق",
"Learn more about our app and mission":
"تعرف على المزيد حول تطبيقنا ورسالتنا",
"Promos For Today": "عروض اليوم",
'Bonus gift': 'بونص', "Pay": "ادفع",
"Get": "احصل على",
"Send to Driver Again": "إرسال إلى السائق مرة أخرى", "Send to Driver Again": "إرسال إلى السائق مرة أخرى",
"Driver Name:": "اسم السائق:", "Driver Name:": "اسم السائق:",
'No trip data available': "لا توجد بيانات رحلة متاحة", 'No trip data available': "لا توجد بيانات رحلة متاحة",
@@ -79,6 +86,7 @@ class MyTranslation extends Translations {
"Pick from map destination": "حدد وجهتك على الخريطة", "Pick from map destination": "حدد وجهتك على الخريطة",
"Pick or Tap to confirm": "حدد أو انقر للتأكيد", "Pick or Tap to confirm": "حدد أو انقر للتأكيد",
"Select Order Type": "حدد نوع الطلب", "Select Order Type": "حدد نوع الطلب",
'Accepted your order': "تم قبول طلبك",
"Choose who this order is for": "اختر لمن هذا الطلب", "Choose who this order is for": "اختر لمن هذا الطلب",
"Order Accepted": "تم قبول الطلب", "with type": "مع النوع", "Order Accepted": "تم قبول الطلب", "with type": "مع النوع",
"accepted your order at price": "قبل طلبك بالسعر", "accepted your order at price": "قبل طلبك بالسعر",
@@ -473,7 +481,7 @@ iOS [https://getapp.cc/app/6458734951]
"Go to this Target": "الانْتِقَال إِلَى هَذَا الهَدَف", "Go to this Target": "الانْتِقَال إِلَى هَذَا الهَدَف",
"My Profile": "مَلَفِي الشَّخْصِي", "My Profile": "مَلَفِي الشَّخْصِي",
"Sign Out": "تَسْجِيل الخُرُوج", "Sign Out": "تَسْجِيل الخُرُوج",
"Home Page": "الصَّفْحَة الرَّئِيسِيَّة",
"Are you want to go to this site": "Are you want to go to this site":
"هَل تَرْغَب فِي الانْتِقَال إِلَى هَذَا المَوْقِع", "هَل تَرْغَب فِي الانْتِقَال إِلَى هَذَا المَوْقِع",
"MyLocation": "مَوْقِعِي", "MyLocation": "مَوْقِعِي",
@@ -550,11 +558,11 @@ iOS [https://getapp.cc/app/6458734951]
"Bachelor's Degree": "بَكَالُورِيُوس", "Bachelor's Degree": "بَكَالُورِيُوس",
"Master's Degree": "مَاجِسْتِير", "Master's Degree": "مَاجِسْتِير",
"Doctoral Degree": "دُكْتُورَاه", "Doctoral Degree": "دُكْتُورَاه",
"Promos For today": "الْعُرُوض التَّرْوِيجِيَّة لِلْيَوْم",
"Copy this Promo to use it in your Ride!": "Copy this Promo to use it in your Ride!":
"انْسَخْ هَذَا الْعَرْض لِاسْتِخْدَامِهِ فِي رِحْلَتِك!", "انْسَخْ هَذَا الْعَرْض لِاسْتِخْدَامِهِ فِي رِحْلَتِك!",
"To change some Settings": "لِتَغْيِير بَعْض الإِعْدَادَات", "To change some Settings": "لِتَغْيِير بَعْض الإِعْدَادَات",
"To change Language the App": "لِتَغْيِير لُغَة التَّطْبِيق",
"Order Request Page": "صَفْحَة طَلَب الطَّلَب", "Order Request Page": "صَفْحَة طَلَب الطَّلَب",
"Rouats of Trip": "طُرُق الرِّحْلَة", "Rouats of Trip": "طُرُق الرِّحْلَة",
"Passenger Name is ": "اسْم الرَّاكِب هُوَ ", "Passenger Name is ": "اسْم الرَّاكِب هُوَ ",
@@ -607,6 +615,24 @@ iOS [https://getapp.cc/app/6458734951]
"Do you want to pay Tips for this Driver": "Do you want to pay Tips for this Driver":
"هَل تُرِيد دَفْع أُكْرَامِيَّة لِهَذَا السَّائِق؟", "هَل تُرِيد دَفْع أُكْرَامِيَّة لِهَذَا السَّائِق؟",
"Tip is ": " مَبْلَغ الأُكْرَامِيَّة هُوَ", "Tip is ": " مَبْلَغ الأُكْرَامِيَّة هُوَ",
"Are you sure to delete this location?":
"هل أنت متأكد من حذف هذا الموقع؟",
"deleted": "تم الحذف",
'Trip is begin': "الرحلة قد بدأت",
'This price is fixed even if the route changes for the driver.':
"هذا السعر مثبت حتى لو تغير المسار للسائق",
'The price may increase if the route changes.':
"احتمالية زيادة السعر عند تغيير المسار",
"The captain is responsible for the route.":
"الكابتن مسؤول عن المسار",
"يمكنك الاتصال أو تسجيل صوت لهذه الرحلة":
"You can call or record audio of this trip",
'The trip has started! Feel free to contact emergency numbers, share your trip, or activate voice recording for the journey':
"بدأت الرحلة! لا تتردد في الاتصال بأرقام الطوارئ، مشاركة رحلتك، أو تفعيل التسجيل الصوتي للرحلة",
'Please make sure you have all your personal belongings and that any remaining fare, if applicable, has been added to your wallet before leaving. Thank you for choosing the Sefer app':
'الرجاء التأكد من جميع أغراضك الشخصية وأنه تم إضافة باقي الأجرة إن وجد إلى محفظتك قبل النزول. شكرا لاختيارك تطبيق سفر',
'Dont forget your personal belongings.': "لا تنسى متعلقاتك الشخصية",
"Tip is": " مَبْلَغ الأُكْرَامِيَّة هُوَ", "Tip is": " مَبْلَغ الأُكْرَامِيَّة هُوَ",
"Camera Access Denied.": "تَمَّ رَفْض الْوُصُول إِلَى الْكَامِيرَا.", "Camera Access Denied.": "تَمَّ رَفْض الْوُصُول إِلَى الْكَامِيرَا.",
"Open Settings": "افْتَحْ الإِعْدَادَات", "Open Settings": "افْتَحْ الإِعْدَادَات",

View File

@@ -700,8 +700,9 @@ class PaymentController extends GetxController {
); );
// Log.print('response.message!: ${response!.responseCode!}'); // Log.print('response.message!: ${response!.responseCode!}');
// if (response!.success == true && response.responseCode == '200') { // if (response!.success == true && response.responseCode == '200') {
if (response!.responseCode.toString() == '200' &&
response.success == true) { if (response!.success == true &&
response!.message.toString() == 'Approved') {
// Log.print('transactionID wewer: ${response.transactionID}'); // Log.print('transactionID wewer: ${response.transactionID}');
Toast.show(context, 'Payment Successful'.tr, AppColor.greenColor); Toast.show(context, 'Payment Successful'.tr, AppColor.greenColor);
method(); method();

View File

@@ -81,34 +81,28 @@ class RateController extends GetxController {
} }
} }
await CRUD().post( await CRUD().post(
link: "${AppLink.seferCairoServer}/rate/addRateToDriver.php", link: "${AppLink.seferCairoServer}/ride/rate/addRateToDriver.php",
payload: { payload: {
'passenger_id': box.read(BoxName.passengerID).toString(), 'passenger_id': box.read(BoxName.passengerID).toString(),
'driver_id': driverId, 'driver_id': driverId.toString(),
'ride_id': rideId, 'ride_id': rideId.toString(),
'rating': selectedRateItemId.toString(), 'rating': selectedRateItemId.toString(),
'comment': comment.text, 'comment': comment.text,
}).then((value) { });
if (AppLink.endPoint != AppLink.seferCairoServer) {
CRUD().post( CRUD().post(
link: "${AppLink.seferAlexandriaServer}/rate/addRateToDriver.php", link: "${AppLink.endPoint}/ride/rate/addRateToDriver.php",
payload: { payload: {
'passenger_id': box.read(BoxName.passengerID).toString(), 'passenger_id': box.read(BoxName.passengerID).toString(),
'driver_id': driverId, 'driver_id': driverId.toString(),
'ride_id': rideId, 'ride_id': rideId.toString(),
'rating': selectedRateItemId.toString(), 'rating': selectedRateItemId.toString(),
'comment': comment.text, 'comment': comment.text,
}); });
CRUD().post( }
link: "${AppLink.seferGizaServer}/rate/addRateToDriver.php",
payload: { Get.find<MapPassengerController>().restCounter();
'passenger_id': box.read(BoxName.passengerID).toString(), Get.offAll(const MapPagePassenger());
'driver_id': driverId,
'ride_id': rideId,
'rating': selectedRateItemId.toString(),
'comment': comment.text,
});
Get.find<MapPassengerController>().restCounter();
Get.offAll(const MapPagePassenger());
});
} }
} }

View File

@@ -37,18 +37,21 @@ class DbSql {
latitude REAL, latitude REAL,
longitude REAL, longitude REAL,
name TEXT UNIQUE, name TEXT UNIQUE,
rate TEXT rate TEXT,
createdAt TEXT
) )
'''); ''');
await db.execute('DROP TABLE IF EXISTS ${TableName.recentLocations}');
await db.execute(''' await db.execute('''
CREATE TABLE IF NOT EXISTS ${TableName.recentLocations}( CREATE TABLE ${TableName.recentLocations}(
id INTEGER PRIMARY KEY AUTOINCREMENT, id INTEGER PRIMARY KEY AUTOINCREMENT,
latitude REAL, latitude REAL,
longitude REAL, longitude REAL,
name TEXT , name TEXT,
rate TEXT rate TEXT,
) createdAt TEXT
'''); )
''');
await db.execute(''' await db.execute('''
CREATE TABLE IF NOT EXISTS ${TableName.driverOrdersRefuse}( CREATE TABLE IF NOT EXISTS ${TableName.driverOrdersRefuse}(
id INTEGER PRIMARY KEY AUTOINCREMENT, id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -97,6 +100,34 @@ class DbSql {
return await db.insert(table, map); return await db.insert(table, map);
} }
Future<int> insertMapLocation(Map<String, dynamic> map, String table) async {
Database db = await instance.database;
// Check if the record already exists (based on latitude, longitude, and name)
var existing = await db.query(
table,
where: 'latitude = ? AND longitude = ? AND name = ?',
whereArgs: [map['latitude'], map['longitude'], map['name']],
);
if (existing.isNotEmpty) {
// If record exists, update the createdAt field with the current timestamp
var updatedMap = Map<String, dynamic>.from(map);
updatedMap['createdAt'] =
DateTime.now().toIso8601String(); // Update timestamp
return await db.update(
table,
updatedMap,
where: 'id = ?',
whereArgs: [existing.first['id']], // Update the existing row
);
} else {
// If record doesn't exist, insert new record with the current timestamp
map['createdAt'] = DateTime.now().toIso8601String();
return await db.insert(table, map);
}
}
Future<int> updateData(Map<String, dynamic> map, String table, int id) async { Future<int> updateData(Map<String, dynamic> map, String table, int id) async {
Database db = await instance.database; Database db = await instance.database;

View File

@@ -40,7 +40,7 @@ class RateDriverFromPassenger extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
Text( Text(
'${'Total price to '.tr}${Get.find<MapPassengerController>().firstName}', '${'Total price to '.tr}${Get.find<MapPassengerController>().driverName}',
style: AppStyle.title, style: AppStyle.title,
), ),
Row( Row(

View File

@@ -12,6 +12,7 @@ import 'package:SEFER/constant/style.dart';
import 'package:SEFER/main.dart'; import 'package:SEFER/main.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart'; import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:SEFER/views/widgets/my_scafold.dart'; import 'package:SEFER/views/widgets/my_scafold.dart';
import 'package:permission_handler/permission_handler.dart';
import '../../constant/info.dart'; import '../../constant/info.dart';
import '../../controller/auth/apple_signin_controller.dart'; import '../../controller/auth/apple_signin_controller.dart';
@@ -456,6 +457,16 @@ class LoginPage extends StatelessWidget {
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: AppStyle.title, style: AppStyle.title,
), ),
TextButton(
onPressed: () {
// Optionally, navigate to app settings for manual permission control
openAppSettings();
},
child: Text(
"Open Settings".tr,
style: const TextStyle(color: AppColor.blueColor),
),
),
MyElevatedButton( MyElevatedButton(
title: 'Next'.tr, title: 'Next'.tr,
onPressed: () async { onPressed: () async {

View File

@@ -23,9 +23,9 @@ class ContactUsPage extends StatelessWidget {
body: [ body: [
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: ListView(
crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Container( Container(
decoration: AppStyle.boxDecoration1, decoration: AppStyle.boxDecoration1,

View File

@@ -1,10 +1,8 @@
import 'package:SEFER/controller/home/home_page_controller.dart'; import 'package:SEFER/controller/home/home_page_controller.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:SEFER/constant/colors.dart';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/views/lang/languages.dart'; import 'package:SEFER/views/lang/languages.dart';
import 'package:SEFER/views/widgets/my_scafold.dart';
import 'HomePage/about_page.dart'; import 'HomePage/about_page.dart';
import 'HomePage/frequentlyQuestionsPage.dart'; import 'HomePage/frequentlyQuestionsPage.dart';
@@ -18,121 +16,108 @@ class HomePage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Get.put(HomePageController()); Get.put(HomePageController());
return MyScafolld( return CupertinoPageScaffold(
isleading: true, navigationBar: CupertinoNavigationBar(
title: 'Home Page'.tr, middle: Text('Home Page'.tr),
body: [ leading: CupertinoButton(
ListView( padding: EdgeInsets.zero,
child: const Icon(CupertinoIcons.back),
onPressed: () {
Navigator.pop(context);
},
),
),
child: SafeArea(
child: ListView(
children: [ children: [
ListTile( CupertinoListTile(
onTap: () { onTap: () {
Get.to(() => const Language()); Get.to(() => const Language());
}, },
title: Text( leading: const Icon(CupertinoIcons.globe,
'Language'.tr, color: CupertinoColors.activeBlue),
style: AppStyle.headTitle2, title: Text('Language'.tr),
), subtitle: Text('To change Language the App'.tr),
subtitle: Text( trailing: const CupertinoListTileChevron(),
'To change Language the App'.tr,
style: AppStyle.title,
),
trailing: const Icon(
Icons.arrow_forward_ios,
size: 30,
color: AppColor.primaryColor,
),
leading: const Icon(
Icons.language_sharp,
color: AppColor.primaryColor,
),
), ),
ListTile( CupertinoListTile(
leading: const Icon(Icons.location_city_outlined), onTap: () {
title: Text( Get.to(CupertinoPageScaffold(
'Change Country'.tr, navigationBar: CupertinoNavigationBar(
style: AppStyle.headTitle2, middle: Text('Change Country'.tr),
),
subtitle: Text(
'You can change the Country to get all features'.tr,
style: AppStyle.title,
),
onTap: () => Get.to(MyScafolld(
title: 'Change Country'.tr,
body: [CountryPickerFromSetting()],
isleading: true)),
),
ListTile(
leading: const Icon(Icons.question_answer),
title: Text(
'Frequently Questions'.tr,
style: AppStyle.headTitle2,
),
subtitle: Text(
'You can change the Country to get all features'.tr,
style: AppStyle.title,
),
onTap: () => Get.to(() => const FrequentlyQuestionsPage()),
),
ListTile(
leading: const Icon(Icons.vibration),
title: GetBuilder<HomePageController>(builder: (controller) {
return SwitchListTile(
title: Text(
'Vibration'.tr,
style: AppStyle.headTitle2,
), ),
value: controller.isVibrate, child: SafeArea(
onChanged: controller.changeVibrateOption, child: CountryPickerFromSetting(),
activeColor: AppColor.primaryColor, ),
); ));
}), },
subtitle: Text( leading: const Icon(CupertinoIcons.location,
"You can change the vibration feedback for all buttons".tr, color: CupertinoColors.activeBlue),
style: AppStyle.title, title: Text('Change Country'.tr),
), subtitle:
onTap: () => Get.to(() => const FrequentlyQuestionsPage()), Text('You can change the Country to get all features'.tr),
trailing: const CupertinoListTileChevron(),
), ),
ListTile( CupertinoListTile(
leading: const Icon(Icons.record_voice_over_outlined), onTap: () {
title: Text( Get.to(() => const FrequentlyQuestionsPage());
'Trips recorded'.tr, },
style: AppStyle.headTitle2, leading: const Icon(CupertinoIcons.question,
), color: CupertinoColors.activeBlue),
subtitle: Text( title: Text('Frequently Questions'.tr),
'Here recorded trips audio'.tr, subtitle: Text('Find answers to common questions'.tr),
style: AppStyle.title, trailing: const CupertinoListTileChevron(),
),
onTap: () async {
Get.to(() => TripsRecordedPage());
}),
ListTile(
leading: const Icon(Icons.account_balance_outlined),
title: Text(
'About Us'.tr,
style: AppStyle.headTitle2,
),
subtitle: Text(
'You can change the Country to get all features'.tr,
style: AppStyle.title,
),
onTap: () => Get.to(() => const AboutPage()),
), ),
ListTile( CupertinoListTile(
leading: const Icon(Icons.share), leading: const Icon(Icons.vibration,
title: Text( color: CupertinoColors.activeBlue),
'Share App'.tr, title: Text('Vibration'.tr),
style: AppStyle.headTitle2, trailing: GetBuilder<HomePageController>(
builder: (controller) {
return CupertinoSwitch(
value: controller.isVibrate,
onChanged: controller.changeVibrateOption,
);
},
), ),
subtitle: Text( subtitle: Text(
'You can share the SEFER App with your friends and earn rewards for rides they take using your code' 'You can change the vibration feedback for all buttons'.tr),
.tr, ),
style: AppStyle.title, CupertinoListTile(
), onTap: () {
onTap: () => Get.to(() => ShareAppPage()), Get.to(() => const TripsRecordedPage());
},
leading: const Icon(CupertinoIcons.mic_circle,
color: CupertinoColors.activeBlue),
title: Text('Trips recorded'.tr),
subtitle: Text('Here recorded trips audio'.tr),
trailing: const CupertinoListTileChevron(),
),
CupertinoListTile(
onTap: () {
Get.to(() => const AboutPage());
},
leading: const Icon(CupertinoIcons.info_circle,
color: CupertinoColors.activeBlue),
title: Text('About Us'.tr),
subtitle: Text('Learn more about our app and mission'.tr),
trailing: const CupertinoListTileChevron(),
),
CupertinoListTile(
onTap: () {
Get.to(() => ShareAppPage());
},
leading: const Icon(CupertinoIcons.share,
color: CupertinoColors.activeBlue),
title: Text('Share App'.tr),
subtitle: Text(
'You can share the SEFER App with your friends and earn rewards for rides they take using your code'
.tr),
trailing: const CupertinoListTileChevron(),
), ),
], ],
), ),
], ),
); );
} }
} }

View File

@@ -66,6 +66,7 @@ class MapPagePassenger extends StatelessWidget {
const RideBeginPassenger(), const RideBeginPassenger(),
const VipRideBeginPassenger(), const VipRideBeginPassenger(),
const RideFromStartApp(), const RideFromStartApp(),
cancelRidePage(), cancelRidePage(),
const MenuIconMapPageWidget(), const MenuIconMapPageWidget(),
PointsPageForRider() PointsPageForRider()
@@ -85,7 +86,7 @@ class CancelRidePageShow extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GetBuilder<MapPassengerController>( return GetBuilder<MapPassengerController>(
builder: (controller) => builder: (controller) =>
(controller.data.isNotEmpty && controller.remainingTime > 0) (controller.data.isNotEmpty && controller.statusRide != 'Begin')
// || // ||
// controller.timeToPassengerFromDriverAfterApplied == 0 // controller.timeToPassengerFromDriverAfterApplied == 0
? Positioned( ? Positioned(

View File

@@ -17,6 +17,21 @@ class ApplyOrderWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Color _parseColor(String colorHex) {
if (colorHex.isEmpty) {
return Colors.grey; // Fallback for empty color
}
// Ensure the string starts with '0xff' for ARGB format
String processedHex = colorHex.replaceFirst('#', '0xff').trim();
if (!processedHex.startsWith('0xff')) {
processedHex = '0xff$processedHex'; // Add '0xff' if missing
}
return Color(int.parse(processedHex));
}
return GetBuilder<MapPassengerController>(builder: (controller) { return GetBuilder<MapPassengerController>(builder: (controller) {
if (controller.statusRide == 'Apply' && if (controller.statusRide == 'Apply' &&
controller.isSearchingWindow == false) { controller.isSearchingWindow == false) {
@@ -108,36 +123,43 @@ class ApplyOrderWidget extends StatelessWidget {
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Image.asset( // ColorFiltered(
box.read(BoxName.carType) == 'Comfort' // colorFilter: ColorFilter.mode(
? 'assets/images/blob.png' // _parseColor(controller.colorHex),
: box.read(BoxName.carType) == 'Lady' // BlendMode.srcIn,
? 'assets/images/lady.png' // Assuming there's an image for Lady // ),
: box.read(BoxName.carType) == 'Speed' // child: Image.asset(
? 'assets/images/carspeed.png' // box.read(BoxName.carType) == 'Comfort'
: box.read(BoxName.carType) == // ? 'assets/images/blob.png'
'Scooter' // : box.read(BoxName.carType) == 'Lady'
? 'assets/images/moto.png' // ? 'assets/images/lady.png' // Assuming there's an image for Lady
: box.read(BoxName.carType) == // : box.read(BoxName.carType) == 'Speed'
'Mishwar Vip' // ? 'assets/images/carspeed.png'
? 'assets/images/freeRide.png' // : box.read(BoxName.carType) ==
: box.read(BoxName // 'Scooter'
.carType) == // ? 'assets/images/moto.png'
'Awfar Car' // : box.read(BoxName.carType) ==
? 'assets/images/balash.png' // 'Mishwar Vip'
: box.read(BoxName // ? 'assets/images/freeRide.png'
.carType) == // : box.read(BoxName
'Pink Bike' // .carType) ==
? 'assets/images/pinkBike.png' // 'Awfar Car'
: box.read(BoxName // ? 'assets/images/balash.png'
.carType) == // : box.read(BoxName
'Rayeh Gai' // .carType) ==
? 'assets/images/roundtrip.png' // 'Pink Bike'
: 'assets/images/carspeed.png', // Default image if none of the above // ? 'assets/images/pinkBike.png'
width: 80, // : box.read(BoxName
), // .carType) ==
// 'Rayeh Gai'
// ? 'assets/images/roundtrip.png'
// : 'assets/images/carspeed.png', // Default image if none of the above
// width: 80,
// ),
// ),
Column( Column(
children: [ children: [
Text( Text(
@@ -152,14 +174,31 @@ class ApplyOrderWidget extends StatelessWidget {
), ),
], ],
), ),
const SizedBox(
width: 10,
),
Text( Text(
// 'Black', // 'Black',
controller.carColor, controller.carColor.toString(),
style: AppStyle.title, style: AppStyle.title,
), ),
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
ColorFiltered(
colorFilter: ColorFilter.mode(
_parseColor(controller.colorHex),
BlendMode.srcIn,
),
child: Image.asset(
box.read(BoxName.carType) == 'Scooter' ||
box.read(BoxName.carType) ==
'Pink Bike'
? 'assets/images/moto.png'
: 'assets/images/car3.png',
width: 80,
),
),
], ],
), ),
Padding( Padding(
@@ -218,7 +257,7 @@ class ApplyOrderWidget extends StatelessWidget {
children: [ children: [
Text( Text(
// 'fadi ahmad', // 'fadi ahmad',
controller.firstName, controller.driverName,
style: AppStyle.title, style: AppStyle.title,
), ),
Text( Text(

View File

@@ -242,109 +242,127 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
// ) // )
// : const SizedBox(), // : const SizedBox(),
Container( Container(
height: controller.placesDestination.isNotEmpty height: controller.placesDestination.isNotEmpty
? controller.height ? controller.height
: 0, : 0,
color: AppColor.secondaryColor, color: AppColor.secondaryColor,
child: ListView.builder( child: ListView.builder(
itemCount: controller.placesDestination.length, itemCount: controller.placesDestination.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
var res = controller.placesDestination[index]; var res = controller.placesDestination[index];
return InkWell(
onTap: () async {
controller.changeHeightPlaces();
await sql.insertData({
'latitude': res['geometry']['location']['lat'],
'longitude': res['geometry']['location']['lng'],
'name': res['name'].toString(),
'rate': res['rating'].toString(),
}, TableName.recentLocations);
controller.changeHeightPlaces(); // Extract fields with null safety
var title = res['title']?.toString() ?? 'Unknown Place';
var position = res['position'];
var latitude = position?['lat'];
var longitude = position?['lng'];
var address =
res['address']?['label'] ?? 'Unknown Address';
var categories = res['categories'] ?? [];
var primaryCategory = categories.isNotEmpty
? categories[0]['name']
: 'Unknown Category';
controller.passengerLocation = controller.newMyLocation; return InkWell(
controller.myDestination = LatLng( onTap: () async {
double.parse( if (latitude != null && longitude != null) {
res['geometry']['location']['lat'].toString()), sql.insertMapLocation({
double.parse( 'latitude': latitude,
res['geometry']['location']['lng'].toString()), 'longitude': longitude,
); 'name': title,
controller.convertHintTextDestinationNewPlaces(index); 'rate': 'N/A',
'createdAt': DateTime.now().toIso8601String(),
// No rating in this structure, adjust as needed
}, TableName.recentLocations);
controller.placesDestination = []; controller.passengerLocation =
controller.placeDestinationController.clear(); controller.newMyLocation;
controller.changeMainBottomMenuMap(); controller.myDestination =
controller.passengerStartLocationFromMap = true; LatLng(latitude, longitude);
controller.isPickerShown = true; controller
}, .convertHintTextDestinationNewPlaces(index);
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10), controller.placesDestination = [];
child: Column( controller.placeDestinationController.clear();
children: [ controller.changeMainBottomMenuMap();
Row( controller.passengerStartLocationFromMap = true;
mainAxisAlignment: MainAxisAlignment.spaceBetween, controller.isPickerShown = true;
children: [ } else {
Column( Toast.show(
children: [ context,
Image.network( 'Invalid location data',
res['icon'], AppColor.redColor,
width: 20, );
}
},
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Column(
children: [
const Icon(Icons.place,
size: 20), // Fallback icon for places
IconButton(
onPressed: () async {
if (latitude != null &&
longitude != null) {
await sql.insertMapLocation({
'latitude': latitude,
'longitude': longitude,
'name': title,
'rate': 'N/A',
}, TableName.placesFavorite);
Toast.show(
context,
'$title ${'Saved Successfully'.tr}',
AppColor.primaryColor,
);
} else {
Toast.show(
context,
'Invalid location data',
AppColor.redColor,
);
}
},
icon: const Icon(Icons.favorite_border),
),
],
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
title,
style: AppStyle.title,
),
Text(
address,
style: AppStyle.subtitle,
),
Text(
primaryCategory,
style: AppStyle.subtitle,
),
],
), ),
IconButton( ),
onPressed: () async { ],
await sql.insertData({ ),
'latitude': res['geometry'] const Divider(thickness: 1),
['location']['lat'], ],
'longitude': res['geometry'] ),
['location']['lng'],
'name': res['name'].toString(),
'rate': res['rating'].toString(),
}, TableName.placesFavorite);
Toast.show(
context,
'${res['name']} ${'Saved Sucssefully'.tr}',
AppColor.primaryColor);
},
icon: const Icon(Icons.favorite_border),
),
],
),
Column(
children: [
Text(
res['name'].toString(),
style: AppStyle.title,
),
Text(
res['vicinity'].toString(),
style: AppStyle.subtitle,
),
],
),
Column(
children: [
Text(
'rate',
style: AppStyle.subtitle,
),
Text(
res['rating'].toString(),
style: AppStyle.subtitle,
),
],
),
],
),
const Divider(
thickness: 1,
)
],
), ),
), );
); },
}, ))
),
)
], ],
)); ));
} }

View File

@@ -103,7 +103,7 @@ GetBuilder<MapPassengerController> formSearchPlacesStart() {
// controller.myLocation = // controller.myLocation =
// controller.newStartPointLocation; // controller.newStartPointLocation;
// } // }
await sql.insertData({ await sql.insertMapLocation({
'latitude': res['geometry']['location']['lat'], 'latitude': res['geometry']['location']['lat'],
'longitude': res['geometry']['location']['lng'], 'longitude': res['geometry']['location']['lng'],
'name': res['name'].toString(), 'name': res['name'].toString(),
@@ -130,7 +130,7 @@ GetBuilder<MapPassengerController> formSearchPlacesStart() {
), ),
IconButton( IconButton(
onPressed: () async { onPressed: () async {
await sql.insertData({ await sql.insertMapLocation({
'latitude': res['geometry'] 'latitude': res['geometry']
['location']['lat'], ['location']['lat'],
'longitude': res['geometry'] 'longitude': res['geometry']

View File

@@ -109,7 +109,7 @@ GetBuilder<MapPassengerController> formSearchPlaces(int index) {
), ),
IconButton( IconButton(
onPressed: () async { onPressed: () async {
await sql.insertData({ await sql.insertMapLocation({
'latitude': res['geometry'] 'latitude': res['geometry']
['location']['lat'], ['location']['lat'],
'longitude': res['geometry'] 'longitude': res['geometry']

View File

@@ -8,7 +8,7 @@ import '../../../controller/home/map_passenger_controller.dart';
import '../../../controller/home/vip_waitting_page.dart'; import '../../../controller/home/vip_waitting_page.dart';
GetBuilder<MapPassengerController> leftMainMenuIcons() { GetBuilder<MapPassengerController> leftMainMenuIcons() {
final textToSpeechController = Get.put(TextToSpeechController()); Get.put(TextToSpeechController());
return GetBuilder<MapPassengerController>( return GetBuilder<MapPassengerController>(
builder: (controller) => Positioned( builder: (controller) => Positioned(
top: Get.height * .008, top: Get.height * .008,
@@ -108,7 +108,9 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
// borderRadius: BorderRadius.circular(15)), // borderRadius: BorderRadius.circular(15)),
// child: IconButton( // child: IconButton(
// onPressed: () async { // onPressed: () async {
// print(Get.put(MapPassengerController()).data); // controller.statusRide == 'Apply' &&
// controller.isSearchingWindow == false;
// controller.update();
// }, // },
// icon: const Icon( // icon: const Icon(
// Octicons // Octicons

View File

@@ -1,4 +1,6 @@
import 'package:SEFER/views/widgets/my_dialog.dart';
import 'package:SEFER/views/widgets/my_textField.dart'; import 'package:SEFER/views/widgets/my_textField.dart';
import 'package:SEFER/views/widgets/mysnakbar.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@@ -14,6 +16,7 @@ import '../../../constant/colors.dart';
import '../../../constant/table_names.dart'; import '../../../constant/table_names.dart';
import '../../../controller/functions/toast.dart'; import '../../../controller/functions/toast.dart';
import '../../../controller/functions/tts.dart'; import '../../../controller/functions/tts.dart';
import '../../../print.dart';
import 'form_search_start.dart'; import 'form_search_start.dart';
class MainBottomMenuMap extends StatelessWidget { class MainBottomMenuMap extends StatelessWidget {
@@ -46,24 +49,34 @@ class MainBottomMenuMap extends StatelessWidget {
child: Container( child: Container(
width: Get.width * .8, width: Get.width * .8,
height: Get.height * .1, height: Get.height * .1,
decoration: const BoxDecoration( padding: const EdgeInsets.symmetric(
boxShadow: [ horizontal: 20, vertical: 10),
BoxShadow( decoration: BoxDecoration(
color: Color.fromARGB( gradient: LinearGradient(
255, 237, 230, 230), colors: [
blurRadius: 5, AppColor.blueColor.withOpacity(0.8),
offset: Offset(2, 4)), AppColor.blueColor.withOpacity(0.6),
BoxShadow( ],
color: Color.fromARGB( begin: Alignment.topLeft,
255, 242, 237, 237), end: Alignment.bottomRight,
blurRadius: 5,
offset: Offset(-2, -2))
],
color: AppColor.blueColor,
borderRadius: BorderRadius.all(
Radius.elliptical(15, 30),
), ),
boxShadow: const [
BoxShadow(
color: Color.fromARGB(
255, 237, 230, 230),
blurRadius: 8,
offset: Offset(4, 8),
),
BoxShadow(
color: Color.fromARGB(
255, 242, 237, 237),
blurRadius: 8,
offset: Offset(-4, -4),
),
],
borderRadius: BorderRadius.circular(30),
), ),
// decoration: AppStyle.boxDecoration1, // decoration: AppStyle.boxDecoration1,
child: DefaultTextStyle( child: DefaultTextStyle(
style: AppStyle.title.copyWith( style: AppStyle.title.copyWith(
@@ -350,6 +363,18 @@ class MainBottomMenuMap extends StatelessWidget {
}, },
)); ));
}, },
onLongPress: () {
MyDialog().getDialog(
"Are you sure to delete this location?".tr, '', () {
sql.deleteData(TableName.recentLocations,
controller.recentPlaces[index]['id']);
controller.getFavioratePlaces();
controller.update();
Get.back();
mySnackbarSuccess('deleted'.tr);
});
},
child: Container( child: Container(
decoration: AppStyle.boxDecoration1, decoration: AppStyle.boxDecoration1,
child: Padding( child: Padding(

View File

@@ -53,7 +53,7 @@ class RideBeginPassenger extends StatelessWidget {
Container( Container(
decoration: AppStyle.boxDecoration, decoration: AppStyle.boxDecoration,
child: Text( child: Text(
controller.firstName, controller.driverName,
style: AppStyle.title, style: AppStyle.title,
), ),
), ),

View File

@@ -1,4 +1,3 @@
import 'package:SEFER/views/widgets/my_dialog.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@@ -12,11 +11,8 @@ import '../../../controller/functions/toast.dart';
import '../../../controller/home/payment/credit_card_controller.dart'; import '../../../controller/home/payment/credit_card_controller.dart';
import '../../../controller/payment/payment_controller.dart'; import '../../../controller/payment/payment_controller.dart';
import '../../../main.dart'; import '../../../main.dart';
import '../../../models/model/painter_copoun.dart';
import '../../../print.dart';
import '../../widgets/elevated_btn.dart'; import '../../widgets/elevated_btn.dart';
import '../../widgets/my_scafold.dart'; import '../../widgets/my_scafold.dart';
import '../../widgets/my_textField.dart';
import 'passenger_wallet_dialoge.dart'; import 'passenger_wallet_dialoge.dart';
class PassengerWallet extends StatelessWidget { class PassengerWallet extends StatelessWidget {
@@ -51,33 +47,33 @@ class PassengerWallet extends StatelessWidget {
}, },
), ),
), ),
Padding( // Padding(
padding: // padding:
const EdgeInsets.symmetric(horizontal: 80, vertical: 10), // const EdgeInsets.symmetric(horizontal: 80, vertical: 10),
child: MyElevatedButton( // child: MyElevatedButton(
kolor: AppColor.yellowColor, // kolor: AppColor.yellowColor,
title: 'Bounus gift'.tr, // title: 'Bonus gift'.tr,
onPressed: () { // onPressed: () {
Get.dialog( // Get.dialog(
AlertDialog( // AlertDialog(
contentPadding: EdgeInsets // contentPadding: EdgeInsets
.zero, // Removes the padding around the content // .zero, // Removes the padding around the content
content: SizedBox( // content: SizedBox(
width: 300, // Match the width of PromoBanner // width: 300, // Match the width of PromoBanner
// height: 250, // Match the height of PromoBanner // // height: 250, // Match the height of PromoBanner
child: PromoBanner( // child: PromoBanner(
promoCode: box.read(BoxName.promo), // promoCode: box.read(BoxName.promo),
discountPercentage: box.read(BoxName.discount), // discountPercentage: box.read(BoxName.discount),
validity: box.read(BoxName.validity), // validity: box.read(BoxName.validity),
), // ),
), // ),
), // ),
); // );
Log.print( // Log.print(
'box.read(BoxName.isGiftToken).toString(): ${box.read(BoxName.isGiftToken).toString()}'); // 'box.read(BoxName.isGiftToken).toString(): ${box.read(BoxName.isGiftToken).toString()}');
}, // },
), // ),
) // )
], ],
), ),
), ),
@@ -98,7 +94,8 @@ class PassengerWallet extends StatelessWidget {
MyElevatedButton( MyElevatedButton(
title: 'Show Promos to Charge'.tr, title: 'Show Promos to Charge'.tr,
onPressed: () { onPressed: () {
controller.changePromoSheetDialogue(); // controller.changePromoSheetDialogue();
showPaymentBottomSheet(context);
}, },
), ),
const SizedBox( const SizedBox(

View File

@@ -1,4 +1,6 @@
import 'package:SEFER/constant/style.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:SEFER/constant/box_name.dart'; import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/constant/colors.dart'; import 'package:SEFER/constant/colors.dart';
@@ -89,6 +91,147 @@ class PassengerWalletDialog extends StatelessWidget {
); );
} }
} }
// class PassengerWalletDialog extends StatelessWidget {
// const PassengerWalletDialog({
// super.key,
// });
// @override
// Widget build(BuildContext context) {
// return GetBuilder<PaymentController>(
// builder: (controller) {
// return Positioned(
// top: Get.height * .1,
// right: Get.width * .15,
// left: Get.width * .15,
// bottom: Get.height * .1,
// child: controller.isPromoSheetDialogue
// ? Container()
// : SizedBox
// .shrink(), // If condition is false, return an empty widget
// );
// },
// );
// }
// }
void showPaymentBottomSheet(BuildContext context) {
final controller = Get.find<PaymentController>();
showModalBottomSheet(
context: context,
isScrollControlled: true,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(15.0)),
),
builder: (BuildContext context) {
return WillPopScope(
onWillPop: () async {
Get.back();
return false;
},
child: Container(
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
'Select Payment Amount'.tr,
style: AppStyle.headTitle2,
textAlign: TextAlign.center,
),
const SizedBox(height: 16.0),
// Payment Options List
_buildPaymentOption(
context: context,
controller: controller,
amount: box.read(BoxName.countryCode) == 'Egypt' ? 100 : 10,
bonusAmount: 0,
currency: box.read(BoxName.countryCode) == 'Egypt'
? 'LE'.tr
: 'JOD'.tr,
),
const SizedBox(height: 8.0),
_buildPaymentOption(
context: context,
controller: controller,
amount: box.read(BoxName.countryCode) == 'Egypt' ? 200 : 20,
bonusAmount: box.read(BoxName.countryCode) == 'Egypt' ? 5 : 1,
currency: box.read(BoxName.countryCode) == 'Egypt'
? 'LE'.tr
: 'JOD'.tr,
),
const SizedBox(height: 8.0),
_buildPaymentOption(
context: context,
controller: controller,
amount: box.read(BoxName.countryCode) == 'Egypt' ? 400 : 40,
bonusAmount:
box.read(BoxName.countryCode) == 'Egypt' ? 15 : 2.5,
currency: box.read(BoxName.countryCode) == 'Egypt'
? 'LE'.tr
: 'JOD'.tr,
),
const SizedBox(height: 8.0),
_buildPaymentOption(
context: context,
controller: controller,
amount: box.read(BoxName.countryCode) == 'Egypt' ? 1000 : 50,
bonusAmount: box.read(BoxName.countryCode) == 'Egypt' ? 100 : 6,
currency: box.read(BoxName.countryCode) == 'Egypt'
? 'LE'.tr
: 'JOD'.tr,
),
const SizedBox(height: 16.0),
TextButton(
onPressed: () => Get.back(),
child: Text('Cancel'.tr),
),
],
),
),
);
},
);
}
Widget _buildPaymentOption({
required BuildContext context,
required PaymentController controller,
required int amount,
required double bonusAmount,
required String currency,
}) {
return Material(
color: Colors.transparent,
child: InkWell(
onTap: () {
controller.updateSelectedAmount(amount);
Get.back();
showPaymentOptions(context, controller);
},
child: Container(
padding: const EdgeInsets.symmetric(vertical: 12.0, horizontal: 16.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey[300]!),
borderRadius: BorderRadius.circular(8.0),
),
child: Text(
bonusAmount > 0
? '${'Pay'.tr} $amount $currency, ${'Get'.tr} ${amount + bonusAmount} $currency'
: '$amount $currency',
style: AppStyle.title,
textAlign: TextAlign.center,
),
),
),
);
}
void showPaymentOptions(BuildContext context, PaymentController controller) { void showPaymentOptions(BuildContext context, PaymentController controller) {
showCupertinoModalPopup( showCupertinoModalPopup(
@@ -209,7 +352,8 @@ void showPaymentOptions(BuildContext context, PaymentController controller) {
cancelButton: CupertinoActionSheetAction( cancelButton: CupertinoActionSheetAction(
child: Text('Cancel'.tr), child: Text('Cancel'.tr),
onPressed: () { onPressed: () {
controller.changePromoSheetDialogue(); // controller.changePromoSheetDialogue();
Get.back();
}, },
), ),
), ),

View File

@@ -20,211 +20,211 @@ class PromosPassengerPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
Get.put(PromosController()); Get.put(PromosController());
return MyScafolld( return MyScafolld(
title: 'Promos For today'.tr, title: "Promos For Today".tr,
isleading: true, isleading: true,
body: [ body: [
GetBuilder<PromosController>( GetBuilder<PromosController>(
builder: (orderHistoryController) => orderHistoryController.isLoading builder: (orderHistoryController) => orderHistoryController.isLoading
? const MyCircularProgressIndicator() ? const MyCircularProgressIndicator()
: ListView.builder( : ListView.builder(
itemCount: orderHistoryController.promoList.length + itemCount: orderHistoryController
1, // Adding 1 for the ad .promoList.length, // Adding 1 for the ad
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
if (index == 0) { // if (index == 0) {
// Ad at the beginning // // Ad at the beginning
return Padding( // return Padding(
padding: const EdgeInsets.all(8.0), // padding: const EdgeInsets.all(8.0),
child: Container( // child: Container(
height: 120, // Adjust the height of the ad container // height: 120, // Adjust the height of the ad container
decoration: BoxDecoration( // decoration: BoxDecoration(
color: // color:
Colors.grey[200], // Background color for the ad // Colors.grey[200], // Background color for the ad
borderRadius: BorderRadius.circular(10), // borderRadius: BorderRadius.circular(10),
), // ),
child: Center( // child: Center(
child: Container( // child: Container(
decoration: AppStyle.boxDecoration, // decoration: AppStyle.boxDecoration,
height: Get.height * .19, // height: Get.height * .19,
child: ListView( // child: ListView(
scrollDirection: Axis.horizontal, // scrollDirection: Axis.horizontal,
children: [ // children: [
PointsCaptain( // PointsCaptain(
kolor: AppColor.greyColor, // kolor: AppColor.greyColor,
pricePoint: // pricePoint:
box.read(BoxName.countryCode) == // box.read(BoxName.countryCode) ==
'Jordan' // 'Jordan'
? 5 // ? 5
: 100, // : 100,
countPoint: // countPoint:
box.read(BoxName.countryCode) == // box.read(BoxName.countryCode) ==
'Jordan' // 'Jordan'
? '300' // ? '300'
: '100', // : '100',
), // ),
PointsCaptain( // PointsCaptain(
kolor: AppColor.bronze, // kolor: AppColor.bronze,
pricePoint: // pricePoint:
box.read(BoxName.countryCode) == // box.read(BoxName.countryCode) ==
'Jordan' // 'Jordan'
? 10 // ? 10
: 200, // : 200,
countPoint: // countPoint:
box.read(BoxName.countryCode) == // box.read(BoxName.countryCode) ==
'Jordan' // 'Jordan'
? '1040' // ? '1040'
: '210', // : '210',
), // ),
PointsCaptain( // PointsCaptain(
kolor: AppColor.goldenBronze, // kolor: AppColor.goldenBronze,
pricePoint: // pricePoint:
box.read(BoxName.countryCode) == // box.read(BoxName.countryCode) ==
'Jordan' // 'Jordan'
? 22 // ? 22
: 400, // : 400,
countPoint: // countPoint:
box.read(BoxName.countryCode) == // box.read(BoxName.countryCode) ==
'Jordan' // 'Jordan'
? '2300' // ? '2300'
: '450', // : '450',
), // ),
PointsCaptain( // PointsCaptain(
kolor: AppColor.gold, // kolor: AppColor.gold,
pricePoint: // pricePoint:
box.read(BoxName.countryCode) == // box.read(BoxName.countryCode) ==
'Jordan' // 'Jordan'
? 50 // ? 50
: 1000, // : 1000,
countPoint: // countPoint:
box.read(BoxName.countryCode) == // box.read(BoxName.countryCode) ==
'Jordan' // 'Jordan'
? '55000' // ? '55000'
: '1200', // : '1200',
), // ),
], // ],
)), // )),
), // ),
), // ),
); // );
} else { // } else {
// Promo items // Promo items
final rides = orderHistoryController.promoList[index - 1]; final rides = orderHistoryController.promoList[index];
return Padding( return Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: CupertinoColors.systemGrey6, color: CupertinoColors.systemGrey6,
borderRadius: BorderRadius.circular(16), borderRadius: BorderRadius.circular(16),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: color:
CupertinoColors.systemGrey.withOpacity(0.5), CupertinoColors.systemGrey.withOpacity(0.5),
blurRadius: 8, blurRadius: 8,
offset: Offset(0, 4), offset: Offset(0, 4),
), ),
], ],
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [
Column( Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
GestureDetector( GestureDetector(
onTap: () {}, onTap: () {},
child: AnimatedTextKit( child: AnimatedTextKit(
animatedTexts: [ animatedTexts: [
ScaleAnimatedText( ScaleAnimatedText(
rides['promo_code'], rides['promo_code'],
textStyle: textStyle:
AppStyle.title.copyWith( AppStyle.title.copyWith(
fontSize: fontSize:
32, // Increased font size for emphasis 32, // Increased font size for emphasis
color: CupertinoColors color:
.activeBlue, CupertinoColors.activeBlue,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
),
), ),
WavyAnimatedText( ),
rides['promo_code'], WavyAnimatedText(
textStyle: rides['promo_code'],
AppStyle.title.copyWith( textStyle:
fontSize: AppStyle.title.copyWith(
32, // Increased font size for emphasis fontSize:
color: CupertinoColors 32, // Increased font size for emphasis
.activeBlue, color:
fontWeight: FontWeight.bold, CupertinoColors.activeBlue,
), fontWeight: FontWeight.bold,
), ),
], ),
isRepeatingAnimation: true, ],
), isRepeatingAnimation: true,
), ),
const SizedBox(height: 8),
// Description Text
Text(
rides['description'],
style: AppStyle.title.copyWith(
fontSize: 22,
color: CupertinoColors.systemGrey,
),
),
],
),
Column(
children: [
// Only displaying end date
Text(
'${'Valid Until:'.tr} ${rides['validity_end_date']}',
style: AppStyle.subtitle.copyWith(
fontWeight: FontWeight.bold,
fontSize: 20,
color: CupertinoColors.systemGrey,
),
),
],
),
],
),
// const SizedBox(height: 16),
// Copy Promo Text
Center(
child: GestureDetector(
onTap: () {
Clipboard.setData(ClipboardData(
text: rides['promo_code']));
Get.snackbar(
'Promo Copied!'.tr,
'You have copied the promo code.'.tr,
snackPosition: SnackPosition.BOTTOM,
backgroundColor:
CupertinoColors.systemGrey,
colorText: CupertinoColors.white,
);
},
child: Text(
'Copy Code'.tr,
textAlign: TextAlign.center,
style: AppStyle.headTitle2.copyWith(
color: CupertinoColors.systemBlue,
fontWeight: FontWeight.bold,
), ),
const SizedBox(height: 8),
// Description Text
Text(
rides['description'],
style: AppStyle.title.copyWith(
fontSize: 22,
color: CupertinoColors.systemGrey,
),
),
],
),
Column(
children: [
// Only displaying end date
Text(
'${'Valid Until:'.tr} ${rides['validity_end_date']}',
style: AppStyle.subtitle.copyWith(
fontWeight: FontWeight.bold,
fontSize: 20,
color: CupertinoColors.systemGrey,
),
),
],
),
],
),
// const SizedBox(height: 16),
// Copy Promo Text
Center(
child: GestureDetector(
onTap: () {
Clipboard.setData(ClipboardData(
text: rides['promo_code']));
Get.snackbar(
'Promo Copied!'.tr,
'You have copied the promo code.'.tr,
snackPosition: SnackPosition.BOTTOM,
backgroundColor:
CupertinoColors.systemGrey,
colorText: CupertinoColors.white,
);
},
child: Text(
'Copy Code'.tr,
textAlign: TextAlign.center,
style: AppStyle.headTitle2.copyWith(
color: CupertinoColors.systemBlue,
fontWeight: FontWeight.bold,
), ),
), ),
), ),
], ),
), ],
), ),
), ),
); ),
} );
// }
}, },
), ),
) )