This commit is contained in:
Hamza-Ayed
2024-09-19 07:05:19 +03:00
parent a65e7e5562
commit 2e3ce78fe8
12 changed files with 393 additions and 223 deletions

2
.env
View File

@@ -20,7 +20,7 @@ seferPaymentServer=https://seferpw.shop/sefer
seferCairoServer=https://sefer.click/sefer seferCairoServer=https://sefer.click/sefer
seferGizaServer=https://gizasefer.online/sefer seferGizaServer=https://gizasefer.online/sefer
whatappID=369939736211879 whatappID=369939736211879
whatsapp=EAAOtbZBSUK74BO6yE1QwIBsRCjPDANdum66xap0ZA7OZA8LqEu8MZAts1kwr12eRiNXtvpJ2ZAFSY5dw3KVSyrUuH8boLjynxdFI4Gh1Q7BCHx275X2uZBwKWZCSrsVN17i6mZAFNYYd25sQv0ZBomeTk02ZCIJot4UqWxK9ZBvxsq1k2yS7lD2NsjZB5EHbpaYGLzxFJ2FCCSX6iHyKXab6ckfK7m19wo77in7Dl3YZD whatsapp=EAAOtbZBSUK74BO3mbLwnnn5GsZBc5uAMHgbDGpyi3C0vDI8ZBWZBzN8HUwXePwisopEgyIGcNfZCNQ8RZAJEdmw58D1qgX5hsbfh9XDsIfFG2yKrVXYbPm5zClUbJMHSHAmtTNkfPkzK7AEvOp2KzZADkkqq5QDzk1iDcauULdEDkmxcCz4HDiYeGOEmPVXFr55zK24sHSGZBFDdqtkunHCZCyCShcj1Gg9GomWRi2NEZD
cohere=Aulwd8y5SPWos0hJhG0toUf8gOhUUrpf5Q2TPmVGXrXlBl cohere=Aulwd8y5SPWos0hJhG0toUf8gOhUUrpf5Q2TPmVGXrXlBl
claudeAiAPI=zg-qbc-qvo39-xWOxIGwWTOzCFBnIYSKKhfyz_KVAvrH-6_4ZEJL68G_QBH26oeTOMMoQug9KuOjjKSP_A4S3SUDlbxR9duVzoQ-MkX_UQQQXrXlBl claudeAiAPI=zg-qbc-qvo39-xWOxIGwWTOzCFBnIYSKKhfyz_KVAvrH-6_4ZEJL68G_QBH26oeTOMMoQug9KuOjjKSP_A4S3SUDlbxR9duVzoQ-MkX_UQQQXrXlBl
payPalClientId=QALymfNI5Tzt4s-ysoz6vD4_nqX0SUtkC_qYV-Ugk5gaM_8Z-kg4L53k8Uux_4jEWXDkNpXGSWPpIzDFXrXlBl payPalClientId=QALymfNI5Tzt4s-ysoz6vD4_nqX0SUtkC_qYV-Ugk5gaM_8Z-kg4L53k8Uux_4jEWXDkNpXGSWPpIzDFXrXlBl

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 = 70 versionCode = 71
versionName = '1.5.70' versionName = '1.5.71'
multiDexEnabled =true multiDexEnabled =true
// manifestPlaceholders can be specified here if needed // manifestPlaceholders can be specified here if needed

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

View File

