This commit is contained in:
Hamza-Ayed
2024-06-22 13:30:50 +03:00
parent 2bd242b28c
commit 1352fc8b36
48 changed files with 17 additions and 295 deletions

View File

@@ -24,7 +24,6 @@ class AuthController extends GetxController {
await _auth.signInWithCredential(credential);
return userCredential.user;
} catch (error) {
print("Error during Apple sign-in: $error");
return null;
}
}

View File

@@ -28,7 +28,6 @@ class GoogleSignInHelper {
}
return googleUser;
} catch (error) {
print('Google Sign-In error: $error');
return null;
}
}
@@ -49,7 +48,6 @@ class GoogleSignInHelper {
}
return googleUser;
} catch (error) {
print('Google Sign-In error: $error');
return null;
}
}
@@ -59,10 +57,7 @@ class GoogleSignInHelper {
try {
await _googleSignIn.signOut();
await _handleSignOut();
print('User signed out.');
} catch (error) {
print('Google Sign-Out error: $error');
}
} catch (error) {}
}
// Method to get the current signed-in user
@@ -80,11 +75,6 @@ class GoogleSignInHelper {
// Perform any additional sign-up tasks or API calls here
// For example, you can send the user data to your server for registration
print('passengerID = ${box.read(BoxName.passengerID)}');
print('email = ${box.read(BoxName.email)}');
print('name = ${box.read(BoxName.name)}');
print('passengerPhotoUrl = ${box.read(BoxName.passengerPhotoUrl)}');
}
// Method to handle sign-out process
@@ -111,7 +101,5 @@ class GoogleSignInHelper {
Get.offAll(OnBoardingPage());
// Perform any additional sign-out tasks or API calls here
// For example, you can notify your server about the user sign-out
print('User data cleared.');
}
}

View File

