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

@@ -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();