update
This commit is contained in:
@ -70,11 +70,53 @@ class CameraPage extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
return ElevatedButton(
|
return Row(
|
||||||
child: Text("Checking image"),
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
ElevatedButton(
|
||||||
onPressed: (){
|
onPressed: (){
|
||||||
Get.back();
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if(destinationController.is_at_goal.value){
|
if(destinationController.is_in_rog.value){
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text("finishing_rogaining".tr),
|
title: Text("finishing_rogaining".tr),
|
||||||
@ -116,9 +158,6 @@ class CameraPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(destinationController.rogaining_counted.value == true) {
|
|
||||||
return NotAtGoal();
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
return StartRogaining();
|
return StartRogaining();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -148,6 +148,7 @@ class DestinationController extends GetxController {
|
|||||||
//start
|
//start
|
||||||
print("---- in start -----");
|
print("---- in start -----");
|
||||||
chekcs = 1;
|
chekcs = 1;
|
||||||
|
is_in_checkin.value = true;
|
||||||
is_at_start.value = true;
|
is_at_start.value = true;
|
||||||
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
|
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
|
||||||
builder:((context) => BottomSheetNew())
|
builder:((context) => BottomSheetNew())
|
||||||
@ -155,13 +156,14 @@ class DestinationController extends GetxController {
|
|||||||
skip_gps = false;
|
skip_gps = false;
|
||||||
chekcs = 0;
|
chekcs = 0;
|
||||||
is_at_start.value = false;
|
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}----");
|
print("----- in location popup checkin cp - ${d.cp}----");
|
||||||
chekcs = 2;
|
chekcs = 2;
|
||||||
//is_in_checkin.value = true;
|
is_in_checkin.value = true;
|
||||||
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
|
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
|
||||||
builder:((context) => BottomSheetNew())
|
builder:((context) => BottomSheetNew())
|
||||||
).whenComplete((){
|
).whenComplete((){
|
||||||
@ -185,8 +187,9 @@ class DestinationController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
print("--- hidden loc ${d.hidden_location} ----");
|
||||||
// ask for checkin
|
// 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;
|
chekcs = 3;
|
||||||
is_in_checkin.value = true;
|
is_in_checkin.value = true;
|
||||||
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
|
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
|
||||||
@ -217,7 +220,7 @@ class DestinationController extends GetxController {
|
|||||||
print("--- loc already checked in ${location_already_checked_in} ---");
|
print("--- loc already checked in ${location_already_checked_in} ---");
|
||||||
if(isUser_logged_in && d.cp == -1 && location_already_checked_in){
|
if(isUser_logged_in && d.cp == -1 && location_already_checked_in){
|
||||||
//check for rogaining
|
//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
|
//goal
|
||||||
print("---- in goal -----");
|
print("---- in goal -----");
|
||||||
chekcs = 5;
|
chekcs = 5;
|
||||||
@ -230,7 +233,7 @@ class DestinationController extends GetxController {
|
|||||||
is_at_goal.value = false;
|
is_at_goal.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if(is_in_rog.value == false){
|
else if(is_in_rog.value == false && indexController.rog_mode == 1){
|
||||||
//start
|
//start
|
||||||
print("---- in start -----");
|
print("---- in start -----");
|
||||||
chekcs = 6;
|
chekcs = 6;
|
||||||
|
|||||||
@ -167,7 +167,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Obx(() =>
|
Obx(() =>
|
||||||
indexController.currentDestinationFeature.isNotEmpty && destinationController.is_in_checkin.value == true ?
|
indexController.currentDestinationFeature.isNotEmpty && destinationController.is_in_checkin.value == true && destinationController.is_at_start.value == false ?
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
@ -340,12 +340,49 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
|||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Obx(() =>
|
||||||
|
indexController.currentDestinationFeature.isNotEmpty && destinationController.is_in_checkin.value == true ?
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
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.back();
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
indexController.currentDestinationFeature[0].checkedin == null || indexController.currentDestinationFeature[0].checkedin == false ?
|
||||||
|
"Chekin"
|
||||||
|
:
|
||||||
|
"Checkput"
|
||||||
|
)
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
:
|
||||||
|
Container(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
indexController.currentDestinationFeature.isNotEmpty && destinationController.is_in_checkin.value == true ?
|
||||||
|
Container()
|
||||||
|
:
|
||||||
FutureBuilder<Widget>(
|
FutureBuilder<Widget>(
|
||||||
future: wantToGo(context),
|
future: wantToGo(context),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
|
|||||||
Reference in New Issue
Block a user