update to server location popup
This commit is contained in:
@ -19,38 +19,9 @@ class CameraPage extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
// void finishRog(){
|
||||
// destinationController.addToRogaining(destinationController.current_lat, destinationController.current_lon, destination_id)
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("finishing_rogaining".tr),
|
||||
),
|
||||
body: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Obx(() =>
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 370,
|
||||
decoration: BoxDecoration(
|
||||
image:
|
||||
DecorationImage(
|
||||
image: getFinishImage(),
|
||||
fit: BoxFit.cover
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
Widget getAction(BuildContext context){
|
||||
if(destinationController.is_at_goal.value && destinationController.is_in_rog.value){
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
ElevatedButton(
|
||||
@ -81,9 +52,12 @@ class CameraPage extends StatelessWidget {
|
||||
print("---called ext api ${value['status']} ------");
|
||||
if(value['status'] == 'OK'){
|
||||
Get.back();
|
||||
destinationController.skip_gps = false;
|
||||
Get.snackbar("goal_saved", "goal_added_successfuly");
|
||||
destinationController.resetRogaining();
|
||||
}
|
||||
else{
|
||||
print("---- status ${value['status']} ---- ");
|
||||
Get.snackbar("goal_not_added", "please_try_again");
|
||||
}
|
||||
});
|
||||
@ -93,9 +67,127 @@ class CameraPage extends StatelessWidget {
|
||||
Container()
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
else{
|
||||
return ElevatedButton(
|
||||
child: Text("Checking image"),
|
||||
onPressed: (){
|
||||
Get.back();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// void finishRog(){
|
||||
// destinationController.addToRogaining(destinationController.current_lat, destinationController.current_lon, destination_id)
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if(destinationController.is_at_goal.value){
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("finishing_rogaining".tr),
|
||||
),
|
||||
body: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Center(
|
||||
child: Obx(() =>
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 370,
|
||||
decoration: BoxDecoration(
|
||||
image:
|
||||
DecorationImage(
|
||||
image: getFinishImage(),
|
||||
fit: BoxFit.cover
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
getAction(context),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
else if(destinationController.rogaining_counted.value == true) {
|
||||
return NotAtGoal();
|
||||
}
|
||||
else {
|
||||
return StartRogaining();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class StartRogaining extends StatelessWidget {
|
||||
StartRogaining({Key? key}) : super(key: key);
|
||||
|
||||
DestinationController destinationController = Get.find<DestinationController>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Not started yet".tr,),
|
||||
),
|
||||
body: Container(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text("You have not started rogaining yet.".tr, style: TextStyle(fontSize: 24)),
|
||||
SizedBox(height: 40.0,),
|
||||
ElevatedButton(
|
||||
onPressed: (){
|
||||
Get.back();
|
||||
destinationController.skip_gps = false;
|
||||
},
|
||||
child: Text("Back"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class NotAtGoal extends StatelessWidget {
|
||||
NotAtGoal({Key? key}) : super(key: key);
|
||||
|
||||
DestinationController destinationController = Get.find<DestinationController>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Not reached the goal yet".tr,),
|
||||
),
|
||||
body: Container(
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text("You have not reached the goal yet.".tr, style: TextStyle(fontSize: 24)),
|
||||
SizedBox(height: 40.0,),
|
||||
ElevatedButton(
|
||||
onPressed: (){
|
||||
Get.back();
|
||||
destinationController.skip_gps = false;
|
||||
},
|
||||
child: Text("Back"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user