update gps collection time and distance

This commit is contained in:
2023-11-28 11:48:31 +05:30
parent 44cb728fab
commit 6f084b2349
2 changed files with 75 additions and 52 deletions

View File

@ -498,6 +498,8 @@ class BottomSheetNew extends GetView<BottomSheetController> {
// ),
destinationController.rogainingCounted.value == true &&
destinationController.distanceToStart() <=
500 &&
destination.cp == -1
? ElevatedButton(
onPressed: () async {
@ -604,57 +606,61 @@ class BottomSheetNew extends GetView<BottomSheetController> {
),
// forced start / checkin
Obx(() => ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor:
Theme.of(context).colorScheme.secondary),
onPressed: () async {
//print("~~~~ manual checkin button ~~~~");
if (destination.cp == -1 &&
destinationController.isInRog.value ==
false &&
destinationController
.rogainingCounted.value ==
false) {
destinationController.isInRog.value = true;
destinationController.addToRogaining(
destinationController.currentLat,
destinationController.currentLon,
destination.location_id!);
saveGameState();
ExternalService()
.startRogaining()
.then((value) => Get.back());
} else {
if (destination.cp == -1) {
return;
}
Get.back();
await destinationController
.callforCheckin(destination);
}
},
child: Text(
destination.cp == -1 &&
destinationController.isInRog.value ==
false &&
destinationController
.rogainingCounted.value ==
false
? "ロゲ開始"
: destinationController.isInRog.value ==
true &&
destination.cp == -1
? "ゲーム中"
: isAlreadyCheckedIn == true
? "ゲーム中"
: "チェックイン",
style: TextStyle(
color: Theme.of(context)
distanceToDest <=
destinationController
.getForcedChckinDistance(destination)
? Obx(() => ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Theme.of(context)
.colorScheme
.onSecondary))))
// ElevatedButton(
// onPressed: () {}, child: const Text("ゲーム中")),
.secondary),
onPressed: () async {
//print("~~~~ manual checkin button ~~~~");
if (destination.cp == -1 &&
destinationController.isInRog.value ==
false &&
destinationController
.rogainingCounted.value ==
false) {
destinationController.isInRog.value = true;
destinationController.addToRogaining(
destinationController.currentLat,
destinationController.currentLon,
destination.location_id!);
saveGameState();
ExternalService()
.startRogaining()
.then((value) => Get.back());
} else {
if (destination.cp == -1) {
return;
}
Get.back();
await destinationController
.callforCheckin(destination);
}
},
child: Text(
destination.cp == -1 &&
destinationController
.isInRog.value ==
false &&
destinationController
.rogainingCounted.value ==
false
? "ロゲ開始"
: destinationController.isInRog.value ==
true &&
destination.cp == -1
? "ゲーム中"
: isAlreadyCheckedIn == true
? "ゲーム中"
: "チェックイン",
style: TextStyle(
color: Theme.of(context)
.colorScheme
.onSecondary))))
: Container(),
],
),
Row(