Update: 2026-06-12 22:40:40
This commit is contained in:
@@ -371,7 +371,8 @@ class RegistrationController extends GetxController {
|
||||
data.forEach((k, v) => request.fields[k] = v);
|
||||
|
||||
// المهلة الزمنية 120 ثانية لتناسب الاتصالات الضعيفة
|
||||
final streamed = await request.send().timeout(const Duration(seconds: 120));
|
||||
final streamed =
|
||||
await request.send().timeout(const Duration(seconds: 120));
|
||||
final res = await http.Response.fromStream(streamed);
|
||||
|
||||
if (res.statusCode != 200) {
|
||||
@@ -469,7 +470,8 @@ class RegistrationController extends GetxController {
|
||||
}
|
||||
|
||||
final statusOk = j['status'] == 'success';
|
||||
final fileUrl = (j['file_url'] ?? j['message']?['file_url'])?.toString();
|
||||
final fileUrl =
|
||||
(j['file_url'] ?? j['message']?['file_url'])?.toString();
|
||||
|
||||
if (resp.statusCode == 200 &&
|
||||
statusOk &&
|
||||
@@ -512,14 +514,23 @@ class RegistrationController extends GetxController {
|
||||
|
||||
final isSyria = box.read(BoxName.countryCode) == 'Syria';
|
||||
|
||||
if (idFrontUrl == null || idFrontUrl.isEmpty ||
|
||||
idBackUrl == null || idBackUrl.isEmpty ||
|
||||
driverLicenseUrl == null || driverLicenseUrl.isEmpty ||
|
||||
(isSyria && (driverLicenseBackUrl == null || driverLicenseBackUrl.isEmpty)) ||
|
||||
profilePicUrl == null || profilePicUrl.isEmpty ||
|
||||
carFrontUrl == null || carFrontUrl.isEmpty ||
|
||||
carBackUrl == null || carBackUrl.isEmpty) {
|
||||
mySnackbarWarning('Please wait for all documents to finish uploading before registering.'.tr);
|
||||
if (idFrontUrl == null ||
|
||||
idFrontUrl.isEmpty ||
|
||||
idBackUrl == null ||
|
||||
idBackUrl.isEmpty ||
|
||||
driverLicenseUrl == null ||
|
||||
driverLicenseUrl.isEmpty ||
|
||||
(isSyria &&
|
||||
(driverLicenseBackUrl == null || driverLicenseBackUrl.isEmpty)) ||
|
||||
profilePicUrl == null ||
|
||||
profilePicUrl.isEmpty ||
|
||||
carFrontUrl == null ||
|
||||
carFrontUrl.isEmpty ||
|
||||
carBackUrl == null ||
|
||||
carBackUrl.isEmpty) {
|
||||
mySnackbarWarning(
|
||||
'Please wait for all documents to finish uploading before registering.'
|
||||
.tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -626,7 +637,8 @@ class RegistrationController extends GetxController {
|
||||
_addField(fields, 'id_front', idFrontUrl);
|
||||
_addField(fields, 'id_back', idBackUrl);
|
||||
_addField(fields, 'driver_license', driverLicenseUrl);
|
||||
if (isSyria) _addField(fields, 'driver_license_back', driverLicenseBackUrl);
|
||||
if (isSyria)
|
||||
_addField(fields, 'driver_license_back', driverLicenseBackUrl);
|
||||
_addField(fields, 'profile_picture', profilePicUrl);
|
||||
_addField(fields, 'criminal_record', criminalRecordUrl);
|
||||
_addField(fields, 'car_license_front', carFrontUrl);
|
||||
@@ -671,7 +683,7 @@ class RegistrationController extends GetxController {
|
||||
final c = Get.isRegistered<LoginDriverController>()
|
||||
? Get.find<LoginDriverController>()
|
||||
: Get.put(LoginDriverController());
|
||||
c.loginWithGoogleCredential(driverID, email);
|
||||
c.loginDriver(driverID, email);
|
||||
} else {
|
||||
final msg = (json?['message'] ?? 'Registration failed.').toString();
|
||||
mySnackeBarError(msg);
|
||||
|
||||
Reference in New Issue
Block a user