25-5-30/1
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
import 'dart:convert';
|
||||
import 'package:crypto/crypto.dart';
|
||||
|
||||
@@ -13,8 +12,6 @@ import 'package:sefer_driver/controller/auth/captin/login_captin_controller.dart
|
||||
import 'package:sefer_driver/controller/firebase/firbase_messge.dart';
|
||||
import 'package:sefer_driver/controller/firebase/local_notification.dart';
|
||||
import 'package:sefer_driver/controller/functions/crud.dart';
|
||||
import 'package:sefer_driver/controller/functions/device_info.dart';
|
||||
import 'package:sefer_driver/controller/notification/notification_captain_controller.dart';
|
||||
import 'package:sefer_driver/main.dart';
|
||||
import 'package:sefer_driver/views/home/Captin/home_captain/home_captin.dart';
|
||||
import 'package:sefer_driver/views/widgets/error_snakbar.dart';
|
||||
@@ -397,16 +394,13 @@ class AI extends GetxController {
|
||||
update();
|
||||
|
||||
var payload = {
|
||||
'first_name': EncryptionHelper.instance.encryptData(
|
||||
responseNonIdCardFront['full_name'].toString().split(' ')[0]) ??
|
||||
'Not specified',
|
||||
'last_name': EncryptionHelper.instance.encryptData(
|
||||
responseNonIdCardFront['full_name'].toString().split(' ').last) ??
|
||||
'Not specified',
|
||||
'email': EncryptionHelper.instance
|
||||
.encryptData(box.read(BoxName.emailDriver))
|
||||
?.toString() ??
|
||||
'Not specified',
|
||||
'first_name':
|
||||
(responseNonIdCardFront['full_name'].toString().split(' ')[0]) ??
|
||||
'Not specified',
|
||||
'last_name':
|
||||
(responseNonIdCardFront['full_name'].toString().split(' ').last) ??
|
||||
'Not specified',
|
||||
'email': (box.read(BoxName.emailDriver))?.toString() ?? 'Not specified',
|
||||
'phone': box.read(BoxName.phoneDriver)?.toString() ?? 'Not specified',
|
||||
'id': box.read(BoxName.driverID)?.toString() ?? 'Not specified',
|
||||
'password':
|
||||
@@ -416,16 +410,13 @@ class AI extends GetxController {
|
||||
.passwordController
|
||||
.text
|
||||
.toString(),
|
||||
'gender': EncryptionHelper.instance
|
||||
.encryptData(responseNonIdCardFront['gender'].toString()) ??
|
||||
'Not specified',
|
||||
'gender':
|
||||
(responseNonIdCardFront['gender'].toString()) ?? 'Not specified',
|
||||
'license_type': 'Foreign',
|
||||
'national_number': EncryptionHelper.instance
|
||||
.encryptData(responseNonIdCardFront['passport_no'].toString()) ??
|
||||
'Not specified',
|
||||
'name_arabic': EncryptionHelper.instance
|
||||
.encryptData(responseNonIdCardFront['full_name'].toString()) ??
|
||||
'Not specified',
|
||||
'national_number':
|
||||
(responseNonIdCardFront['passport_no'].toString()) ?? 'Not specified',
|
||||
'name_arabic':
|
||||
(responseNonIdCardFront['full_name'].toString()) ?? 'Not specified',
|
||||
'name_english': 'Not specified',
|
||||
'issue_date':
|
||||
responseNonIdCardBack['issueDate']?.toString() ?? 'Not specified',
|
||||
@@ -437,31 +428,23 @@ class AI extends GetxController {
|
||||
? responseIdEgyptDriverLicense['license_categories'].join(', ')
|
||||
: responseIdEgyptDriverLicense['license_categories']?.toString() ??
|
||||
'Not specified',
|
||||
'address': EncryptionHelper.instance
|
||||
.encryptData(responseNonIdCardFront['address'].toString()) ??
|
||||
'Not specified',
|
||||
'card_id': EncryptionHelper.instance
|
||||
.encryptData(responseNonIdCardFront['card_id'].toString()) ??
|
||||
'Not specified',
|
||||
'occupation': EncryptionHelper.instance
|
||||
.encryptData(responseNonIdCardBack['workStatus'].toString()) ??
|
||||
'Not specified',
|
||||
'address':
|
||||
(responseNonIdCardFront['address'].toString()) ?? 'Not specified',
|
||||
'card_id':
|
||||
(responseNonIdCardFront['card_id'].toString()) ?? 'Not specified',
|
||||
'occupation':
|
||||
(responseNonIdCardBack['workStatus'].toString()) ?? 'Not specified',
|
||||
'education': 'Not specified',
|
||||
'licenseIssueDate':
|
||||
responseNonIdCardBack['issueDate']?.toString() ?? 'Not specified',
|
||||
'religion': EncryptionHelper.instance
|
||||
.encryptData(responseNonIdCardFront['country'].toString()) ??
|
||||
'Not specified',
|
||||
'religion':
|
||||
(responseNonIdCardFront['country'].toString()) ?? 'Not specified',
|
||||
'status': 'yet',
|
||||
'birthdate': EncryptionHelper.instance
|
||||
.encryptData(responseNonIdCardFront['birthdate'].toString()) ??
|
||||
'Not specified',
|
||||
'birthdate':
|
||||
(responseNonIdCardFront['birthdate'].toString()) ?? 'Not specified',
|
||||
'maritalStatus': 'Not specified',
|
||||
'site': EncryptionHelper.instance
|
||||
.encryptData(responseNonIdCardFront['address'].toString()) ??
|
||||
'Not specified',
|
||||
'employmentType': EncryptionHelper.instance
|
||||
.encryptData(responseNonIdCardBack['residencyType'].toString()) ??
|
||||
'site': (responseNonIdCardFront['address'].toString()) ?? 'Not specified',
|
||||
'employmentType': (responseNonIdCardBack['residencyType'].toString()) ??
|
||||
'Not specified',
|
||||
};
|
||||
|
||||
@@ -517,32 +500,22 @@ class AI extends GetxController {
|
||||
String hashedPassword = shortHash(pass);
|
||||
|
||||
var payload = {
|
||||
'first_name': EncryptionHelper.instance.encryptData(
|
||||
responseIdEgyptDriverLicense['firstName'].toString()) ??
|
||||
'first_name': (responseIdEgyptDriverLicense['firstName'].toString()) ??
|
||||
'Not specified',
|
||||
'last_name': EncryptionHelper.instance.encryptData(
|
||||
responseIdEgyptDriverLicense['lastName'].toString()) ??
|
||||
'Not specified',
|
||||
'email': EncryptionHelper.instance
|
||||
.encryptData(box.read(BoxName.emailDriver))
|
||||
.toString() ??
|
||||
'last_name': (responseIdEgyptDriverLicense['lastName'].toString()) ??
|
||||
'Not specified',
|
||||
'email': (box.read(BoxName.emailDriver)).toString() ?? 'Not specified',
|
||||
'phone': box.read(BoxName.phoneDriver)?.toString() ?? 'Not specified',
|
||||
'id': box.read(BoxName.driverID)?.toString() ?? 'Not specified',
|
||||
'password': hashedPassword.toString(),
|
||||
'gender': EncryptionHelper.instance
|
||||
.encryptData(responseIdEgyptBack['gender'].toString()) ??
|
||||
'Not specified',
|
||||
'license_type': EncryptionHelper.instance.encryptData(
|
||||
responseIdEgyptDriverLicense['license_type'].toString()) ??
|
||||
'Not specified',
|
||||
'national_number': EncryptionHelper.instance
|
||||
.encryptData(responseIdEgyptBack['nationalID'].toString()) ??
|
||||
'Not specified',
|
||||
'name_arabic': EncryptionHelper.instance
|
||||
.encryptData(responseIdEgyptDriverLicense['name_arabic'].toString()),
|
||||
'name_english': EncryptionHelper.instance
|
||||
.encryptData(responseIdEgyptDriverLicense['name_english'].toString()),
|
||||
'gender': (responseIdEgyptBack['gender'].toString()) ?? 'Not specified',
|
||||
'license_type':
|
||||
(responseIdEgyptDriverLicense['license_type'].toString()) ??
|
||||
'Not specified',
|
||||
'national_number':
|
||||
(responseIdEgyptBack['nationalID'].toString()) ?? 'Not specified',
|
||||
'name_arabic': (responseIdEgyptDriverLicense['name_arabic'].toString()),
|
||||
'name_english': (responseIdEgyptDriverLicense['name_english'].toString()),
|
||||
'issue_date': responseIdEgyptDriverLicense['issue_date']?.toString() ??
|
||||
'Not specified',
|
||||
'expiry_date': responseIdEgyptDriverLicense['expiry_date']?.toString() ??
|
||||
@@ -552,36 +525,29 @@ class AI extends GetxController {
|
||||
? responseIdEgyptDriverLicense['license_categories'].join(', ')
|
||||
: responseIdEgyptDriverLicense['license_categories']?.toString() ??
|
||||
'Not specified',
|
||||
'address': EncryptionHelper.instance
|
||||
.encryptData(responseIdEgyptFront['address'].toString()) ??
|
||||
'Not specified',
|
||||
'card_id': EncryptionHelper.instance
|
||||
.encryptData(responseIdEgyptFront['card_id'].toString()) ??
|
||||
'Not specified',
|
||||
'occupation': EncryptionHelper.instance
|
||||
.encryptData(responseIdEgyptBack['occupation'].toString()) ??
|
||||
'Not specified',
|
||||
'education': EncryptionHelper.instance
|
||||
.encryptData(responseIdEgyptBack['occupation'].toString()) ??
|
||||
'Not specified',
|
||||
'address':
|
||||
(responseIdEgyptFront['address'].toString()) ?? 'Not specified',
|
||||
'card_id':
|
||||
(responseIdEgyptFront['card_id'].toString()) ?? 'Not specified',
|
||||
'occupation':
|
||||
(responseIdEgyptBack['occupation'].toString()) ?? 'Not specified',
|
||||
'education':
|
||||
(responseIdEgyptBack['occupation'].toString()) ?? 'Not specified',
|
||||
'licenseIssueDate':
|
||||
responseIdEgyptDriverLicense['issue_date'].toString() ??
|
||||
'Not specified',
|
||||
'religion': EncryptionHelper.instance
|
||||
.encryptData(responseIdEgyptBack['religion'].toString()) ??
|
||||
'Not specified',
|
||||
'religion':
|
||||
(responseIdEgyptBack['religion'].toString()) ?? 'Not specified',
|
||||
'status': 'yet',
|
||||
'birthdate': EncryptionHelper.instance.encryptData(extractDOB(
|
||||
'birthdate': (extractDOB(
|
||||
responseIdEgyptDriverLicense['national_number'].toString())),
|
||||
'maritalStatus': EncryptionHelper.instance
|
||||
.encryptData(responseIdEgyptBack['maritalStatus'].toString()) ??
|
||||
'Not specified',
|
||||
'site': EncryptionHelper.instance.encryptData(
|
||||
responseIdEgyptDriverLicense['address'].toString()) ??
|
||||
'Not specified',
|
||||
'employmentType': EncryptionHelper.instance.encryptData(
|
||||
responseIdEgyptDriverLicense['employmentType'].toString()) ??
|
||||
'maritalStatus':
|
||||
(responseIdEgyptBack['maritalStatus'].toString()) ?? 'Not specified',
|
||||
'site': (responseIdEgyptDriverLicense['address'].toString()) ??
|
||||
'Not specified',
|
||||
'employmentType':
|
||||
(responseIdEgyptDriverLicense['employmentType'].toString()) ??
|
||||
'Not specified',
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -624,8 +590,7 @@ class AI extends GetxController {
|
||||
var res = await CRUD().post(link: AppLink.addCriminalDocuments, payload: {
|
||||
"driverId": box.read(BoxName.driverID),
|
||||
"IssueDate": responseCriminalRecordEgypt['IssueDate'],
|
||||
"InspectionResult": EncryptionHelper.instance
|
||||
.encryptData(responseCriminalRecordEgypt['InspectionResult']),
|
||||
"InspectionResult": (responseCriminalRecordEgypt['InspectionResult']),
|
||||
});
|
||||
if (res != 'failure') {
|
||||
mySnackbarSuccess('uploaded sucssefuly'.tr);
|
||||
@@ -639,19 +604,16 @@ class AI extends GetxController {
|
||||
var res = await CRUD().post(link: AppLink.addRegisrationCar, payload: {
|
||||
'driverID': box.read(BoxName.driverID),
|
||||
'vin': responseIdCardDriverEgyptBack['chassis'].toString(),
|
||||
'car_plate': EncryptionHelper.instance.encryptData(
|
||||
responseIdCardDriverEgyptFront['car_plate'].toString()),
|
||||
'car_plate': (responseIdCardDriverEgyptFront['car_plate'].toString()),
|
||||
'make': (responseIdCardDriverEgyptBack['make'].toString()),
|
||||
'model': (responseIdCardDriverEgyptBack['model']),
|
||||
'year': responseIdCardDriverEgyptBack['year'].toString(),
|
||||
'expiration_date':
|
||||
responseIdCardDriverEgyptFront['LicenseExpirationDate'].toString(),
|
||||
'color': responseIdCardDriverEgyptBack['color'],
|
||||
'owner': EncryptionHelper.instance
|
||||
.encryptData(responseIdCardDriverEgyptFront['owner']),
|
||||
'owner': (responseIdCardDriverEgyptFront['owner']),
|
||||
'color_hex': responseIdCardDriverEgyptBack['color_hex'].toString(),
|
||||
'address': EncryptionHelper.instance
|
||||
.encryptData(responseIdCardDriverEgyptFront['address'].toString()),
|
||||
'address': (responseIdCardDriverEgyptFront['address'].toString()),
|
||||
'displacement': responseIdCardDriverEgyptBack['engine'].toString(),
|
||||
'fuel': responseIdCardDriverEgyptBack['fuel'].toString(),
|
||||
'registration_date':
|
||||
@@ -669,8 +631,8 @@ class AI extends GetxController {
|
||||
payload: {
|
||||
'driverID': box.read(BoxName.driverID),
|
||||
'vin': responseIdCardDriverEgyptBack['chassis'].toString(),
|
||||
'car_plate': EncryptionHelper.instance.encryptData(
|
||||
responseIdCardDriverEgyptFront['car_plate'].toString()),
|
||||
'car_plate':
|
||||
(responseIdCardDriverEgyptFront['car_plate'].toString()),
|
||||
'make': (responseIdCardDriverEgyptBack['make'].toString()),
|
||||
'model': (responseIdCardDriverEgyptBack['model']),
|
||||
'year': responseIdCardDriverEgyptBack['year'].toString(),
|
||||
@@ -678,12 +640,10 @@ class AI extends GetxController {
|
||||
responseIdCardDriverEgyptFront['LicenseExpirationDate']
|
||||
.toString(),
|
||||
'color': responseIdCardDriverEgyptBack['color'],
|
||||
'owner': EncryptionHelper.instance
|
||||
.encryptData(responseIdCardDriverEgyptFront['owner']),
|
||||
'owner': (responseIdCardDriverEgyptFront['owner']),
|
||||
'color_hex':
|
||||
responseIdCardDriverEgyptBack['color_hex'].toString(),
|
||||
'address': EncryptionHelper.instance.encryptData(
|
||||
responseIdCardDriverEgyptFront['address'].toString()),
|
||||
'address': (responseIdCardDriverEgyptFront['address'].toString()),
|
||||
'displacement':
|
||||
responseIdCardDriverEgyptBack['engine'].toString(),
|
||||
'fuel': responseIdCardDriverEgyptBack['fuel'].toString(),
|
||||
@@ -695,8 +655,8 @@ class AI extends GetxController {
|
||||
payload: {
|
||||
'driverID': box.read(BoxName.driverID),
|
||||
'vin': responseIdCardDriverEgyptBack['chassis'].toString(),
|
||||
'car_plate': EncryptionHelper.instance.encryptData(
|
||||
responseIdCardDriverEgyptFront['car_plate'].toString()),
|
||||
'car_plate':
|
||||
(responseIdCardDriverEgyptFront['car_plate'].toString()),
|
||||
'make': (responseIdCardDriverEgyptBack['make'].toString()),
|
||||
'model': (responseIdCardDriverEgyptBack['model']),
|
||||
'year': responseIdCardDriverEgyptBack['year'].toString(),
|
||||
@@ -704,12 +664,10 @@ class AI extends GetxController {
|
||||
responseIdCardDriverEgyptFront['LicenseExpirationDate']
|
||||
.toString(),
|
||||
'color': responseIdCardDriverEgyptBack['color'],
|
||||
'owner': EncryptionHelper.instance
|
||||
.encryptData(responseIdCardDriverEgyptFront['owner']),
|
||||
'owner': (responseIdCardDriverEgyptFront['owner']),
|
||||
'color_hex':
|
||||
responseIdCardDriverEgyptBack['color_hex'].toString(),
|
||||
'address': EncryptionHelper.instance.encryptData(
|
||||
responseIdCardDriverEgyptFront['address'].toString()),
|
||||
'address': (responseIdCardDriverEgyptFront['address'].toString()),
|
||||
'displacement':
|
||||
responseIdCardDriverEgyptBack['engine'].toString(),
|
||||
'fuel': responseIdCardDriverEgyptBack['fuel'].toString(),
|
||||
|
||||
Reference in New Issue
Block a user