@@ -1,101 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
<array> <array>
<dict> <dict>
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
<string>Editor</string> <string>Editor</string>
<key>CFBundleURLSchemes</key> <key>CFBundleURLSchemes</key>
<array> <array>
<string>com.googleusercontent.apps.594687661098-8e26699cris2k3nj5msj1osi59it9kpf</string> <string>com.googleusercontent.apps.594687661098-8e26699cris2k3nj5msj1osi59it9kpf</string>
</array> </array>
</dict> </dict>
</array> </array>
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
<array> <array>
<string>googlechromes</string> <string>googlechromes</string>
<string>comgooglemaps</string> <string>comgooglemaps</string>
</array> </array>
<key>CADisableMinimumFrameDurationOnPhone</key> <key>CADisableMinimumFrameDurationOnPhone</key>
<true /> <true/>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>Sefer</string> <string>Sefer</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string></string> <string></string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>Sefer</string> <string>Sefer</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>48</string> <string>52</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>4.3.48</string> <string>4.3.52</string>
<key>FirebaseAppDelegateProxyEnabled</key> <key>FirebaseAppDelegateProxyEnabled</key>
<string>NO</string> <string>NO</string>
<key>GMSApiKey</key> <key>GMSApiKey</key>
<string>YOUR_API_KEY</string> <string>YOUR_API_KEY</string>
<key>LSApplicationCategoryType</key> <key>LSApplicationCategoryType</key>
<string></string> <string></string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true /> <true/>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
<string>Sefer app requires access to your camera in order to scan QR codes and capture <string>Sefer app requires access to your camera in order to scan QR codes and capture
images for uploading and access to connect to a call.</string> images for uploading and access to connect to a call.</string>
<key>NSFaceIDUsageDescription</key> <key>NSFaceIDUsageDescription</key>
<string>Use Face ID to securely authenticate payment accounts.</string> <string>Use Face ID to securely authenticate payment accounts.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>This app needs access to your location to provide you with the best ride experience. <string>This app needs access to your location to provide you with the best ride experience.
Your location data will be used to find the nearest available cars and connect you with Your location data will be used to find the nearest available cars and connect you with
the closest captain for efficient and convenient rides.</string> the closest captain for efficient and convenient rides.</string>
<key>NSLocationAlwaysUsageDescription</key> <key>NSLocationAlwaysUsageDescription</key>
<string>This app needs access to location.</string> <string>This app needs access to location.</string>
<key>NSLocationWhenInUseUsageDescription</key> <key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs access to your location to provide you with the best ride experience. <string>This app needs access to your location to provide you with the best ride experience.
Your location data will be used to find the nearest available cars and connect you with Your location data will be used to find the nearest available cars and connect you with
the closest captain for efficient and convenient rides.</string> the closest captain for efficient and convenient rides.</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>This app requires access to your microphone to record audio, allowing you to add <string>This app requires access to your microphone to record audio, allowing you to add
voice recordings to your photos and videos and access to connect to a call.</string> voice recordings to your photos and videos and access to connect to a call.</string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryUsageDescription</key>
<string>Explanation of why your app needs access to the photo library.</string> <string>Explanation of why your app needs access to the photo library.</string>
<key>UIApplicationSupportsIndirectInputEvents</key> <key>UIApplicationSupportsIndirectInputEvents</key>
<true /> <true/>
<key>UIBackgroundModes</key> <key>UIBackgroundModes</key>
<array> <array>
<string>fetch</string> <string>fetch</string>
<string>location</string> <string>location</string>
<string>remote-notification</string> <string>remote-notification</string>
</array> </array>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
<string>Main</string> <string>Main</string>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>UISupportedInterfaceOrientations~ipad</key> <key>UISupportedInterfaceOrientations~ipad</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeRight</string>
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false /> <false/>
</dict> </dict>
</plist> </plist>

View File

