From c41dde4c339d782ac78bda6ff70066ffcd5845a4 Mon Sep 17 00:00:00 2001 From: Mohamed Nouffer Date: Wed, 23 Aug 2023 17:33:26 +0530 Subject: [PATCH] bug fixes --- ios/Podfile.lock | 2 +- .../destination/destination_controller.dart | 106 ++++++++++-------- lib/widgets/bottom_sheet_new.dart | 10 +- lib/widgets/map_widget.dart | 3 +- 4 files changed, 68 insertions(+), 53 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 017113c..c7ffe25 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -175,4 +175,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: a1c2f8dde3796ecc1697a15e7c75eb5205d8a740 -COCOAPODS: 1.12.0 +COCOAPODS: 1.12.1 diff --git a/lib/pages/destination/destination_controller.dart b/lib/pages/destination/destination_controller.dart index 6c3d0d4..a572fdf 100644 --- a/lib/pages/destination/destination_controller.dart +++ b/lib/pages/destination/destination_controller.dart @@ -131,6 +131,62 @@ class DestinationController extends GetxController { } } + void CallforCheckin(Destination d){ + bool auto_checkin = d.auto_checkin == 0 ? false : true; + if(auto_checkin){ + if(!checking_in){ + print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ make checkin ${d.sub_loc_id}@@@@@@@@@@@"); + makeCheckin(d, true,""); + if(d.cp != -1){ + rogaining_counted.value =true; + } + skip_gps = false; + } + } + else{ + print("--- hidden loc ${d.hidden_location} ----"); + // ask for checkin + if(d.hidden_location != null && d.hidden_location == 0 && is_in_rog.value == true && d.cp != -1){ + chekcs = 3; + is_in_checkin.value = true; + photos.clear(); + showModalBottomSheet(context: Get.context!, isScrollControlled: true, + builder:((context) => CameraPage(destination: d,)) + ).whenComplete((){ + skip_gps = false; + rogaining_counted.value =true; + chekcs = 0; + is_in_checkin.value = false; + }); + } + else{ + Get.snackbar("始まっていない", "ロゲイニングを始める必要があります"); + } + //else if(is_in_rog.value == true && d.cp != -1){ + // chekcs = 4; + // is_in_checkin.value = true; + // showMaterialModalBottomSheet( + // expand: true, + // context: Get.context!, + // backgroundColor: Colors.transparent, + // builder: (context) => BottomSheetNew() + // ).whenComplete(() { + // skip_gps = false; + // chekcs = 0; + // is_in_checkin.value = false; + // }); + // showModalBottomSheet(context: Get.context!, isScrollControlled: true, + // builder:((context) => BottomSheetNew()) + // ).whenComplete((){ + // skip_gps = false; + // chekcs = 0; + // is_in_checkin.value = false; + // }); + //} + + } + } + void startTimer(Destination d, double distance) async { print("=== passed dest is ${d.location_id} ${d.checkedin} ===="); skip_gps = true; @@ -204,55 +260,7 @@ class DestinationController extends GetxController { print("---- location checkin radious ${d.checkin_radious} ----"); print("---- already checked in ${location_already_checked_in} ----"); if(checkin_radious >= distance && location_already_checked_in == false && is_in_rog.value == true){ - if(auto_checkin){ - if(!checking_in){ - print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ make checkin ${d.sub_loc_id}@@@@@@@@@@@"); - makeCheckin(d, true,""); - if(d.cp != -1){ - rogaining_counted.value =true; - } - skip_gps = false; - } - } - else{ - print("--- hidden loc ${d.hidden_location} ----"); - // ask for checkin - if(d.hidden_location != null && d.hidden_location == 0 && is_in_rog.value == true && d.cp != -1){ - chekcs = 3; - is_in_checkin.value = true; - photos.clear(); - showModalBottomSheet(context: Get.context!, isScrollControlled: true, - builder:((context) => CameraPage(destination: d,)) - ).whenComplete((){ - skip_gps = false; - rogaining_counted.value =true; - chekcs = 0; - is_in_checkin.value = false; - }); - } - else if(is_in_rog.value == true && d.cp != -1){ - chekcs = 4; - is_in_checkin.value = true; - showMaterialModalBottomSheet( - expand: true, - context: Get.context!, - backgroundColor: Colors.transparent, - builder: (context) => BottomSheetNew() - ).whenComplete(() { - skip_gps = false; - chekcs = 0; - is_in_checkin.value = false; - }); - // showModalBottomSheet(context: Get.context!, isScrollControlled: true, - // builder:((context) => BottomSheetNew()) - // ).whenComplete((){ - // skip_gps = false; - // chekcs = 0; - // is_in_checkin.value = false; - // }); - } - - } + CallforCheckin(d); } print("---- cp --- ${d.cp} -----"); print("--- at goal ${is_at_goal} ---"); diff --git a/lib/widgets/bottom_sheet_new.dart b/lib/widgets/bottom_sheet_new.dart index 10cdebf..9e098d4 100644 --- a/lib/widgets/bottom_sheet_new.dart +++ b/lib/widgets/bottom_sheet_new.dart @@ -427,6 +427,13 @@ class BottomSheetNew extends GetView { ], ), ), + ElevatedButton( + onPressed:() async { + destinationController.CallforCheckin(destinationController.festuretoDestination(indexController.currentFeature[0])); + }, + child:Text("チェックイン") + ), + SizedBox(width: 16,), ElevatedButton( onPressed:() async { GeoJsonFeature mp = indexController.currentFeature[0] as GeoJsonFeature; @@ -445,7 +452,8 @@ class BottomSheetNew extends GetView { destinationController.destinationMatrixFromCurrentPoint([ds, tp]); }, - child:Text("ここへ行く")), + child:Text("ここへ行く") + ), ], ), SizedBox(height: 8.0,), diff --git a/lib/widgets/map_widget.dart b/lib/widgets/map_widget.dart index 90fa391..eb6e56b 100644 --- a/lib/widgets/map_widget.dart +++ b/lib/widgets/map_widget.dart @@ -33,7 +33,6 @@ class MapWidget extends StatelessWidget { InkWell( onTap: () { GeoJsonFeature? fs = indexController.getFeatureForLatLong(p.geoSerie!.geoPoints[0].latitude, p.geoSerie!.geoPoints[0].longitude); - print("------- fs ${fs}------"); if(fs != null){ indexController.currentFeature.clear(); indexController.currentFeature.add(fs); @@ -154,7 +153,7 @@ class MapWidget extends StatelessWidget { }).toList(), ) : - Center(child: CircularProgressIndicator()) + const Center(child: CircularProgressIndicator()) , ], )