Update: 2026-06-13 00:57:17

This commit is contained in:
Hamza-Ayed
2026-06-13 00:57:17 +03:00
parent 7893b2dc07
commit cb1b2d01df
41 changed files with 75392 additions and 9474 deletions

View File

@@ -265,6 +265,17 @@ class HomeCaptainController extends GetxController {
);
}
double get minPointsThreshold {
String country = box.read(BoxName.countryCode) ?? 'Syria';
if (country == 'Jordan') {
return -3.0;
} else if (country == 'Egypt') {
return -200.0;
} else {
return -200.0; // Default (Syria / other)
}
}
void onButtonSelected() {
if (!Get.isRegistered<CaptainWalletController>()) {
Get.put(CaptainWalletController());
@@ -278,7 +289,7 @@ class HomeCaptainController extends GetxController {
try {
_checkFatigueBeforeOnline(); // Throws exception if tired
if (double.parse(totalPoints) > -200) {
if (double.parse(totalPoints) > minPointsThreshold) {
locationController.startLocationUpdates();
HapticFeedback.heavyImpact();
activeStartTime = DateTime.now();
@@ -455,8 +466,8 @@ class HomeCaptainController extends GetxController {
await sql.getCustomQuery(customQuery);
countRefuse = results[0]['count'].toString();
update();
if (double.parse(totalPoints) <= -200) {
// if (int.parse(countRefuse) > 3 || double.parse(totalPoints) <= -200) {
if (double.parse(totalPoints) <= minPointsThreshold) {
// if (int.parse(countRefuse) > 3 || double.parse(totalPoints) <= minPointsThreshold) {
locationController.stopLocationUpdates();
activeStartTime = null;
activeTimer?.cancel();