update
This commit is contained in:
@ -70,12 +70,54 @@ class CameraPage extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
else{
|
||||
return ElevatedButton(
|
||||
child: Text("Checking image"),
|
||||
onPressed: (){
|
||||
Get.back();
|
||||
},
|
||||
);
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
onPressed: (){
|
||||
destinationController.openCamera(context);
|
||||
},
|
||||
child: Text("take checkin photo".tr)
|
||||
),
|
||||
Obx(() =>
|
||||
destinationController.photos.isNotEmpty ?
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: Colors.red
|
||||
),
|
||||
onPressed: (){
|
||||
int user_id = indexController.currentUser[0]["user"]["id"];
|
||||
//print("--- Pressed -----");
|
||||
String _team = indexController.currentUser[0]["user"]['team_name'];
|
||||
//print("--- _team : ${_team}-----");
|
||||
String _event_code = indexController.currentUser[0]["user"]["event_code"];
|
||||
//print("--- _event_code : ${_event_code}-----");
|
||||
String _token = indexController.currentUser[0]["token"];
|
||||
//print("--- _token : ${_token}-----");
|
||||
DateTime now = DateTime.now();
|
||||
String formattedDate = DateFormat('yyyy-MM-dd HH:mm:ss').format(now);
|
||||
|
||||
destinationController.makeCheckin(indexController.currentDestinationFeature[0], true);
|
||||
|
||||
// ExternalService().makeGoal(user_id, _token, _team, destinationController.photos[0].path, formattedDate, _event_code).then((value){
|
||||
// print("---called ext api ${value['status']} ------");
|
||||
// if(value['status'] == 'OK'){
|
||||
// Get.back();
|
||||
// destinationController.skip_gps = false;
|
||||
// Get.snackbar("Checked in", "Checked in successfuly");
|
||||
// }
|
||||
// else{
|
||||
// print("---- status ${value['status']} ---- ");
|
||||
// Get.snackbar("Checkin not added", "please_try_again");
|
||||
// }
|
||||
// });
|
||||
},
|
||||
child: Text("Check In".tr)
|
||||
):
|
||||
Container()
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,7 +127,7 @@ class CameraPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if(destinationController.is_at_goal.value){
|
||||
if(destinationController.is_in_rog.value){
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("finishing_rogaining".tr),
|
||||
@ -116,9 +158,6 @@ class CameraPage extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
else if(destinationController.rogaining_counted.value == true) {
|
||||
return NotAtGoal();
|
||||
}
|
||||
else {
|
||||
return StartRogaining();
|
||||
}
|
||||
|
||||
@ -148,6 +148,7 @@ class DestinationController extends GetxController {
|
||||
//start
|
||||
print("---- in start -----");
|
||||
chekcs = 1;
|
||||
is_in_checkin.value = true;
|
||||
is_at_start.value = true;
|
||||
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
|
||||
builder:((context) => BottomSheetNew())
|
||||
@ -155,13 +156,14 @@ class DestinationController extends GetxController {
|
||||
skip_gps = false;
|
||||
chekcs = 0;
|
||||
is_at_start.value = false;
|
||||
is_in_checkin.value = false;
|
||||
});
|
||||
}
|
||||
else
|
||||
else if(is_in_rog.value == false)
|
||||
{
|
||||
print("----- in location popup checkin cp - ${d.cp}----");
|
||||
chekcs = 2;
|
||||
//is_in_checkin.value = true;
|
||||
is_in_checkin.value = true;
|
||||
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
|
||||
builder:((context) => BottomSheetNew())
|
||||
).whenComplete((){
|
||||
@ -185,8 +187,9 @@ class DestinationController extends GetxController {
|
||||
}
|
||||
}
|
||||
else{
|
||||
print("--- hidden loc ${d.hidden_location} ----");
|
||||
// ask for checkin
|
||||
if(d.hidden_location != null && d.hidden_location ==true && is_in_rog.value == true && d.cp != -1){
|
||||
if(d.hidden_location != null && d.hidden_location == 0 && is_in_rog.value == true && d.cp != -1){
|
||||
chekcs = 3;
|
||||
is_in_checkin.value = true;
|
||||
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
|
||||
@ -217,7 +220,7 @@ class DestinationController extends GetxController {
|
||||
print("--- loc already checked in ${location_already_checked_in} ---");
|
||||
if(isUser_logged_in && d.cp == -1 && location_already_checked_in){
|
||||
//check for rogaining
|
||||
if(is_at_goal.value == false && rogaining_counted.value){
|
||||
if(is_at_goal.value == false && rogaining_counted.value && indexController.rog_mode == 1){
|
||||
//goal
|
||||
print("---- in goal -----");
|
||||
chekcs = 5;
|
||||
@ -230,7 +233,7 @@ class DestinationController extends GetxController {
|
||||
is_at_goal.value = false;
|
||||
});
|
||||
}
|
||||
else if(is_in_rog.value == false){
|
||||
else if(is_in_rog.value == false && indexController.rog_mode == 1){
|
||||
//start
|
||||
print("---- in start -----");
|
||||
chekcs = 6;
|
||||
|
||||
Reference in New Issue
Block a user