update goal issue

This commit is contained in:
2023-11-20 22:49:54 +05:30
parent 4648b0424d
commit 3abd306e89
2 changed files with 28 additions and 6 deletions

View File

@ -668,6 +668,24 @@ class DestinationController extends GetxController {
super.onInit();
}
double distanceToStart() {
Destination? ds;
for (Destination d in destinations) {
if (d.cp == -1) {
ds = d;
}
}
double distanceToDest = double.infinity;
if (ds != null) {
var distance = const Distance();
distanceToDest = distance.as(LengthUnit.Meter,
LatLng(currentLat, currentLon), LatLng(ds.lat!, ds.lon!));
}
print("==== dist==${distanceToDest}");
return distanceToDest;
}
int getForcedChckinDistance(Destination dest) {
int _retValue = 100;
if (dest.cp == -1) {