Update: 2026-06-25 02:28:33

This commit is contained in:
Hamza-Ayed
2026-06-25 02:28:33 +03:00
parent 1ff13f09ac
commit 98a8a2ae3d
43 changed files with 992 additions and 812 deletions

View File

@@ -48,7 +48,7 @@ class CaptainProfileController extends GetxController {
var res =
await CRUD().post(link: AppLink.updateRegisrationCar, payload: payload);
if (jsonDecode(res)['status'] == 'success') {
if (res is Map && res['status'] == 'success') {
box.write(BoxName.vin, vin.text);
box.write(BoxName.color, color.text);
box.write(BoxName.model, model.text);
@@ -65,20 +65,19 @@ class CaptainProfileController extends GetxController {
var res = await CRUD().get(
link: AppLink.getCaptainProfile,
payload: {'id': box.read(BoxName.driverID)});
if (res != 'failure') {
var d = jsonDecode(res);
captainProfileData = d['message'];
if (res is Map) {
captainProfileData = res['message'];
update();
box.write(BoxName.sexDriver, d['message']['gender']);
box.write(BoxName.dobDriver, d['message']['birthdate']);
box.write(BoxName.vin, d['message']['vin']);
box.write(BoxName.color, d['message']['color']);
box.write(BoxName.model, d['message']['model']);
box.write(BoxName.carPlate, d['message']['car_plate']);
box.write(BoxName.make, d['message']['make']);
box.write(BoxName.year, d['message']['year']);
box.write(BoxName.expirationDate, d['message']['expiration_date']);
// box.write(BoxName.acc, d['message']['accountBank']);
box.write(BoxName.sexDriver, captainProfileData['gender']);
box.write(BoxName.dobDriver, captainProfileData['birthdate']);
box.write(BoxName.vin, captainProfileData['vin']);
box.write(BoxName.color, captainProfileData['color']);
box.write(BoxName.model, captainProfileData['model']);
box.write(BoxName.carPlate, captainProfileData['car_plate']);
box.write(BoxName.make, captainProfileData['make']);
box.write(BoxName.year, captainProfileData['year']);
box.write(BoxName.expirationDate, captainProfileData['expiration_date']);
// box.write(BoxName.acc, captainProfileData['accountBank']);
update();
}