Update: 2026-06-26 17:29:23
This commit is contained in:
@@ -121,7 +121,7 @@ https://siromove.com/invite.php?code=$couponCode&app=rider
|
||||
// mySnackbarSuccess('Contacts sync completed successfully!'.tr);
|
||||
}
|
||||
} catch (e) {
|
||||
// mySnackeBarError('An error occurred during contact sync: $e'.tr);
|
||||
// mySnackbarError('An error occurred during contact sync: $e'.tr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ https://siromove.com/invite.php?code=$couponCode&app=rider
|
||||
Get.back(); // إغلاق شاشة التحميل
|
||||
|
||||
if (validContacts.isEmpty) {
|
||||
mySnackeBarError('No contacts with phone numbers found'.tr);
|
||||
mySnackbarError('No contacts with phone numbers found'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -291,12 +291,12 @@ https://siromove.com/invite.php?code=$couponCode&app=rider
|
||||
);
|
||||
} else {
|
||||
log('Permission DENIED', name: 'ContactPicker');
|
||||
mySnackeBarError('Contact permission is required to pick contacts'.tr);
|
||||
mySnackbarError('Contact permission is required to pick contacts'.tr);
|
||||
}
|
||||
} catch (e) {
|
||||
if (Get.isDialogOpen ?? false) Get.back();
|
||||
log('CRITICAL ERROR: $e', name: 'ContactPicker');
|
||||
mySnackeBarError('An error occurred while loading contacts: $e'.tr);
|
||||
mySnackbarError('An error occurred while loading contacts: $e'.tr);
|
||||
}
|
||||
log('=== END: FETCHING CONTACTS ===', name: 'ContactPicker');
|
||||
}
|
||||
@@ -383,7 +383,7 @@ https://siromove.com/invite.php?code=$couponCode&app=rider
|
||||
// refresh stats
|
||||
fetchDriverStats();
|
||||
} else {
|
||||
mySnackeBarError(data['message'] ?? 'Claim failed'.tr);
|
||||
mySnackbarError(data['message'] ?? 'Claim failed'.tr);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -475,13 +475,13 @@ https://siromove.com/invite.php?code=$couponCode&app=rider
|
||||
/// Sends an invitation to a potential new driver.
|
||||
void sendInvite() async {
|
||||
if (invitePhoneController.text.isEmpty) {
|
||||
mySnackeBarError('Please enter a phone number'.tr);
|
||||
mySnackbarError('Please enter a phone number'.tr);
|
||||
return;
|
||||
}
|
||||
String formattedPhoneNumber =
|
||||
CountryLogic.formatCurrentCountryPhone(invitePhoneController.text);
|
||||
if (formattedPhoneNumber.length != 12) {
|
||||
mySnackeBarError('Please enter a correct phone'.tr);
|
||||
mySnackbarError('Please enter a correct phone'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -507,14 +507,14 @@ https://siromove.com/invite.php?code=$couponCode&app=rider
|
||||
launchCommunication('whatsapp', formattedPhoneNumber, message);
|
||||
invitePhoneController.clear();
|
||||
} else {
|
||||
mySnackeBarError("Invite code already used".tr);
|
||||
mySnackbarError("Invite code already used".tr);
|
||||
}
|
||||
}
|
||||
|
||||
/// Sends an invitation to a potential new passenger.
|
||||
void sendInviteToPassenger() async {
|
||||
if (invitePhoneController.text.isEmpty) {
|
||||
mySnackeBarError('Please enter a phone number'.tr);
|
||||
mySnackbarError('Please enter a phone number'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ https://siromove.com/invite.php?code=$couponCode&app=rider
|
||||
|
||||
if (formattedPhoneNumber.length < 12) {
|
||||
// +963 + 9 digits = 12+
|
||||
mySnackeBarError('Please enter a correct phone'.tr);
|
||||
mySnackbarError('Please enter a correct phone'.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -552,7 +552,7 @@ https://siromove.com/invite.php?code=$couponCode&app=rider
|
||||
launchCommunication('whatsapp', formattedPhoneNumber, message);
|
||||
invitePhoneController.clear();
|
||||
} else {
|
||||
mySnackeBarError("Invite code already used".tr);
|
||||
mySnackbarError("Invite code already used".tr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -605,17 +605,17 @@ class LoginDriverController extends GetxController {
|
||||
|
||||
Get.off(() => HomeCaptain());
|
||||
} else {
|
||||
mySnackeBarError('Login failed'.tr);
|
||||
mySnackbarError('Login failed'.tr);
|
||||
isloading = false;
|
||||
update();
|
||||
}
|
||||
} else {
|
||||
mySnackeBarError('Server error'.tr);
|
||||
mySnackbarError('Server error'.tr);
|
||||
isloading = false;
|
||||
update();
|
||||
}
|
||||
} catch (e) {
|
||||
mySnackeBarError('Network error'.tr);
|
||||
mySnackbarError('Network error'.tr);
|
||||
isloading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -116,10 +116,10 @@ class OtpVerificationController extends GetxController {
|
||||
|
||||
Get.offAll(() => HomeCaptain());
|
||||
} else {
|
||||
mySnackeBarError('OTP is incorrect or expired'.tr);
|
||||
mySnackbarError('OTP is incorrect or expired'.tr);
|
||||
}
|
||||
} catch (e) {
|
||||
mySnackeBarError(e.toString());
|
||||
mySnackbarError(e.toString());
|
||||
} finally {
|
||||
isVerifying.value = false;
|
||||
}
|
||||
|
||||
@@ -44,15 +44,15 @@ class PhoneAuthHelper {
|
||||
mySnackbarSuccess('An OTP has been sent to your number.'.tr);
|
||||
return true;
|
||||
} else {
|
||||
mySnackeBarError(data['message'] ?? 'Failed to send OTP.'.tr);
|
||||
mySnackbarError(data['message'] ?? 'Failed to send OTP.'.tr);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
mySnackeBarError('Server error. Please try again.'.tr);
|
||||
mySnackbarError('Server error. Please try again.'.tr);
|
||||
return false;
|
||||
}
|
||||
} catch (e) {
|
||||
// mySnackeBarError('An error occurred: $e');
|
||||
// mySnackbarError('An error occurred: $e');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -99,13 +99,13 @@ class PhoneAuthHelper {
|
||||
Get.to(() => RegistrationView());
|
||||
}
|
||||
} else {
|
||||
mySnackeBarError(data['message'] ?? 'Verification failed.');
|
||||
mySnackbarError(data['message'] ?? 'Verification failed.');
|
||||
}
|
||||
} else {
|
||||
mySnackeBarError('Server error. Please try again.');
|
||||
mySnackbarError('Server error. Please try again.');
|
||||
}
|
||||
} catch (e) {
|
||||
mySnackeBarError('An error occurred: $e');
|
||||
mySnackbarError('An error occurred: $e');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,11 +130,11 @@ class PhoneAuthHelper {
|
||||
// Registration successful, log user in
|
||||
await _handleSuccessfulLogin(data['message']);
|
||||
} else {
|
||||
mySnackeBarError(
|
||||
mySnackbarError(
|
||||
"User with this phone number or email already exists.".tr);
|
||||
}
|
||||
} catch (e) {
|
||||
mySnackeBarError('An error occurred: $e');
|
||||
mySnackbarError('An error occurred: $e');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ class RegisterCaptainController extends GetxController {
|
||||
update();
|
||||
}
|
||||
} else {
|
||||
mySnackeBarError(
|
||||
mySnackbarError(
|
||||
'Phone Number wrong'.tr,
|
||||
);
|
||||
}
|
||||
@@ -285,7 +285,7 @@ class RegisterCaptainController extends GetxController {
|
||||
// }
|
||||
}
|
||||
} else {
|
||||
mySnackeBarError('you must insert token code '.tr);
|
||||
mySnackbarError('you must insert token code '.tr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ class RegistrationController extends GetxController {
|
||||
// // الإرسال للذكاء الاصطناعي
|
||||
// await sendToAI(type, imageFile: outFile);
|
||||
} catch (e) {
|
||||
mySnackeBarError('${'An unexpected error occurred:'.tr} $e');
|
||||
mySnackbarError('${'An unexpected error occurred:'.tr} $e');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ class RegistrationController extends GetxController {
|
||||
Log.print('✅ Uploaded $imageType => $imageUrl');
|
||||
} catch (e, st) {
|
||||
Log.print('❌ Error in choosImage: $e\n$st');
|
||||
mySnackeBarError('Image Upload Failed'.tr);
|
||||
mySnackbarError('Image Upload Failed'.tr);
|
||||
} finally {
|
||||
isloading = false;
|
||||
update();
|
||||
@@ -717,10 +717,10 @@ class RegistrationController extends GetxController {
|
||||
c.loginDriver(driverID, email);
|
||||
} else {
|
||||
final msg = (json?['message'] ?? 'Registration failed.').toString();
|
||||
mySnackeBarError(msg);
|
||||
mySnackbarError(msg);
|
||||
}
|
||||
} catch (e) {
|
||||
mySnackeBarError('Error: $e');
|
||||
mySnackbarError('Error: $e');
|
||||
} finally {
|
||||
client.close();
|
||||
isLoading.value = false;
|
||||
|
||||
Reference in New Issue
Block a user