update to add resume app from sleep

This commit is contained in:
Mohamed Nouffer
2023-08-16 14:53:32 +05:30
parent 68bf3e9ab3
commit 2ab96cc3d0
51 changed files with 748 additions and 789 deletions

View File

@ -23,7 +23,7 @@ class CameraPage extends StatelessWidget {
return FileImage(destinationController.photos[0]);
}
else{
return AssetImage('assets/images/empty_image.png');
return const AssetImage('assets/images/empty_image.png');
}
}
@ -45,12 +45,12 @@ class CameraPage extends StatelessWidget {
settingGoal.value == false ?
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.red
backgroundColor: Colors.red
),
onPressed: () async {
settingGoal.value = true;
try{
int user_id = indexController.currentUser[0]["user"]["id"];
int userId = indexController.currentUser[0]["user"]["id"];
//print("--- Pressed -----");
String _team = indexController.currentUser[0]["user"]['team_name'];
//print("--- _team : ${_team}-----");
@ -61,7 +61,7 @@ class CameraPage extends StatelessWidget {
DateTime now = DateTime.now();
String formattedDate = DateFormat('yyyy-MM-dd HH:mm:ss').format(now);
await ExternalService().makeGoal(user_id, _token, _team, destinationController.photos[0].path, formattedDate, _event_code).then((value){
await ExternalService().makeGoal(userId, _token, _team, destinationController.photos[0].path, formattedDate, _event_code).then((value){
print("---called ext api ${value['status']} ------");
if(value['status'] == 'OK'){
Get.back();
@ -86,7 +86,7 @@ class CameraPage extends StatelessWidget {
)
:
Container(
child: Center(
child: const Center(
child: CircularProgressIndicator(),
),
)
@ -105,14 +105,14 @@ class CameraPage extends StatelessWidget {
onPressed: (){
destinationController.openCamera(context);
},
child: destinationController.photos.length > 0 ? Text("再撮影") : Text("撮影")
child: destinationController.photos.isNotEmpty ? const Text("再撮影") : const Text("撮影")
)
),
Obx(() =>
destinationController.photos.isNotEmpty ?
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.red
backgroundColor: Colors.red
),
onPressed: (){
print("##### current destination ${indexController.currentDestinationFeature[0].sub_loc_id} #######");
@ -136,7 +136,7 @@ class CameraPage extends StatelessWidget {
// }
// });
},
child: Text("チェックイン")
child: const Text("チェックイン")
):
Container()
)
@ -166,7 +166,7 @@ class CameraPage extends StatelessWidget {
onPressed: (){
Navigator.of(context).pop();
destinationController.skip_10s = true;
timer = Timer.periodic(Duration(seconds: 10), (Timer t){
timer = Timer.periodic(const Duration(seconds: 10), (Timer t){
destinationController.skip_10s = false;
});
},
@ -175,13 +175,13 @@ class CameraPage extends StatelessWidget {
)
:
AppBar(
title: Text("チェックポイント"),
title: const Text("チェックポイント"),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Padding(
padding: EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8.0),
child: Center(
child: Obx(() =>
Container(
@ -226,14 +226,14 @@ class StartRogaining extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("You have not started rogaining yet.".tr, style: TextStyle(fontSize: 24)),
SizedBox(height: 40.0,),
Text("You have not started rogaining yet.".tr, style: const TextStyle(fontSize: 24)),
const SizedBox(height: 40.0,),
ElevatedButton(
onPressed: (){
Get.back();
destinationController.skip_gps = false;
},
child: Text("Back"),
child: const Text("Back"),
),
],
),
@ -259,14 +259,14 @@ class NotAtGoal extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("You have not reached the goal yet.".tr, style: TextStyle(fontSize: 24)),
SizedBox(height: 40.0,),
Text("You have not reached the goal yet.".tr, style: const TextStyle(fontSize: 24)),
const SizedBox(height: 40.0,),
ElevatedButton(
onPressed: (){
Get.back();
destinationController.skip_gps = false;
},
child: Text("Back"),
child: const Text("Back"),
),
],
),