@@ -29,10 +29,7 @@ class TokenController extends GetxController {
isloading = false;
update();
print(res.request);
print(res.body);
var jsonToken = jsonDecode(res.body);
// print(jsonToken);
if (jsonToken['status'] == 'The token has been updated successfully.') {
Get.snackbar('token updated'.tr, '');
}

View File

@@ -23,7 +23,6 @@ class AudioRecorderController extends GetxController {
final bool isPermissionGranted = await recorder.hasPermission();
if (!isPermissionGranted) {
// RecordingPermissionException('l');
print('sss');
return;
}
@@ -51,7 +50,6 @@ class AudioRecorderController extends GetxController {
Future<void> stopRecording() async {
final path = await recorder.stop();
print(path);
isRecording = false;
update();
}
@@ -94,11 +92,8 @@ class AudioRecorderController extends GetxController {
final file = File(filePath);
if (await file.exists()) {
await file.delete();
print('File deleted: $filePath');
await getRecordedFiles();
} else {
print('File not found: $filePath');
}
} else {}
}
Future<void> deleteAllRecordedFiles() async {

View File

@@ -36,9 +36,6 @@ class CallController extends GetxController {
}
initAgoraFull() async {
print('channelName is $channelName');
print('remoteid is $remoteUid');
print('uid is $uid');
await fetchToken();
// Set up an instance of Agora engine
setupVoiceSDKEngine();
@@ -70,8 +67,6 @@ class CallController extends GetxController {
//create an instance of the Agora engine
agoraEngine = createAgoraRtcEngine();
await agoraEngine.initialize(RtcEngineContext(appId: AK.agoraAppId));
print('eeeeeeeeeeeeeeeeeeee');
print(agoraEngine);
// Register the event handler
agoraEngine.registerEventHandler(
RtcEngineEventHandler(
@@ -133,7 +128,6 @@ class CallController extends GetxController {
var res = await CRUD()
.getAgoraToken(channelName: channelName, uid: uid.toString());
token = res;
print('token is $token');
update();
}
}

View File

@@ -27,15 +27,9 @@ class CRUD {
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}',
},
);
print("-----request----" + response.request.toString());
// print("-----headers-----" + response.headers.toString());
print("-----payload-----" + payload.toString());
// if (response.statusCode == 200) {
// print(response.body);
var jsonData = jsonDecode(response.body);
if (jsonData['status'] == 'success') {
// print(jsonData);
return response.body;
}
@@ -59,14 +53,9 @@ class CRUD {
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}',
},
);
print("-----request----" + response.request.toString());
// print("-----headers-----" + response.headers.toString());
print("-----payload-----" + payload.toString());
if (response.statusCode == 200) {
print(response.body);
var jsonData = jsonDecode(response.body);
// if (jsonData['status'] == 'success') {
// print(jsonData);
return jsonData;
// }
@@ -87,11 +76,8 @@ class CRUD {
if (res.statusCode == 200) {
var response = jsonDecode(res.body);
print(await response);
return response['token'];
} else {
print(res.reasonPhrase);
}
} else {}
}
Future<dynamic> getLlama({
@@ -153,7 +139,6 @@ class CRUD {
String imagePathFull =
'${AppLink.server}card_image/$imagePath-${box.read(BoxName.driverID) ?? box.read(BoxName.passengerID)}.jpg';
print('imagePath=$imagePathFull');
var requestBody = {"url": imagePathFull};
var response = await http.post(
url,
@@ -163,8 +148,6 @@ class CRUD {
if (response.statusCode == 200) {
var responseBody = jsonDecode(response.body);
// print(decode);
print('imagePath=$imagePathFull');
return responseBody.toString();
}
return response.statusCode;
@@ -221,12 +204,8 @@ class CRUD {
},
);
if (response.statusCode == 200) {
print(response);
return response.body;
} else {
print('eeeeeeeeerrrrorrrr ${response.statusCode}');
print(response.body);
}
} else {}
}
Future<dynamic> post({
@@ -247,11 +226,8 @@ class CRUD {
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
},
);
print(response.request);
print(payload);
var jsonData = jsonDecode(response.body);
print(jsonData);
if (response.statusCode == 200) {
if (jsonData['status'] == 'success') {
return response.body;
@@ -274,11 +250,8 @@ class CRUD {
);
var response = await http.post(url,
body: payload, headers: {'Content-Type': 'application/json'});
print(response.request);
print(payload);
var jsonData = jsonDecode(response.body);
// print(jsonData);
if (response.statusCode == 200) {
if (jsonData['status'] == 'success') {
return response.body;
@@ -304,13 +277,8 @@ class CRUD {
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
// print(request.body);
// print(response);
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
} else {
print(response.reasonPhrase);
}
} else {}
}
Future<dynamic> postFromDialogue({
@@ -331,9 +299,6 @@ class CRUD {
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
},
);
//print(response.request);
//print('body=========================');
//print(response.body);
if (response.body.isNotEmpty) {
var jsonData = jsonDecode(response.body);
@@ -375,10 +340,7 @@ class CRUD {
);
if (response.statusCode == 201) {
print('Verification request sent');
} else {
print('Failed to send verification request');
}
} else {}
// Prompt the user to enter the OTP
final otpCode = "123456"; // Replace with user input
@@ -401,10 +363,7 @@ class CRUD {
);
if (checkResponse.statusCode == 201) {
print('Verification successful');
} else {
print('Verification failed');
}
} else {}
}
Future<dynamic> getGoogleApi({
@@ -418,9 +377,7 @@ class CRUD {
url,
body: payload,
);
print(response.request);
var jsonData = jsonDecode(response.body);
// //print(jsonData);
if (jsonData['status'] == 'OK') {
return jsonData;
}

View File

@@ -76,7 +76,6 @@
// deviceDataList.add(deviceData);
// }
// } catch (e) {
// print('Failed to get device info: $e');
// }
//
// return deviceDataList;
@@ -85,20 +84,7 @@
// // Method to print all device data
// static void printDeviceInfo() {
// for (Map<String, dynamic> deviceData in deviceDataList) {
// print('Platform: ${deviceData['platform']}');
// print('Brand: ${deviceData['brand']}');
// print('Model: ${deviceData['model']}');
// print(
// 'Version: ${deviceData['version'] ?? deviceData['versionRelease'] ?? 'N/A'}');
// print('Manufacturer: ${deviceData['manufacturer'] ?? 'N/A'}');
// print('Is Physical Device: ${deviceData['isPhysicalDevice']}');
// print('Serial Number: ${deviceData['serialNumber'] ?? 'N/A'}');
// print('Fingerprint: ${deviceData['fingerprint'] ?? 'N/A'}');
// print('Type: ${deviceData['type'] ?? 'N/A'}');
// print('Data: ${deviceData['data'] ?? 'N/A'}');
// print('Tags: ${deviceData['tags'] ?? 'N/A'}');
// print('Display: ${deviceData['display'] ?? 'N/A'}');
// print('--------------------');
// }
// }
// }

View File

@@ -4,9 +4,7 @@ import 'dart:io';
void showInBrowser(String url) async {
if (await canLaunchUrl(Uri.parse(url))) {
launchUrl(Uri.parse(url));
} else {
print('Could not launch $url');
}
} else {}
}
void launchCommunication(
@@ -30,7 +28,6 @@ void launchCommunication(
'mailto:$contactInfo?subject=Subject&body=${Uri.encodeComponent(message)}';
break;
default:
print('Method not supported on iOS');
return;
}
} else if (Platform.isAndroid) {
@@ -49,7 +46,6 @@ void launchCommunication(
url =
'whatsapp://send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
} else {
print('WhatsApp is not installed on this device.');
// Provide an alternative action, such as opening the WhatsApp Web API
url =
'https://api.whatsapp.com/send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
@@ -60,19 +56,13 @@ void launchCommunication(
'mailto:$contactInfo?subject=Subject&body=${Uri.encodeComponent(message)}';
break;
default:
print('Method not supported on Android');
return;
}
} else {
print('Platform not supported');
return;
}
print('Launching URL: $url');
if (await canLaunchUrl(Uri.parse(url))) {
await launchUrl(Uri.parse(url));
} else {
print('Could not launch $url');
}
} else {}
}

View File

@@ -29,7 +29,6 @@
// BackgroundLocation.startLocationService();
// BackgroundLocation.getLocationUpdates((location) {
// // Handle location updates here
// print("New location: ${location.latitude}, ${location.longitude}");
// });
// }
@@ -48,7 +47,6 @@
// Duration.microsecondsPerSecond); // Set interval to 5 seconds
// BackgroundLocation.getLocationUpdates((location1) {
// print('''\n
// Latitude: ${location1.latitude.toString()}
// Longitude: ${location1.longitude.toString()}
// Altitude: ${location1.altitude.toString()}
@@ -61,7 +59,6 @@
// });
// } else {
// await Permission.locationAlways.request();
// print('Location permission not granted');
// }
// }
// }

View File

@@ -49,8 +49,6 @@ class LocationController extends GetxController {
// if (isActive) {
if (double.parse(totalPoints) > -300) {
print('total point is $totalPoints');
await getLocation();
// if (box.read(BoxName.driverID) != null) {
@@ -73,7 +71,6 @@ class LocationController extends GetxController {
// }
} catch (e) {
// Handle the error gracefully
print('Error during location updates: $e');
}
});
}
@@ -125,21 +122,12 @@ class LocationController extends GetxController {
// if (previousTime > 0) {
// double distance = calculateDistanceInKmPerHour(
// previousTime, _locationData.time, speed);
// print('distance $distance');
// totalDistance += distance;
// }
// // print('totalDistance: $totalDistance');
// previousTime = _locationData.time!;
// }
// Print location details
// print('myLocation: ${myLocation}');
// print('Accuracy: ${_locationData.accuracy}');
// print('Latitude: ${_locationData.latitude}');
// print('Longitude: ${_locationData.longitude}');
// print('Time: ${_locationData.time}');
print('speed: ${_locationData.speed}');
// print('Heading: ${_locationData.heading}');
// isLoading = false;
update();
}

View File

@@ -28,10 +28,6 @@ class SmsEgyptController extends GetxController {
headers: headers,
);
print(res.reasonPhrase);
print(res.request);
print(res.body);
print(body);
if (res.statusCode == 200) {
Get.defaultDialog(
title: 'You will recieve code in sms message'.tr,
@@ -53,7 +49,6 @@ class SmsEgyptController extends GetxController {
},
headers: headers,
);
print(res);
}
Future sendSmsWithValidaty(String phone, otp) async {
@@ -71,7 +66,6 @@ class SmsEgyptController extends GetxController {
},
headers: headers,
);
print(res);
}
Future sendSmsStatus(String smsid) async {
@@ -84,6 +78,5 @@ class SmsEgyptController extends GetxController {
},
headers: headers,
);
print(res);
}
}

View File

@@ -45,7 +45,6 @@ class TextToSpeechController extends GetxController {
} catch (error) {
// Handle error gracefully, e.g., show a message
Get.snackbar('Error', 'Failed to speak text: $error');
print('Failed to speak text: $error');
}
}
}

