update goal issue
This commit is contained in:
@ -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) {
|
||||
|
||||
@ -481,10 +481,10 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
// : Container(),
|
||||
// ),
|
||||
Obx(
|
||||
() => destinationController.isAtGoal.value == true &&
|
||||
destinationController
|
||||
.rogainingCounted.value ==
|
||||
true
|
||||
() => destinationController.rogainingCounted.value ==
|
||||
true &&
|
||||
destination.cp == -1 &&
|
||||
destinationController.distanceToStart() <= 500
|
||||
? ElevatedButton(
|
||||
onPressed: () {
|
||||
Get.toNamed(AppPages.CAMERA_PAGE);
|
||||
@ -553,8 +553,12 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
|
||||
// forced start / checkin
|
||||
distanceToDest <=
|
||||
destinationController
|
||||
.getForcedChckinDistance(destination)
|
||||
destinationController
|
||||
.getForcedChckinDistance(destination) &&
|
||||
destinationController.isInCheckin.value ==
|
||||
true &&
|
||||
destinationController.rogainingCounted.value ==
|
||||
false
|
||||
? ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Theme.of(context)
|
||||
|
||||
Reference in New Issue
Block a user