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