View File

@@ -17,7 +17,6 @@
// messageBody: message,
// );
// } catch (e) {
// print(e); // Print the exception to the console.
// }
// }
// }

View File

@@ -47,7 +47,6 @@ class ImageController extends GetxController {
update();
// Save the cropped image
File savedCroppedImage = File(croppedFile!.path);
print('link =$link');
try {
await uploadImage(
savedCroppedImage,
@@ -61,7 +60,6 @@ class ImageController extends GetxController {
} catch (e) {
Get.snackbar('Image Upload Failed'.tr, e.toString(),
backgroundColor: AppColor.redColor);
print(e);
} finally {
isloading = false;
update();

View File

@@ -9,7 +9,6 @@ class MyMenuController extends GetxController {
} else {
isDrawerOpen = true;
}
print(isDrawerOpen);
update();
}
}

View File

@@ -47,7 +47,6 @@ class CaptainWalletController extends GetxController {
// totalAmount = walletDate['message'][0]['total_amount'].toString() == null
// ? '0'
// : walletDate['message'][0]['total_amount'];
// print(totalAmount);
// var res1 = await CRUD().get(
// link: AppLink.getAllPaymentVisa,
@@ -56,7 +55,6 @@ class CaptainWalletController extends GetxController {
// totalAmountVisa = walletDateVisa['message'][0]['diff'].toString() == null
// ? '0'
// : walletDateVisa['message'][0]['diff'];
// print(totalAmountVisa);
// isLoading = false;
// update();
// }
@@ -91,7 +89,6 @@ class CaptainWalletController extends GetxController {
});
var d = jsonDecode(res);
paymentID = d['message'].toString();
print('paymentID $paymentID');
}
Future addDriverWallet(String paymentMethod, point) async {

View File

@@ -44,11 +44,6 @@ class CreditCardController extends GetxController {
// String? expiryDate = await SecureStorage().readData(BoxName.expiryDate);
// String? cvvCode = await SecureStorage().readData(BoxName.cvvCode);
// print('cardNumber: $cardNumber');
// print('cardHolderName: $cardHolderName');
// print('expiryDate: $expiryDate');
// print('cvvCode: $cvvCode');
// if (cvvCode != null && cvvCode.isNotEmpty) {
// final maskedCardNumber = DigitObscuringFormatter()
// .formatEditUpdate(
@@ -57,8 +52,6 @@ class CreditCardController extends GetxController {
// )
// .text;
// print('maskedCardNumber: $maskedCardNumber');
// cardNumberController.text = maskedCardNumber;
// cardHolderNameController.text = cardHolderName ?? '';
// expiryDateController.text = expiryDate ?? '';

View File

@@ -26,7 +26,6 @@ class PointsForRiderController extends GetxController {
}
void removeLocation(int index) {
print(index);
locations.removeAt(index);
update();
}
@@ -96,25 +95,18 @@ class WayPointController extends GetxController {
}
void updatePlace(int index, String input) async {
print(myLocation);
print(index);
print(input);
var url =
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=$input&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
print(url);
var response = await CRUD().getGoogleApi(link: url, payload: {});
// final place = input;
// print(response);
// if (index == 0) {
List<dynamic> newList = [];
placeListResponse.add(newList);
newList = response['results'];
print(newList);
placeListResponse[index].add(newList);
update();
// }
print(placeListResponse[index]);
update();
}

View File

@@ -23,7 +23,6 @@ class ComplaintController extends GetxController {
'feedBack': complaintController.text
});
var d = jsonDecode(res);
// print(d);
if (d['status'].toString() == 'success') {
Get.defaultDialog(
title: 'Success'.tr,

View File

@@ -28,7 +28,6 @@ class OrderHistoryController extends GetxController {
var jsonDecoded = jsonDecode(res);
orderHistoryListPassenger = jsonDecoded['data'];
// print(orderHistoryListPassenger);
isloading = false;
update();
}

View File

@@ -37,7 +37,6 @@ class PromosController extends GetxController {
promoList = jsonDecoded['message'];
isLoading = false;
update();
print(promoList);
}
}
}

View File

@@ -45,10 +45,6 @@ class SplashScreenController extends GetxController
}
void startTimer() async {
print(box.read(BoxName.email));
print(box.read(BoxName.phone));
print(box.read(BoxName.isVerified));
print('---------');
Timer(const Duration(seconds: 5), () async {
box.read(BoxName.onBoarding) == null
? Get.off(() => OnBoardingPage())

View File

@@ -20,7 +20,6 @@ class NotificationCaptainController extends GetxController {
link: AppLink.getNotificationCaptain,
payload: {'driverID': box.read(BoxName.driverID)});
if (res == "failure") {
// print(res);
Get.defaultDialog(
title: 'There is no notification yet'.tr,
titleStyle: AppStyle.title,
@@ -35,7 +34,6 @@ class NotificationCaptainController extends GetxController {
notificationData = jsonDecode(res);
// sql.insertData(notificationData['message'], TableName.captainNotification);
// print(notificationData);
isLoading = false;
update();
}

View File

@@ -21,7 +21,6 @@ class PassengerNotificationController extends GetxController {
link: AppLink.getNotificationPassenger,
payload: {'passenger_id': box.read(BoxName.passengerID)});
if (res == "failure") {
// print(res);
Get.defaultDialog(
title: 'There is no notification yet'.tr,
titleStyle: AppStyle.title,
@@ -36,7 +35,6 @@ class PassengerNotificationController extends GetxController {
notificationData = jsonDecode(res);
// sql.insertData(notificationData['message'], TableName.captainNotification);
// print(notificationData);
isloading = false;
update();
}

View File

@@ -15,7 +15,6 @@ class RideAvailableController extends GetxController {
var res = await CRUD().get(link: AppLink.getRideWaiting, payload: {});
if (res != 'failure') {
rideAvailableMap = jsonDecode(res);
print(rideAvailableMap);
isLoading = false;
update();
} else {

View File

@@ -31,7 +31,6 @@ class DriverWalletHistoryController extends GetxController {
));
}
archive = jsonDecode(res)['message'];
print(archive);
isLoading = false;
update();
}

View File

@@ -20,7 +20,6 @@ class PassengerWalletHistoryController extends GetxController {
payload: {'passenger_id': box.read(BoxName.passengerID)});
if (res != 'failure') {
archive = jsonDecode(res)['message'];
print(archive);
isLoading = false;
update();
} else {

View File

@@ -69,7 +69,6 @@ class PaymentController extends GetxController {
'amount': amount.toString(),
});
var d = jsonDecode(res);
print('paymentToken ${d['message']}');
return d['message'];
}
@@ -79,7 +78,6 @@ class PaymentController extends GetxController {
'amount': amount.toString(),
});
var d = jsonDecode(res);
// print('paymentToken ${d['message']}');
return d['message'];
}
@@ -160,13 +158,11 @@ class PaymentController extends GetxController {
var decod = jsonDecode(value);
if (decod["status"] == "success") {
print(totalPassenger);
var firstElement = decod["message"][0];
totalPassenger = totalPassenger -
(totalPassenger * int.parse(firstElement['amount']));
MapPassengerController().promoTaken = true;
update();
print(totalPassenger);
}
});
}
@@ -193,7 +189,6 @@ class PaymentController extends GetxController {
method();
} else {
// Authentication failed, handle accordingly
print('Authentication failed');
}
} else {
// Local authentication not available, proceed with payment without authentication
@@ -264,7 +259,6 @@ class PaymentController extends GetxController {
// Convert the res object to a JSON object
final jsonResponse = jsonDecode(res);
print(jsonResponse);
// Check if the client_secret property exists and is not null
if (jsonResponse.containsKey('client_secret') &&
jsonResponse['client_secret'] != null) {
@@ -292,7 +286,6 @@ class PaymentController extends GetxController {
// User authenticated successfully, proceed with payment
if (selectedAmount != 0) {
print(selectedAmount);
changePromoSheetDialogue();
Navigator.of(context).push(
MaterialPageRoute(
@@ -347,17 +340,14 @@ class PaymentController extends GetxController {
],
note: "Contact us for any questions on your order.".tr,
onSuccess: (Map params) async {
print("onSuccess: $params");
addPassengerWallet();
changePromoSheetDialogue();
await getPassengerWallet();
},
onError: (error) {
print("onError: $error");
Toast.show(context, ' $error'.tr, AppColor.redColor);
},
onCancel: (params) {
print('cancelled: $params');
Toast.show(context, 'Pyament Cancelled .'.tr,
AppColor.yellowColor);
}),
@@ -369,7 +359,6 @@ class PaymentController extends GetxController {
}
} else {
// Authentication failed, handle accordingly
print('Authentication failed');
}
}
} catch (e) {
@@ -383,7 +372,6 @@ class PaymentController extends GetxController {
link: AppLink.getLicense,
payload: {'driverID': box.read(BoxName.driverID)});
licenseDetailsMap = jsonDecode(res);
// print(licenseDetailsMap['message'][0]['name']);
}
Future createConnectAccount() async {
@@ -393,7 +381,6 @@ class PaymentController extends GetxController {
DateTime.parse(licenseDetailsMap['message'][0]['dateOfBirth']);
int currentTimestamp =
(DateTime.now().millisecondsSinceEpoch / 1000).round();
print('Current Unix timestamp: $currentTimestamp');
int day = dob.day;
int month = dob.month;
int year = dob.year;
@@ -454,11 +441,9 @@ class PaymentController extends GetxController {
payload: body,
);
final responseData = jsonDecode(response);
// print(responseData);
final accountId = responseData['id'];
box.write(BoxName.accountIdStripeConnect, accountId);
await updateCaptainAccountBank();
print('accountId = $accountId');
return accountId;
}
@@ -487,10 +472,8 @@ class PaymentController extends GetxController {
payload: body,
);
final responseData = jsonDecode(response);
print(responseData);
final transactionId = responseData['id'];
print('transactionId = $transactionId');
return transactionId;
}
@@ -501,10 +484,7 @@ class PaymentController extends GetxController {
if (response.statusCode == 200) {
ip = jsonDecode(response.body)['ip'];
print(ip);
} else {
print('Request failed with status: ${response.statusCode}');
}
} else {}
}
// 'https://accept.paymob.com/unifiedcheckout/?publicKey=egy_pk_live_mbjDC9Ni6FSHKmsz8sOHiVk2xd7oWRve&clientSecret=egy_sk_live_c0904e9cf04506ae64f818d4e075b4a957e3713fdf7a22cb7da30a29e72442b5'
@@ -526,16 +506,7 @@ class PaymentController extends GetxController {
amountInCents: newAmount, // 19.00 EGP
billingData: PaymobBillingData(),
onPayment: (PaymobResponse response) {
print('Success: ${response.success}');
print('Transaction ID: ${response.transactionID}');
print('Response Code: ${response.responseCode}');
// print('Message: ${response.message}');
print(box.read(BoxName.passengerWalletTotal));
print(box.read(BoxName.name));
print(box.read(BoxName.phone));
// print();
},
onPayment: (PaymobResponse response) {},
);
if (response!.responseCode == 'APPROVED') {
@@ -577,7 +548,6 @@ class PaymentController extends GetxController {
}
} else {
// Authentication failed, handle accordingly
print('Authentication failed');
}
} else {
final PaymobResponse? response = await PaymobPayment.instance.pay(
@@ -585,12 +555,7 @@ class PaymentController extends GetxController {
currency: currency, //"EGP",
amountInCents: newAmount, // 19.00 EGP
billingData: PaymobBillingData(),
onPayment: (PaymobResponse response) {
// print('Success: ${response.success}');
// print('Transaction ID: ${response.transactionID}');
// print('Response Code: ${response.responseCode}');
// print('Message: ${response.message}');
},
onPayment: (PaymobResponse response) {},
);
if (response!.responseCode == 'APPROVED') {
@@ -679,17 +644,7 @@ class PaymentController extends GetxController {
amountInCents: newAmount, // 19.00 EGP
billingData: PaymobBillingDataWallet(),
onPayment: (PaymobResponseWallet response) {
// print('Success: ${response.success}');
// print('Transaction ID: ${response.transactionID}');
// print('Response Code: ${response.responseCode}');
// print('Message: ${response.message}');
// print(box.read(BoxName.passengerWalletTotal));//
// print(box.read(BoxName.name));
// print(box.read(BoxName.phone));
// print();
},
onPayment: (PaymobResponseWallet response) {},
);
if (response!.success == true && response.responseCode == '200') {
@@ -748,7 +703,6 @@ class PaymentController extends GetxController {
}
} else {
// Authentication failed, handle accordingly
print('Authentication failed');
}
} else {
final PaymobResponse? response = await PaymobPayment.instance.pay(
@@ -756,12 +710,7 @@ class PaymentController extends GetxController {
currency: currency, //"EGP",
amountInCents: newAmount, // 19.00 EGP
billingData: PaymobBillingData(),
onPayment: (PaymobResponse response) {
// print('Success: ${response.success}');
// print('Transaction ID: ${response.transactionID}');
// print('Response Code: ${response.responseCode}');
// print('Message: ${response.message}');
},
onPayment: (PaymobResponse response) {},
);
if (response!.responseCode == 'APPROVED') {

View File

@@ -33,8 +33,6 @@ class PaymobManager extends GetxController {
update();
return paymentKey;
} catch (e) {
print("Exc==========================================");
print(e.toString());
throw Exception();
}
}
@@ -46,7 +44,6 @@ class PaymobManager extends GetxController {
paymentToken = await PaymobManager().getPaymentKey(amount, currency);
} on Exception catch (e) {
// Handle errors gracefully, e.g., display error message to user
print("Error fetching payment key: $e");
return;
}
@@ -71,23 +68,17 @@ class PaymobManager extends GetxController {
if (response.statusCode == 200) {
final paymentData = response.data; // Assuming JSON response
print("redirection_url: ${paymentData['iframe_redirection_url']}");
// Navigate to success screen or display success message
launchUrl(Uri.parse(paymentData['iframe_redirection_url']));
} else {
// Payment failed: Handle errors (e.g., display error message)
print("Payment failed: ${response.statusCode} - ${response.data}");
}
} on DioError catch (e) {
// Handle network or Dio-related errors
print("Error making payment request: $e");
}
}
Future<String> _getStatusAfterPaid() async {
print(authanticationToken1);
print(orderId1);
final dio.Response response = await Dio().post(
"https://accept.paymob.com/api/ecommerce/orders/transaction_inquiry",
data: {
@@ -95,8 +86,6 @@ class PaymobManager extends GetxController {
"merchant_order_id": "970960",
"order_id": orderId1
});
print(response.data);
print(response.data['success']);
return response.data["success"];
}
@@ -123,8 +112,6 @@ class PaymobManager extends GetxController {
"delivery_needed": "false",
"items": [],
});
print('id is');
print(response.data["id"]);
return response.data["id"];
}

View File

@@ -79,7 +79,6 @@ class PaymobPayment {
'api_key': _apiKey,
},
);
print(response.data['token']);
return response.data['token'];
} catch (e) {
@@ -105,7 +104,6 @@ class PaymobPayment {
"items": items,
},
);
print(response.data['id']);
return response.data['id'];
} catch (e) {
@@ -138,7 +136,6 @@ class PaymobPayment {
if (message != null) {
throw Exception(message);
}
print(response.data['token']);
return response.data['token'];
}

View File

@@ -79,7 +79,6 @@ class PaymobPaymentWallet {
'api_key': _apiKey,
},
);
print(response.data['token']);
return response.data['token'];
} catch (e) {
rethrow;
@@ -104,7 +103,6 @@ class PaymobPaymentWallet {
"items": items,
},
);
print(response.data['id']);
return response.data['id'];
} catch (e) {
rethrow;
@@ -136,7 +134,6 @@ class PaymobPaymentWallet {
// if (message != null) {
// throw Exception(message);
// }
print(response.data['token']);
return response.data['token'];
}
@@ -161,16 +158,13 @@ class PaymobPaymentWallet {
if (response.statusCode == 200) {
final paymentData = response.data; // Assuming JSON response
print("redirection_url: ${paymentData['iframe_redirection_url']}");
return paymentData['iframe_redirection_url'];
// Navigate to success screen or display success message
} else {
// Payment failed: Handle errors (e.g., display error message)
print("Payment failed: ${response.statusCode} - ${response.data}");
}
} on DioError catch (e) {
// Handle network or Dio-related errors
print("Error making payment request: $e");
}
return '';
}

View File

@@ -69,7 +69,6 @@ class CaptainProfileController extends GetxController {
var d = jsonDecode(res);
captainProfileData = d['message'];
update();
print(d['message']);
box.write(BoxName.sexDriver, d['message']['gender']);
box.write(BoxName.dobDriver, d['message']['birthdate']);
box.write(BoxName.vin, d['message']['vin']);

View File

@@ -230,19 +230,13 @@ class LoginPage extends StatelessWidget {
User? user =
await authController.signInWithApple();
if (user != null) {
print(
"Successfully signed in: ${user.email}");
print(
"Successfully signed in: ${user.uid}");
box.write(BoxName.driverID, user.uid);
box.write(
BoxName.emailDriver, user.email);
await GoogleSignInHelper
.signInFromLogin();
// Navigate to another screen or perform other actions
} else {
print("Sign-in failed");
}
} else {}
},
kolor: AppColor.primaryColor,
)

