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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user