bug fixes

This commit is contained in:
Mohamed Nouffer
2023-08-23 17:33:26 +05:30
parent 08332d45d4
commit c41dde4c33
4 changed files with 68 additions and 53 deletions

View File

@ -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} ---");

View File

@ -427,6 +427,13 @@ class BottomSheetNew extends GetView<BottomSheetController> {
],
),
),
ElevatedButton(
onPressed:() async {
destinationController.CallforCheckin(destinationController.festuretoDestination(indexController.currentFeature[0]));
},
child:Text("チェックイン")
),
SizedBox(width: 16,),
ElevatedButton(
onPressed:() async {
GeoJsonFeature<GeoJsonMultiPoint> mp = indexController.currentFeature[0] as GeoJsonFeature<GeoJsonMultiPoint>;
@ -445,7 +452,8 @@ class BottomSheetNew extends GetView<BottomSheetController> {
destinationController.destinationMatrixFromCurrentPoint([ds, tp]);
},
child:Text("ここへ行く")),
child:Text("ここへ行く")
),
],
),
SizedBox(height: 8.0,),

View File

@ -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())
,
],
)