Update: 2026-06-29 00:07:33
This commit is contained in:
@@ -86,21 +86,21 @@ class DashboardController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
sendSMSMethod() async {
|
||||
if (formKey.currentState!.validate()) {
|
||||
for (var phoneNumber in box.read(BoxName.tokensDrivers)['message']) {
|
||||
// for (var i = 0; i < 2; i++) {
|
||||
await CRUD().sendSmsEgypt(
|
||||
phoneNumber['phone'].toString(),
|
||||
// box.read(BoxName.tokensDrivers)['message'][i]['phone'].toString(),
|
||||
smsText.text,
|
||||
);
|
||||
// print('CRUD().phoneDriversTest.: ${phoneNumber['phone']}');
|
||||
Future.delayed(const Duration(microseconds: 20));
|
||||
}
|
||||
Get.back();
|
||||
}
|
||||
}
|
||||
// sendSMSMethod() async {
|
||||
// if (formKey.currentState!.validate()) {
|
||||
// for (var phoneNumber in box.read(BoxName.tokensDrivers)['message']) {
|
||||
// // for (var i = 0; i < 2; i++) {
|
||||
// await CRUD().sendSmsEgypt(
|
||||
// phoneNumber['phone'].toString(),
|
||||
// // box.read(BoxName.tokensDrivers)['message'][i]['phone'].toString(),
|
||||
// smsText.text,
|
||||
// );
|
||||
// // print('CRUD().phoneDriversTest.: ${phoneNumber['phone']}');
|
||||
// Future.delayed(const Duration(microseconds: 20));
|
||||
// }
|
||||
// Get.back();
|
||||
// }
|
||||
// }
|
||||
|
||||
@override
|
||||
void onInit() async {
|
||||
|
||||
@@ -26,7 +26,10 @@ class OtpHelper extends GetxController {
|
||||
/// إرسال OTP
|
||||
static Future<bool> sendOtp(String phoneNumber) async {
|
||||
try {
|
||||
// await CRUD().getJWT();
|
||||
final detectedCountry = AppLink.detectCountryFromPhone(phoneNumber);
|
||||
if (detectedCountry.isNotEmpty) {
|
||||
await box.write(BoxName.countryCode, detectedCountry);
|
||||
}
|
||||
final response = await CRUD().post(
|
||||
link: _sendOtpUrl,
|
||||
payload: {'receiver': phoneNumber, 'user_type': 'admin'},
|
||||
|
||||
@@ -48,7 +48,8 @@ class CRUD {
|
||||
final jwt = decodedResponse1['jwt'];
|
||||
Log.print('jwt: $jwt');
|
||||
await box.write(BoxName.jwt, X.c(X.c(X.c(jwt, cn), cC), cs));
|
||||
await storage.write(key: BoxName.jwt, value: X.c(X.c(X.c(jwt, cn), cC), cs));
|
||||
await storage.write(
|
||||
key: BoxName.jwt, value: X.c(X.c(X.c(jwt, cn), cC), cs));
|
||||
// await AppInitializer().getKey();
|
||||
}
|
||||
}
|
||||
@@ -448,8 +449,7 @@ class CRUD {
|
||||
return response.statusCode;
|
||||
}
|
||||
|
||||
Future allMethodForAI(String prompt, driverID, imagePath) async {
|
||||
}
|
||||
Future allMethodForAI(String prompt, driverID, imagePath) async {}
|
||||
|
||||
Map<String, List<Map<String, String>>> getAllTextValuesWithLineNumbers(
|
||||
Map json) {
|
||||
@@ -569,7 +569,6 @@ class CRUD {
|
||||
return response.statusCode;
|
||||
}
|
||||
|
||||
|
||||
Future<dynamic> kazumiSMS({
|
||||
required String link,
|
||||
Map<String, dynamic>? payload,
|
||||
@@ -594,25 +593,6 @@ class CRUD {
|
||||
} else {}
|
||||
}
|
||||
|
||||
Future<dynamic> sendSmsEgypt(String phone, otp) async {
|
||||
// String sender = await getSender();
|
||||
var headers = {'Content-Type': 'application/json'};
|
||||
var body = jsonEncode({
|
||||
"username": "Sefer",
|
||||
"password": "E)Pu=an/@Z",
|
||||
"message": otp,
|
||||
"language": "e",
|
||||
"sender": "Sefer Egy",
|
||||
"receiver": phone
|
||||
});
|
||||
|
||||
await _client.post(
|
||||
Uri.parse(AppLink.sendSms),
|
||||
body: body,
|
||||
headers: headers,
|
||||
);
|
||||
}
|
||||
|
||||
Future<dynamic> postPayMob({
|
||||
required String link,
|
||||
Map<String, dynamic>? payload,
|
||||
|
||||
Reference in New Issue
Block a user