fixed popup buttons added location stream and center button

This commit is contained in:
2024-03-06 11:40:00 +05:30
parent 2f329669e9
commit e6a7d37519
6 changed files with 112 additions and 44 deletions

View File

@ -111,6 +111,11 @@ class BottomSheetNew extends GetView<BottomSheetController> {
}
Widget getActionButton(BuildContext context, Destination destination) {
print("getActionButton ${destinationController.rogainingCounted.value}");
print("getActionButton ${destinationController.distanceToStart()}");
print("getActionButton ${destination.cp}");
print("getActionButton ${DestinationController.ready_for_goal}");
Destination cdest = destinationController
.festuretoDestination(indexController.currentFeature[0]);
var distance = const Distance();
@ -121,8 +126,8 @@ class BottomSheetNew extends GetView<BottomSheetController> {
LatLng(cdest.lat!, cdest.lon!));
if (destinationController.rogainingCounted.value == true &&
destinationController.distanceToStart() <= 500 //destination.cp == -1
&&
destinationController.distanceToStart() <= 500 &&
destination.cp == -1 &&
DestinationController.ready_for_goal == true) {
//goal
return ElevatedButton(
@ -161,9 +166,12 @@ class BottomSheetNew extends GetView<BottomSheetController> {
),
onPressed: () async {
// Check conditions to show confirmation dialog
if (destination.cp == -1 &&
destinationController.isInRog.value == false &&
if (destinationController.isInRog.value == false &&
destination.cp == -1 &&
DestinationController.ready_for_goal &&
destinationController.rogainingCounted.value == false) {
print("counted ${destinationController.rogainingCounted.value}");
// Show confirmation dialog
Get.dialog(
AlertDialog(
@ -182,8 +190,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
onPressed: () async {
// Clear data and start game logic here
destinationController.isInRog.value = true;
destinationController
.resetRogaining(); // Assuming you have a method to clear data
destinationController.resetRogaining();
destinationController.addToRogaining(
destinationController.currentLat,
destinationController.currentLon,
@ -199,13 +206,16 @@ class BottomSheetNew extends GetView<BottomSheetController> {
barrierDismissible:
false, // User must tap a button to close the dialog
);
} else {
} else if (destinationController.isInRog.value == true) {
//print("counted ${destinationController.rogainingCounted.value}");
// Existing logic for other conditions
if (destination.cp == -1) {
return;
}
Get.back();
await destinationController.callforCheckin(destination);
} else {
return;
}
},
child: Text(
@ -218,7 +228,9 @@ class BottomSheetNew extends GetView<BottomSheetController> {
? "ゲーム中"
: isAlreadyCheckedIn == true
? "ゲーム中"
: "チェックイン",
: destinationController.isInRog.value == true
? "チェックイン"
: "始まっていない",
style: TextStyle(color: Theme.of(context).colorScheme.onSecondary),
),
);