Update: 2026-06-25 02:28:33
This commit is contained in:
@@ -31,7 +31,7 @@ class NotificationCaptainController extends GetxController {
|
||||
Get.back();
|
||||
}));
|
||||
}
|
||||
notificationData = jsonDecode(res);
|
||||
notificationData = res;
|
||||
// sql.insertData(notificationData['message'], TableName.captainNotification);
|
||||
|
||||
isLoading = false;
|
||||
|
||||
@@ -26,11 +26,9 @@ class PassengerNotificationController extends GetxController {
|
||||
Get.back();
|
||||
});
|
||||
} else {
|
||||
final decoded = jsonDecode(res);
|
||||
// التحقق من وجود البيانات في 'data' أو 'message'
|
||||
var rawData = decoded['data'] ?? decoded['message'];
|
||||
var rawData = res['data'] ?? res['message'];
|
||||
|
||||
if (decoded['status'] == 'error' || decoded['status'] == 'failure' || rawData == "No notification data found") {
|
||||
if (res['status'] == 'error' || res['status'] == 'failure' || rawData == "No notification data found") {
|
||||
notificationData = {'status': 'success', 'message': []}; // قائمة فارغة لمنع الخطأ في UI
|
||||
} else {
|
||||
// التأكد أننا نخزن قائمة
|
||||
|
||||
@@ -14,7 +14,7 @@ class RideAvailableController extends GetxController {
|
||||
isLoading = true;
|
||||
var res = await CRUD().get(link: AppLink.getRideWaiting, payload: {});
|
||||
if (res != 'failure') {
|
||||
rideAvailableMap = jsonDecode(res);
|
||||
rideAvailableMap = res;
|
||||
isLoading = false;
|
||||
update();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user