From 7fdb6c05ee9e4ec28ed8cc43e82a6bbbaaa7fdd0 Mon Sep 17 00:00:00 2001 From: Mohamed Nouffer Date: Thu, 21 Sep 2023 15:41:23 +0530 Subject: [PATCH] update logs --- android/app/build.gradle | 2 +- .../destination/destination_controller.dart | 3 +++ lib/services/external_service.dart | 18 +++++++++++++----- lib/utils/const.dart | 1 + lib/widgets/bottom_sheet_new.dart | 3 +++ pubspec.yaml | 2 +- 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 2795483..edac07b 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -56,7 +56,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.dvox.gifunavi" minSdkVersion 23 - targetSdkVersion flutter.targetSdkVersion + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true diff --git a/lib/pages/destination/destination_controller.dart b/lib/pages/destination/destination_controller.dart index c85fbb7..e6b39db 100644 --- a/lib/pages/destination/destination_controller.dart +++ b/lib/pages/destination/destination_controller.dart @@ -189,6 +189,7 @@ class DestinationController extends GetxController { if (d.cp == -1 && DateTime.now().difference(last_goal_at).inHours >= 24) { chekcs = 1; //start + print("~~~~ calling start ~~~~"); print("---- in start -----"); chekcs = 1; is_in_checkin.value = true; @@ -656,6 +657,7 @@ class DestinationController extends GetxController { Future makeCheckin( Destination destination, bool action, String imageurl) async { + print("~~~~ calling checkin function ~~~~"); print( "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ressssss ${destination.sub_loc_id}@@@@@@@@@@@"); DatabaseHelper db = DatabaseHelper.instance; @@ -666,6 +668,7 @@ class DestinationController extends GetxController { destination.checkedin = true; destination.checkin_image = imageurl; await db.insertDestination(destination); + print("~~~~ inserted into db ~~~~"); } await GallerySaver.saveImage(imageurl); diff --git a/lib/services/external_service.dart b/lib/services/external_service.dart index 3ca7ce4..61bb8b3 100644 --- a/lib/services/external_service.dart +++ b/lib/services/external_service.dart @@ -78,6 +78,8 @@ class ExternalService { } Future> makeCheckpoint(int userId, String token, String checkinTime, String teamname, int cp, String eventcode, String imageurl) async { + print("~~~~ in API call function ~~~~"); + print("~~~~ cp is ${cp} ~~~~"); //print("--cpcp-- ${cp}"); Map _res = {}; String url = 'https://rogaining.sumasen.net/gifuroge/checkin_from_rogapp'; @@ -85,7 +87,6 @@ class ExternalService { final IndexController indexController = Get.find(); if(imageurl != null){ - if(indexController.connectionStatusName != "wifi" && indexController.connectionStatusName != "mobile"){ DatabaseHelper db = DatabaseHelper.instance; Rog _rog = Rog( @@ -106,6 +107,8 @@ class ExternalService { final im1Bytes = File(imageurl).readAsBytesSync(); String im1_64 = base64Encode(im1Bytes); + print("~~~~ before calling api 1 ~~~~"); + final http.Response response = await http.post( Uri.parse(url1), headers: { @@ -124,11 +127,14 @@ class ExternalService { ); _res = json.decode(utf8.decode(response.bodyBytes)); - - print("-----@@@@@ checkin $_res -----"); + print("~~~~ api1 result ${_res} ~~~~"); + //print("-----@@@@@ checkin $_res -----"); if(response.statusCode == 201){ + print("~~~~ image from api1 ${_res["checkinimage"].toString()} ~~~~"); //print('---- toekn is ${token} -----'); + print("~~~~ token is ${token} ~~~~"); + print("~~~~ before callling api2 ~~~~"); final http.Response response2 = await http.post( Uri.parse(url), headers: { @@ -147,8 +153,9 @@ class ExternalService { 'event_code': eventcode, 'image': _res["checkinimage"].toString().replaceAll('http://localhost:8100', 'http://rogaining.sumasen.net') }); - print("--json-- $vv"); - print("--- checnin response ${response2.statusCode}----"); + print("~~~~ api 2 values ${vv} ~~~~"); + //print("--json-- $vv"); + //print("--- checnin response ${response2.statusCode}----"); if (response2.statusCode == 200) { _res = json.decode(utf8.decode(response2.bodyBytes)); print('----checkin res _res : $_res ----'); @@ -204,6 +211,7 @@ class ExternalService { } } } + print("~~~~ done checkin ~~~~"); return _res; } diff --git a/lib/utils/const.dart b/lib/utils/const.dart index 3127cee..9dbd9a4 100644 --- a/lib/utils/const.dart +++ b/lib/utils/const.dart @@ -10,6 +10,7 @@ class ConstValues{ static const dev_home_ip_mserver = "http://192.168.1.10:8100"; static String currentServer(){ + //return dev_ip_server; return server_uri; } } diff --git a/lib/widgets/bottom_sheet_new.dart b/lib/widgets/bottom_sheet_new.dart index 3efbc34..2bca121 100644 --- a/lib/widgets/bottom_sheet_new.dart +++ b/lib/widgets/bottom_sheet_new.dart @@ -451,6 +451,7 @@ class BottomSheetNew extends GetView { ? ElevatedButton( onPressed: () async { await destinationController.resetRogaining(); + print("~~~~ start button ~~~~"); destinationController.is_in_rog.value = true; destinationController.addToRogaining( @@ -561,6 +562,7 @@ class BottomSheetNew extends GetView { backgroundColor: Theme.of(context).colorScheme.secondary), onPressed: () async { + print("~~~~ manual checkin button ~~~~"); if (destination.cp == -1) { destinationController.is_in_rog.value = true; destinationController.addToRogaining( @@ -908,6 +910,7 @@ class BottomSheetNew extends GetView { onPressed: () async { Destination dest = indexController.currentDestinationFeature[0]; + print("~~~~ before checking button ~~~~"); //print("------ curent destination is ${dest!.checkedIn}-------"); destinationController.makeCheckin( dest, !dest.checkedin!, ""); diff --git a/pubspec.yaml b/pubspec.yaml index d74e7b6..170d672 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.23+23 +version: 1.0.24+24 environment: sdk: '>=3.1.0 <4.0.0'