Update: 2026-06-13 00:57:17
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user