update for game logic

This commit is contained in:
Mohamed Nouffer
2022-11-08 15:29:42 +05:30
parent 991c6694c2
commit 78970ef5c3
2 changed files with 42 additions and 43 deletions

View File

@ -181,23 +181,6 @@ class BottomSheetNew extends GetView<BottomSheetController> {
destinationController.is_photo_shoot.value = true;
Get.back();
// showMaterialModalBottomSheet(
// expand: true,
// context: Get.context!,
// backgroundColor: Colors.transparent,
// builder: (context) => BottomSheetNew()
// ).whenComplete(() {
// });
// showModalBottomSheet(context: Get.context!, isScrollControlled: true,
// //builder:((context) => CameraPage())
// builder:((context) => Container(child: Text("model"),))
// ).whenComplete((){
// // destinationController.makeCheckin(indexController.currentDestinationFeature[0], true);
// // if(indexController.currentDestinationFeature[0].cp != -1){
// // destinationController.rogaining_counted.value =true;
// // }
// });
}
else{
destinationController.makeCheckin(indexController.currentDestinationFeature[0], true, "");
@ -213,6 +196,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
//Get.back();
},
child: Text(
//Checkin
indexController.currentDestinationFeature[0].checkedin == null || indexController.currentDestinationFeature[0].checkedin == false ?
"チェックイン"
:
@ -233,6 +217,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
ExternalService().StartRogaining().then((value) => Get.back());
},
child: Text(
// start
indexController.currentDestinationFeature[0].checkedin != null || indexController.currentDestinationFeature[0].checkedin == true ?
"ロゲイニングを開始"
:
@ -251,6 +236,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
Get.back();
},
child: Text(
//goal
indexController.currentDestinationFeature[0].checkedin != null || indexController.currentDestinationFeature[0].checkedin == true ?
"ロゲイニングを終える"
:
@ -372,35 +358,44 @@ class BottomSheetNew extends GetView<BottomSheetController> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Obx(() =>
indexController.currentDestinationFeature.isNotEmpty && destinationController.is_in_checkin.value == true ?
Row(
children: [
ElevatedButton(
Obx(() =>
indexController.currentDestinationFeature.isNotEmpty && indexController.currentDestinationFeature[0].cp == -1 && indexController.currentDestinationFeature[0].checkedin == false && destinationController.is_at_start.value == true ?
ElevatedButton(
onPressed: (){
destinationController.is_in_rog.value = true;
destinationController.addToRogaining(destinationController.current_lat, destinationController.current_lon, indexController.currentDestinationFeature[0].location_id!);
ExternalService().StartRogaining().then((value) => Get.back());
},
child: Text(
// start
indexController.currentDestinationFeature[0].checkedin != null || indexController.currentDestinationFeature[0].checkedin == true ?
"ロゲイニングを開始"
:
"間違った目的地..."
)
)
:
Container(),
),
Obx(() =>
destinationController.is_at_goal.value == true && destinationController.rogaining_counted ==true ?
ElevatedButton(
onPressed: (){
if(indexController.currentDestinationFeature[0].checkedin == null || indexController.currentDestinationFeature[0].checkedin == false){
destinationController.makeCheckin(indexController.currentDestinationFeature[0], true, "");
if(indexController.currentDestinationFeature[0].cp != -1){
destinationController.rogaining_counted.value =true;
}
}
else{
destinationController.makeCheckin(indexController.currentDestinationFeature[0], false, "");
}
Get.toNamed(AppPages.CAMERA_PAGE);
Get.back();
},
child: Text(
indexController.currentDestinationFeature[0].checkedin == null || indexController.currentDestinationFeature[0].checkedin == false ?
"チェックイン"
//goal
indexController.currentDestinationFeature[0].checkedin != null || indexController.currentDestinationFeature[0].checkedin == true ?
"ロゲイニングを終える"
:
"チェックアウト"
"間違った目的地 ..."
)
),
],
)
:
Container(),
),
)
:
Container(),
),
],
),
Row(