update to 3.13

This commit is contained in:
Mohamed Nouffer
2023-09-03 23:37:41 +05:30
parent c41dde4c33
commit 56e9861c7a
60 changed files with 3111 additions and 2705 deletions

View File

@ -21,7 +21,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');
}
}
@ -40,21 +40,21 @@ class CameraPage extends StatelessWidget {
destinationController.photos.isNotEmpty ?
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.red
backgroundColor: Colors.red
),
onPressed: (){
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'];
String team = indexController.currentUser[0]["user"]['team_name'];
//print("--- _team : ${_team}-----");
String _event_code = indexController.currentUser[0]["user"]["event_code"];
String eventCode = indexController.currentUser[0]["user"]["event_code"];
//print("--- _event_code : ${_event_code}-----");
String _token = indexController.currentUser[0]["token"];
String token = indexController.currentUser[0]["token"];
//print("--- _token : ${_token}-----");
DateTime now = DateTime.now();
String formattedDate = DateFormat('yyyy-MM-dd HH:mm:ss').format(now);
ExternalService().makeGoal(user_id, _token, _team, destinationController.photos[0].path, formattedDate, _event_code).then((value){
ExternalService().makeGoal(userId, token, team, destinationController.photos[0].path, formattedDate, eventCode).then((value){
print("---called ext api ${value['status']} ------");
if(value['status'] == 'OK'){
Get.back();
@ -84,14 +84,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} #######");
@ -115,7 +115,7 @@ class CameraPage extends StatelessWidget {
// }
// });
},
child: Text("チェックイン")
child: const Text("チェックイン")
):
Container()
)
@ -145,7 +145,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;
});
},
@ -154,13 +154,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(
@ -205,14 +205,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"),
),
],
),
@ -238,14 +238,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"),
),
],
),