update goal condition for more that 1000 m away

This commit is contained in:
2024-01-18 19:58:00 +05:30
parent 2fb095bd50
commit b9e4df069f
3 changed files with 11 additions and 1 deletions

View File

@ -46,6 +46,7 @@ class DestinationController extends GetxController {
static bool gps_push_started = false;
static bool game_started = false;
static bool ready_for_goal = false;
bool skip_10s = false;
@ -420,6 +421,7 @@ class DestinationController extends GetxController {
isAtGoal.value = false;
isGpsSelected.value = true;
skipGps = false;
ready_for_goal = false;
_start = 0;
chekcs = 0;
@ -744,6 +746,10 @@ class DestinationController extends GetxController {
void handleLocationUpdate(Position? position) async {
if (position != null) {
if (distanceToStart() >= 1000) {
ready_for_goal = true;
}
var distance = const Distance();
double distanceToDest = distance.as(
LengthUnit.Meter,