Update: 2026-06-26 17:29:23

This commit is contained in:
Hamza-Ayed
2026-06-26 17:29:23 +03:00
parent a323da29aa
commit 9ded734e38
139 changed files with 1815 additions and 2676 deletions

View File

@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../constant/links.dart';
import '../../views/widgets/snackbar.dart';
import '../functions/crud.dart';
class QualityController extends GetxController {
@@ -21,10 +21,10 @@ class QualityController extends GetxController {
driversBlacklist = res['message']['drivers'] ?? [];
passengersBlacklist = res['message']['passengers'] ?? [];
} else {
Get.snackbar("Error", "Failed to fetch blacklist");
mySnackbarError("Failed to fetch blacklist");
}
} catch (e) {
Get.snackbar("Error", "Network error");
mySnackbarError("Network error");
} finally {
isLoading = false;
update();
@@ -41,13 +41,13 @@ class QualityController extends GetxController {
},
);
if (res is Map && res['status'] == 'success') {
Get.snackbar("Success", "Driver unblocked successfully");
mySnackbarSuccess("Driver unblocked successfully");
fetchBlacklist(); // Refresh
} else {
Get.snackbar("Error", res['message'] ?? "Failed to unblock driver");
mySnackbarError(res['message'] ?? "Failed to unblock driver");
}
} catch (e) {
Get.snackbar("Error", "Network error");
mySnackbarError("Network error");
}
}
@@ -61,13 +61,13 @@ class QualityController extends GetxController {
},
);
if (res is Map && res['status'] == 'success') {
Get.snackbar("Success", "Passenger unblocked successfully");
mySnackbarSuccess("Passenger unblocked successfully");
fetchBlacklist(); // Refresh
} else {
Get.snackbar("Error", res['message'] ?? "Failed to unblock passenger");
mySnackbarError(res['message'] ?? "Failed to unblock passenger");
}
} catch (e) {
Get.snackbar("Error", "Network error");
mySnackbarError("Network error");
}
}
@@ -82,11 +82,11 @@ class QualityController extends GetxController {
if (res is Map && res['status'] == 'success') {
scorecardData = res['message'];
} else {
Get.snackbar("Error", "Failed to fetch scorecard");
mySnackbarError("Failed to fetch scorecard");
scorecardData = {};
}
} catch (e) {
Get.snackbar("Error", "Network error");
mySnackbarError("Network error");
scorecardData = {};
} finally {
isLoading = false;
@@ -94,9 +94,4 @@ class QualityController extends GetxController {
}
}
@override
void onInit() {
super.onInit();
// fetchBlacklist() can be called when opening the page
}
}