update logs
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user