@@ -189,6 +189,8 @@ class AppLink {
static String getCarsLocationByPassengerSpeed = "$location/getSpeed.php"; static String getCarsLocationByPassengerSpeed = "$location/getSpeed.php";
static String getCarsLocationByPassengerComfort = "$location/getComfort.php"; static String getCarsLocationByPassengerComfort = "$location/getComfort.php";
static String getCarsLocationByPassengerBalash = "$location/getBalash.php"; static String getCarsLocationByPassengerBalash = "$location/getBalash.php";
static String getCarsLocationByPassengerPinkBike =
"$location/getPinkBike.php";
static String getCarsLocationByPassengerDelivery = static String getCarsLocationByPassengerDelivery =
"$location/getDelivery.php"; "$location/getDelivery.php";
static String getLocationParents = "$location/getLocationParents.php"; static String getLocationParents = "$location/getLocationParents.php";

View File

@@ -429,7 +429,7 @@ class FirebaseMessagesController extends GetxController {
)); ));
} }
void sendNotificationAll(String title, body) async { void sendNotificationAll(String title, body, tone) async {
// Get the token you want to subtract. // Get the token you want to subtract.
String token = box.read(BoxName.tokenFCM); String token = box.read(BoxName.tokenFCM);
tokens = box.read(BoxName.tokens); tokens = box.read(BoxName.tokens);
@@ -441,25 +441,41 @@ class FirebaseMessagesController extends GetxController {
tokens = box.read(BoxName.tokens); tokens = box.read(BoxName.tokens);
for (var i = 0; i < tokens.length; i++) { for (var i = 0; i < tokens.length; i++) {
http http
.post(Uri.parse('https://fcm.googleapis.com/fcm/send'), .post(
headers: <String, String>{ Uri.parse('https://fcm.googleapis.com/fcm/send'),
'Content-Type': 'application/json', headers: <String, String>{
'Authorization': 'key=${AK.serverAPI}' 'Content-Type': 'application/json',
}, 'Authorization': 'key=${AK.serverAPI}'
body: jsonEncode({ },
'notification': <String, dynamic>{ body: jsonEncode({
'message': {
'token': token,
'notification': {
'title': title, 'title': title,
'body': body, 'body': body,
'sound': 'ding.wav'
}, },
'priority': 'high', // 'data': {
'data': <String, dynamic>{ // 'DriverList': jsonEncode(data),
'click_action': 'FLUTTER_NOTIFICATION_CLICK', // },
'id': '1', 'android': {
'status': 'done' 'priority': 'high', // Set priority to high
'notification': {
'sound': tone,
},
}, },
'to': tokens[i], 'apns': {
})) 'headers': {
'apns-priority': '10', // Set APNs priority to 10
},
'payload': {
'aps': {
'sound': tone,
},
},
},
},
}),
)
.whenComplete(() {}) .whenComplete(() {})
.catchError((e) {}); .catchError((e) {});
} }
@@ -533,11 +549,15 @@ class FirebaseMessagesController extends GetxController {
'body': body, 'body': body,
}, },
'android': { 'android': {
'priority': 'high', // Set priority to high
'notification': { 'notification': {
'sound': tone, 'sound': tone,
}, },
}, },
'apns': { 'apns': {
'headers': {
'apns-priority': '10', // Set APNs priority to 10
},
'payload': { 'payload': {
'aps': { 'aps': {
'sound': tone, 'sound': tone,
@@ -603,11 +623,15 @@ class FirebaseMessagesController extends GetxController {
'body': body, 'body': body,
}, },
'android': { 'android': {
'priority': 'high', // Set priority to high
'notification': { 'notification': {
'sound': tone, 'sound': tone,
}, },
}, },
'apns': { 'apns': {
'headers': {
'apns-priority': '10', // Set APNs priority to 10
},
'payload': { 'payload': {
'aps': { 'aps': {
'sound': tone, 'sound': tone,
@@ -716,11 +740,15 @@ class FirebaseMessagesController extends GetxController {
'DriverList': jsonEncode(data), 'DriverList': jsonEncode(data),
}, },
'android': { 'android': {
'priority': 'high', // Set priority to high
'notification': { 'notification': {
'sound': tone, 'sound': tone,
}, },
}, },
'apns': { 'apns': {
'headers': {
'apns-priority': '10', // Set APNs priority to 10
},
'payload': { 'payload': {
'aps': { 'aps': {
'sound': tone, 'sound': tone,
@@ -746,7 +774,7 @@ class FirebaseMessagesController extends GetxController {
} }
void sendNotificationToDriverMapPolyline(String title, String body, void sendNotificationToDriverMapPolyline(String title, String body,
String token, List<String> data, String polylineJson) async { String token, List<String> data, String polylineJson, String tone) async {
try { try {
String serviceAccountKeyJson = '''{ String serviceAccountKeyJson = '''{
"type": "service_account", "type": "service_account",
@@ -778,18 +806,32 @@ class FirebaseMessagesController extends GetxController {
'Authorization': 'Bearer $accessToken', 'Authorization': 'Bearer $accessToken',
}, },
body: jsonEncode({ body: jsonEncode({
'notification': <String, dynamic>{ 'message': {
'title': title, 'token': token,
'body': body, 'notification': {
// 'sound': 'tone2.wav', 'title': title,
'sound': 'order.wav' 'body': body,
},
'data': {
'DriverList': jsonEncode(data),
},
'android': {
'priority': 'high', // Set priority to high
'notification': {
'sound': tone,
},
},
'apns': {
'headers': {
'apns-priority': '10', // Set APNs priority to 10
},
'payload': {
'aps': {
'sound': tone,
},
},
},
}, },
'data': {
'DriverList': data,
'PolylineJson': polylineJson,
},
'priority': 'high',
'to': token,
}), }),
); );

View File

@@ -1017,10 +1017,10 @@ class MapPassengerController extends GetxController {
late String make = ''; late String make = '';
late String licensePlate = ''; late String licensePlate = '';
confirmRideForFirstDriver() async { confirmRideForFirstDriver() async {
startCarLocationSearch(box.read(BoxName.carType)); // startCarLocationSearch(box.read(BoxName.carType));
// await getCarsLocationByPassengerAndReloadMarker( // await getCarsLocationByPassengerAndReloadMarker(
// box.read(BoxName.carType), 7000); // box.read(BoxName.carType), 7000);
await getNearestDriverByPassengerLocationAPIGOOGLE(); // await getNearestDriverByPassengerLocationAPIGOOGLE();
Log.print('dataCarsLocationByPassenger: ${dataCarsLocationByPassenger}'); Log.print('dataCarsLocationByPassenger: ${dataCarsLocationByPassenger}');
if (dataCarsLocationByPassenger != 'failure' || if (dataCarsLocationByPassenger != 'failure' ||
dataCarsLocationByPassenger != null) { dataCarsLocationByPassenger != null) {
@@ -1258,12 +1258,8 @@ class MapPassengerController extends GetxController {
]; ];
Log.print('body: ${body}'); Log.print('body: ${body}');
for (var i = 1; i < driversToken.length; i++) { for (var i = 1; i < driversToken.length; i++) {
FirebaseMessagesController().sendNotificationToDriverMapPolyline( FirebaseMessagesController().sendNotificationToDriverMAP('OrderSpeed',
'OrderSpeed', rideId.toString(), driversToken[i], body, 'order.wav');
rideId.toString(),
driversToken[i],
body,
polylineCoordinates.toString());
} }
(rideId); (rideId);
@@ -1291,6 +1287,8 @@ class MapPassengerController extends GetxController {
if (res.toString() == 'waiting' && tick >= 15) { if (res.toString() == 'waiting' && tick >= 15) {
timer.cancel(); // Stop the current timer timer.cancel(); // Stop the current timer
showAndResearchForCaptain(); showAndResearchForCaptain();
//TODO add to wait
confirmRideForAllDriverAvailable();
// delayAndFetchRideStatusForAllDriverAvailable(rideId); // delayAndFetchRideStatusForAllDriverAvailable(rideId);
} else if (res.toString() == 'Apply') { } else if (res.toString() == 'Apply') {
// todo play sound // todo play sound
@@ -1314,7 +1312,9 @@ class MapPassengerController extends GetxController {
// No need to recall delayAndFetchRideStatus as Timer.periodic is already running // No need to recall delayAndFetchRideStatus as Timer.periodic is already running
update(); update();
// } // }
tick++; if (tick < 19) {
tick++;
}
} else { } else {
timer.cancel(); timer.cancel();
// Stop the timer if remainingTimeToPassengerFromDriverAfterApplied <= 0 // Stop the timer if remainingTimeToPassengerFromDriverAfterApplied <= 0
@@ -1343,7 +1343,7 @@ class MapPassengerController extends GetxController {
Log.print('tick delayAndFetchRideStatusForAllDriverAvailable: ${tick}'); Log.print('tick delayAndFetchRideStatusForAllDriverAvailable: ${tick}');
void fetchRideStatus() async { void fetchRideStatus() async {
if (attemptCounter < maxAttempts && !isApplied && tick < 20) { if (attemptCounter < maxAttempts && !isApplied || tick < 20) {
attemptCounter++; attemptCounter++;
tick++; tick++;
var res = await getRideStatus(rideId); var res = await getRideStatus(rideId);
@@ -1760,7 +1760,7 @@ class MapPassengerController extends GetxController {
'northeastLon': bounds.northeast.longitude.toString(), 'northeastLon': bounds.northeast.longitude.toString(),
}); });
break; break;
case 'Delivery': case 'Scooter':
res = await CRUD() res = await CRUD()
.get(link: AppLink.getCarsLocationByPassengerDelivery, payload: { .get(link: AppLink.getCarsLocationByPassengerDelivery, payload: {
'southwestLat': bounds.southwest.latitude.toString(), 'southwestLat': bounds.southwest.latitude.toString(),
@@ -1778,6 +1778,15 @@ class MapPassengerController extends GetxController {
'northeastLon': bounds.northeast.longitude.toString(), 'northeastLon': bounds.northeast.longitude.toString(),
}); });
break; break;
case 'Pink Bike':
res = await CRUD()
.get(link: AppLink.getCarsLocationByPassengerPinkBike, payload: {
'southwestLat': bounds.southwest.latitude.toString(),
'southwestLon': bounds.southwest.longitude.toString(),
'northeastLat': bounds.northeast.latitude.toString(),
'northeastLon': bounds.northeast.longitude.toString(),
});
break;
default: default:
res = await CRUD() res = await CRUD()
.get(link: AppLink.getCarsLocationByPassenger, payload: { .get(link: AppLink.getCarsLocationByPassenger, payload: {
@@ -1796,11 +1805,29 @@ class MapPassengerController extends GetxController {
} else { } else {
noCarString = false; noCarString = false;
dataCarsLocationByPassenger = jsonDecode(res); dataCarsLocationByPassenger = jsonDecode(res);
driverId = dataCarsLocationByPassenger['message'][carsOrder]
['driver_id'] // Check if 'message' is present and not null
.toString(); if (dataCarsLocationByPassenger['message'] != null &&
gender = dataCarsLocationByPassenger['message'][carsOrder]['gender'] dataCarsLocationByPassenger['message'].isNotEmpty) {
.toString(); // Check if carsOrder is within bounds
if (carsOrder < dataCarsLocationByPassenger['message'].length) {
driverId = dataCarsLocationByPassenger['message'][carsOrder]
['driver_id']
.toString();
gender = dataCarsLocationByPassenger['message'][carsOrder]['gender']
.toString();
driverToken = dataCarsLocationByPassenger['message'][carsOrder]
['token']
.toString();
} else {
print('carsOrder is out of bounds for message array');
return false;
}
} else {
// Get.defaultDialog(title: 'No cars available ');
print('No cars available or message is null');
return false;
}
carsLocationByPassenger.clear(); // Clear existing markers carsLocationByPassenger.clear(); // Clear existing markers

View File

@@ -4,6 +4,10 @@ class MyTranslation extends Translations {
@override @override
Map<String, Map<String, String>> get keys => { Map<String, Map<String, String>> get keys => {
"ar": { "ar": {
"Price of trip": "سعر الرحلة",
"For Speed and Delivery trips, the price is calculated dynamically. For Comfort trips, the price is based on time and distance":
"بالنسبة لرحلات السرعة والتوصيل، يتم حساب السعر ديناميكياً. بالنسبة لرحلات الراحة، يتم حساب السعر بناءً على الوقت والمسافة",
"Phone Wallet Saved Successfully": "تم حفظ المحفظة الهاتفية بنجاح",
"Add wallet phone you use": "أضف محفظة الهاتف التي تستخدمها", "Add wallet phone you use": "أضف محفظة الهاتف التي تستخدمها",
"Update Available": "تحديث متوفر", "Update Available": "تحديث متوفر",
'Phone number must be exactly 11 digits long': 'Phone number must be exactly 11 digits long':

View File

@@ -121,7 +121,50 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
// borderRadius: BorderRadius.circular(15)), // borderRadius: BorderRadius.circular(15)),
// child: IconButton( // child: IconButton(
// onPressed: () async { // onPressed: () async {
// Get.to(SmsSignupEgypt()); // // Get.to(SmsSignupEgypt());
// List<String> d = [
// "30.003028,31.2419628",
// "30.0955661,31.2665336",
// "160.00",
// "25.92",
// "1488",
// "16.93",
// "114243034311436865474",
// "113172279072358305645",
// "hamza ayed",
// "rlMbi4Hc8L1STMPE99iPKqK4Gddwv8r9qZOCadsz9qTEJZ6KLEE9ruTJI6N8dKfK4CXez5pme5WIs14-1QGo29s07fQOniZgIlJV5XFL3yqzPRSUmn3",
// "+201023248456",
// "1 min",
// "1 m",
// "false",
// "QwUMoyUtZ0J3oR6yXKUavrB_gBl9npUZe-qZtax-Raq4QBbdKv0AmtLKm0BfBd6N_592HBv4CVa41ii4122W3hr-BCUKKzJhzZcK8m0YjbWbtpvgJRD8uD_nuMk9",
// "0",
// "238",
// "false",
// "114243034311436865474",
// "1488",
// "startEnd",
// "30.049307749732176,31.274291574954987",
// "",
// "",
// "",
// "",
// "17.73",
// "0",
// "hamzaayedflutter@gmail.com",
// "الفسطاط، حي مصر القديمة، مصر",
// " الزاوية الحمراء، محافظة القاهرة، مصر",
// "Speed",
// "8",
// "5.00"
// ];
// FirebaseMessagesController().sendNotificationToDriverMAP(
// 'Order'.tr,
// 'from: ',
// // jsonDecode(value)['message'].toString(),
// 'd3JaCCFAQeu8QTxRnlC1sB:APA91bFuRjbVK32obIFYXFTI4iwsZEPrrgwvPouob2bXivID-W4aXz51J_OIJ2nHpNU2ocOvGLD1Ip65rLViAFx5qHVE-c8FabBwBi5fSQ-lDTQfe36xxKsc9DU-sTyj_FoYrrMnLNVi',
// d,
// 'order.wav');
// }, // },
// icon: const Icon( // icon: const Icon(
// Icons.chat, // Icons.chat,
@@ -129,7 +172,7 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
// ), // ),
// ), // ),
// ), // ),
// AnimatedContainer( // // AnimatedContainer(
// duration: const Duration(microseconds: 200), // duration: const Duration(microseconds: 200),
// width: controller.widthMapTypeAndTraffic, // width: controller.widthMapTypeAndTraffic,
// decoration: BoxDecoration( // decoration: BoxDecoration(

View File

@@ -10,6 +10,7 @@ import 'package:SEFER/main.dart';
import '../../../constant/colors.dart'; import '../../../constant/colors.dart';
import '../../../constant/style.dart'; import '../../../constant/style.dart';
import '../../../controller/functions/audio_record1.dart'; import '../../../controller/functions/audio_record1.dart';
import '../../../controller/functions/launch.dart';
import '../../../controller/functions/toast.dart'; import '../../../controller/functions/toast.dart';
import '../../../controller/home/map_passenger_controller.dart'; import '../../../controller/home/map_passenger_controller.dart';
@@ -248,8 +249,8 @@ class RideBeginPassenger extends StatelessWidget {
profileController.prfoileData['sosPhone']); profileController.prfoileData['sosPhone']);
} }
} else { } else {
controller makePhoneCall('122');
.sendSMS(box.read(BoxName.sosPhonePassenger)); // box.read(BoxName.sosPhonePassenger));
} }
}, },
icon: const Icon( icon: const Icon(

View File

@@ -6,6 +6,7 @@ import '../../../constant/box_name.dart';
import '../../../constant/colors.dart'; import '../../../constant/colors.dart';
import '../../../constant/info.dart'; import '../../../constant/info.dart';
import '../../../constant/style.dart'; import '../../../constant/style.dart';
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';
@@ -96,6 +97,10 @@ class PassengerWallet extends StatelessWidget {
Get.back(); Get.back();
box.write(BoxName.phoneWallet, box.write(BoxName.phoneWallet,
controller.walletphoneController.text); controller.walletphoneController.text);
Toast.show(
context,
'Phone Wallet Saved Successfully'.tr,
AppColor.greenColor);
}, },
), ),
cancel: MyElevatedButton( cancel: MyElevatedButton(

View File

@@ -8,6 +8,7 @@ import 'package:SEFER/controller/payment/payment_controller.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart'; import 'package:SEFER/views/widgets/elevated_btn.dart';
import '../../../main.dart'; import '../../../main.dart';
import '../../widgets/my_textField.dart';
class PassengerWalletDialog extends StatelessWidget { class PassengerWalletDialog extends StatelessWidget {
const PassengerWalletDialog({ const PassengerWalletDialog({
@@ -163,92 +164,137 @@ class PassengerWalletDialog extends StatelessWidget {
}, },
), ),
box.read(BoxName.countryCode) == 'Egypt' box.read(BoxName.countryCode) == 'Egypt'
? Column( ? box.read(BoxName.phoneWallet) != null
children: [ ? Column(
MyElevatedButton( children: [
title: '💳 Pay with Credit Card'.tr, MyElevatedButton(
title: '💳 Pay with Credit Card'.tr,
onPressed: () {
if (controller.selectedAmount != 0) {
controller.payWithPayMob(
context,
controller.selectedAmount
.toString(), // Convert int to double
box.read(BoxName.countryCode) ==
'Egypt'
? 'EGP'
: 'JOD',
() async {
await controller
.addPassengerWallet();
controller
.changePromoSheetDialogue();
await controller
.getPassengerWallet();
},
);
} else {
Toast.show(
context,
'⚠️ You need to choose an amount!'
.tr,
AppColor.redColor,
);
}
},
),
// Add some spacing between buttons
MyElevatedButton(
kolor: AppColor.yellowColor,
title: '💰 Pay with Wallet'.tr,
onPressed: () {
if (controller.selectedAmount != 0) {
controller.payWithPayMobWallet(
context,
controller.selectedAmount
.toString(), // Convert int to double
box.read(BoxName.countryCode) ==
'Egypt'
? 'EGP'
: 'JOD',
() async {
await controller
.addPassengerWallet();
controller
.changePromoSheetDialogue();
await controller
.getPassengerWallet();
},
);
} else {
Toast.show(
context,
'⚠️ You need to choose an amount!'
.tr,
AppColor.redColor,
);
}
},
),
],
)
: MyElevatedButton(
title: 'Pay with Credit Card'.tr,
onPressed: () { onPressed: () {
if (controller.selectedAmount != 0) { if (controller.selectedAmount != 0) {
controller.payWithPayMob( controller.makePaymentStripe(
context, controller.selectedAmount!
controller.selectedAmount .toDouble(), // Convert int to double
.toString(), // Convert int to double box.read(BoxName.countryCode) !=
box.read(BoxName.countryCode) == 'Egypt'
'Egypt' ? 'usd'
? 'EGP' : 'jod', () {
: 'JOD', controller.addPassengerWallet();
() async { controller.changePromoSheetDialogue();
await controller controller.getPassengerWallet();
.addPassengerWallet(); });
controller
.changePromoSheetDialogue();
await controller
.getPassengerWallet();
},
);
} else { } else {
Toast.show( Toast.show(
context, context,
'⚠️ You need to choose an amount!'.tr, 'You will choose one of above !'.tr,
AppColor.redColor, AppColor.redColor);
);
} }
}, })
),
// Add some spacing between buttons
MyElevatedButton(
kolor: AppColor.yellowColor,
title: '💰 Pay with Wallet'.tr,
onPressed: () {
if (controller.selectedAmount != 0) {
controller.payWithPayMobWallet(
context,
controller.selectedAmount
.toString(), // Convert int to double
box.read(BoxName.countryCode) ==
'Egypt'
? 'EGP'
: 'JOD',
() async {
await controller
.addPassengerWallet();
controller
.changePromoSheetDialogue();
await controller
.getPassengerWallet();
},
);
} else {
Toast.show(
context,
'⚠️ You need to choose an amount!'.tr,
AppColor.redColor,
);
}
},
),
],
)
: MyElevatedButton( : MyElevatedButton(
title: 'Pay with Credit Card'.tr, kolor: AppColor.deepPurpleAccent,
title: "Add wallet phone you use".tr,
onPressed: () { onPressed: () {
if (controller.selectedAmount != 0) { Get.defaultDialog(
controller.makePaymentStripe( barrierDismissible: false,
controller.selectedAmount! title: 'Insert Wallet phone number'.tr,
.toDouble(), // Convert int to double content: Form(
box.read(BoxName.countryCode) != 'Egypt' key: controller.formKey,
? 'usd' child: MyTextForm(
: 'jod', () { controller: controller
controller.addPassengerWallet(); .walletphoneController,
controller.changePromoSheetDialogue(); label:
controller.getPassengerWallet(); 'Insert Wallet phone number'
}); .tr,
} else { hint: 'Insert Wallet phone number'
Toast.show( .tr,
context, type: TextInputType.phone)),
'You will choose one of above !'.tr, confirm: MyElevatedButton(
AppColor.redColor); kolor: AppColor.greenColor,
} title: 'OK'.tr,
onPressed: () async {
Get.back();
box.write(
BoxName.phoneWallet,
controller
.walletphoneController.text);
Toast.show(
context,
'Phone Wallet Saved Successfully'
.tr,
AppColor.greenColor);
},
),
cancel: MyElevatedButton(
title: 'Cancel'.tr,
kolor: AppColor.redColor,
onPressed: () {
Get.back();
}));
}), }),
MyElevatedButton( MyElevatedButton(
title: 'Cancel'.tr, title: 'Cancel'.tr,