update logs
This commit is contained in:
@ -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<void> 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);
|
||||
|
||||
@ -78,6 +78,8 @@ class ExternalService {
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> 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<String, dynamic> _res = {};
|
||||
String url = 'https://rogaining.sumasen.net/gifuroge/checkin_from_rogapp';
|
||||
@ -85,7 +87,6 @@ class ExternalService {
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
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: <String, String>{
|
||||
@ -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: <String, String>{
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -451,6 +451,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
? 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<BottomSheetController> {
|
||||
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<BottomSheetController> {
|
||||
onPressed: () async {
|
||||
Destination dest =
|
||||
indexController.currentDestinationFeature[0];
|
||||
print("~~~~ before checking button ~~~~");
|
||||
//print("------ curent destination is ${dest!.checkedIn}-------");
|
||||
destinationController.makeCheckin(
|
||||
dest, !dest.checkedin!, "");
|
||||
|
||||
Reference in New Issue
Block a user