View File

@@ -95,8 +95,7 @@ class FrequentlyQuestionsPage extends StatelessWidget {
onTap: () {
Get.find<MapPassengerController>()
.getDialog('title', 'midTitle', () {
print(
'dd'); //todo add in this dialog papers for driver
; //todo add in this dialog papers for driver
});
},
child: Text(

View File

@@ -52,9 +52,6 @@ class _PassengerCallPageState extends State<PassengerCallPage> {
super.initState();
_remoteUid = int.parse(widget.remoteID);
uid = int.parse(box.read(BoxName.phone));
print('remoteid is ${widget.remoteID}');
print('token is ${widget.token}');
print('channelName is ${widget.channelName}');
// Set up an instance of Agora engine
initAgora();
}
@@ -66,8 +63,6 @@ class _PassengerCallPageState extends State<PassengerCallPage> {
//create an instance of the Agora engine
agoraEngine = createAgoraRtcEngine();
await agoraEngine.initialize(RtcEngineContext(appId: AK.agoraAppId));
print('eeeeeeeeeeeeeeeeeeee');
print(agoraEngine);
// Register the event handler
agoraEngine.registerEventHandler(
RtcEngineEventHandler(

View File

@@ -73,8 +73,6 @@ GetBuilder<MapPassengerController> cancelRidePage() {
value: index,
groupValue: controller.selectedReason,
onChanged: (int? value) {
// print(value);
// print(reasons[index]);
controller.selectReason(
value!,
reasons[index].toString(),

View File

@@ -38,7 +38,6 @@ GetBuilder<MapPassengerController> hexagonClipper() {
),
// IconButton(
// onPressed: () {
// print(controller.dataCarsLocationByPassenger);
// },
// icon: const Icon(Icons.add),
// ),

View File

@@ -102,14 +102,12 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
controller.changePickerShown();
} else {
controller.hintTextDestinationPoint = 'To Work';
print(box.read(BoxName.addWork));
final latLng = LatLng(
double.parse(
box.read(BoxName.addWork).split(',')[0]),
double.parse(
box.read(BoxName.addWork).split(',')[1]),
);
print(latLng);
controller.newMyLocation =
controller.newStartPointLocation;
controller.changeMainBottomMenuMap();
@@ -178,14 +176,12 @@ GetBuilder<MapPassengerController> formSearchPlacesDestenation() {
controller.changePickerShown();
} else {
controller.hintTextDestinationPoint = 'To Home';
print(box.read(BoxName.addHome));
final latLng = LatLng(
double.parse(
box.read(BoxName.addHome).split(',')[0]),
double.parse(
box.read(BoxName.addHome).split(',')[1]),
);
print(latLng);
controller.changeMainBottomMenuMap();
// controller.newMyLocation = latLng;

View File

@@ -59,7 +59,6 @@ GetBuilder<MapPassengerController> formSearchPlaces(int index) {
onTap: () {
controller.startLocationFromMapAll[index] = true;
controller.wayPointIndex = index;
print(controller.wayPointIndex);
Get.back();
// controller.changeMainBottomMenuMap();
controller.changeWayPointStopsSheet();

View File

@@ -354,9 +354,6 @@ class GoogleMapPassengerWidget extends StatelessWidget {
controller.newStartPointLocation = position.target;
}
controller.newMyLocation = position.target;
// print('my' + controller.mylocation.toString());
// print('new' + controller.newMylocation.toString());
},
myLocationEnabled: true,
// liteModeEnabled: true,

View File

@@ -1,17 +1,10 @@
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/constant/table_names.dart';
import 'package:SEFER/controller/functions/crud.dart';
import 'package:SEFER/main.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:path/path.dart' as path;
import '../../../constant/box_name.dart';
import '../../../constant/colors.dart';
import '../../../constant/links.dart';
import '../../../controller/functions/audio_record1.dart';
import '../../../controller/functions/tts.dart';
import '../../../controller/functions/upload_image.dart';
import '../../../controller/home/map_passenger_controller.dart';
GetBuilder<MapPassengerController> leftMainMenuIcons() {
@@ -150,21 +143,14 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
// // String apiKey = AK.payPalSecret;
// // String convertedStringN = credentials.c(
// // credentials.c(credentials.c(apiKey, cs), cC), cn);
// // print('Converted v: $convertedStringN');
//
// // String retrievedStringS = credentials.r(
// // credentials.r(credentials.r(convertedStringN, cn), cC),
// // cs);
// // print('Retrieved String: $retrievedStringS');
// // //
// // if (retrievedStringS == apiKey) {
// // print('same');
// // }
//
// // print(box.read(BoxName.passengerWalletTotal));
// // print(box.read(BoxName.name));
// // print(box.read(BoxName.phone));
// // print(box.read(BoxName.email));
// // await Get.find<PaymentController>()
// // .payWithPayMob(context, '1100', 'EGP');
// // Initiates a payment with a card using the FlutterPaymob instance
@@ -172,7 +158,6 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
// // NotificationController()
// // .showNotification('Order', 'hi this is', 'tone1');
// // Get.to(() => DriverCallPage());
// // print(controller.carLocationsModels);
// // controller.getKazanPercent();
// // PassengerCallPage(
// // channelName: '',
@@ -180,7 +165,6 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
// // remoteID: '',
// // )
// // Get.to(() => const CallPage());
// // print(box.read(BoxName.lang));
// await Get.find<AudioRecorderController>().startRecording();
// },
// icon: Icon(

View File

@@ -384,7 +384,6 @@ class FaviouratePlacesDialog extends StatelessWidget {
onTap: () async {
List favoritePlaces =
await sql.getAllData(TableName.placesFavorite);
// print(favoritePlaces);
Get.defaultDialog(
title: 'Favorite Places'.tr,
content: SizedBox(

View File

@@ -1,5 +1,3 @@
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_font_icons/flutter_font_icons.dart';

View File

@@ -92,7 +92,6 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
onPressed: () async {
List favoritePlaces = await sql
.getAllData(TableName.placesFavorite);
print(favoritePlaces);
Get.defaultDialog(
title: 'Favorite Places'.tr,
content: SizedBox(
@@ -201,7 +200,6 @@ class PickerAnimtionContainerFormPlaces extends StatelessWidget {
controller.bottomSheet();
// await sql
// .getAllData(TableName.placesFavorite)
// .then((value) => print(value));
},
),
if (controller.isPickerShown &&

View File

@@ -264,7 +264,6 @@ class RideBeginPassenger extends StatelessWidget {
width: Get.width * .15,
child: IconButton(
onPressed: () async {
print(box.read(BoxName.sosPhonePassenger));
if (box.read(BoxName.sosPhonePassenger) == null ||
box.read(BoxName.sosPhonePassenger) == 'sos') {
{
@@ -278,7 +277,6 @@ class RideBeginPassenger extends StatelessWidget {
.read(BoxName.sosPhonePassenger)
.toString();
// phoneNumber = phoneNumber.replaceAll('0', '');
print(phoneNumber); // Output: 798583061
var phone = box.read(BoxName.countryCode) ==
'Egypt'
? '+2${box.read(BoxName.sosPhonePassenger)}'

View File

@@ -138,7 +138,6 @@ class RideFromStartApp extends StatelessWidget {
),
IconButton(
onPressed: () async {
print(box.read(BoxName.sosPhonePassenger));
if (box.read(BoxName.sosPhonePassenger) == null ||
box.read(BoxName.sosPhonePassenger) == 'sos') {
{
@@ -152,7 +151,6 @@ class RideFromStartApp extends StatelessWidget {
.read(BoxName.sosPhonePassenger)
.toString();
// phoneNumber = phoneNumber.replaceAll('0', '');
print(phoneNumber); // Output: 798583061
var phone =
// '+${box.read(BoxName.countryCode)}${box.read(BoxName.sosPhonePassenger)}';
'${box.read(BoxName.sosPhonePassenger)}';

View File

@@ -49,7 +49,6 @@ class OrderHistory extends StatelessWidget {
onTap: () {
String mapUrl =
'https://www.google.com/maps/dir/${rides['start_location']}/${rides['end_location']}/';
// print(mapUrl);
showInBrowser(mapUrl);
},
child: Padding(

View File

@@ -138,9 +138,7 @@ class PromosPassengerPage extends StatelessWidget {
textStyle: AppStyle.title),
],
isRepeatingAnimation: true,
onTap: () {
print("Tap Event");
},
onTap: () {},
),
Text(
rides['description'],