fixed timer issue
This commit is contained in:
@ -344,13 +344,15 @@ class ExternalService {
|
||||
|
||||
String timestampToTimeString(int timestamp) {
|
||||
// Convert timestamp to DateTime and format it as needed
|
||||
var dateTime = DateTime.fromMillisecondsSinceEpoch(timestamp * 1000);
|
||||
var dateTime = DateTime.fromMillisecondsSinceEpoch(timestamp);
|
||||
//print("^^^^ time ${dateTime}");
|
||||
// Format dateTime to a time string (e.g., '12:00:00')
|
||||
// Adjust the format as needed
|
||||
return "${dateTime.hour}:${dateTime.minute}:${dateTime.second}";
|
||||
}
|
||||
|
||||
Future<bool> pushGPS() async {
|
||||
//print("^^^^ pushed ^^^");
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
//int userId = indexController.currentUser[0]["user"]["id"];
|
||||
@ -383,7 +385,7 @@ class ExternalService {
|
||||
}).toList(),
|
||||
};
|
||||
|
||||
print("calling push gps step 2 ${payload}");
|
||||
//print("calling push gps step 2 ${payload}");
|
||||
|
||||
String urlS =
|
||||
'https://rogaining.sumasen.net/gifuroge/get_waypoint_datas_from_rogapp';
|
||||
@ -395,15 +397,15 @@ class ExternalService {
|
||||
body: json.encode(payload),
|
||||
);
|
||||
|
||||
print("GPS Data res ${response.statusCode}");
|
||||
//print("GPS Data res ${response.statusCode}");
|
||||
if (response.statusCode == 200) {
|
||||
// Handle success
|
||||
// make local data as synced
|
||||
await GpsDatabaseHelper.instance.setSyncData(gpsDataList);
|
||||
print("GPS Data sent successfully");
|
||||
//print("GPS Data sent successfully");
|
||||
} else {
|
||||
// Handle error
|
||||
print("Failed to send data");
|
||||
//print("Failed to send data");
|
||||
}
|
||||
}
|
||||
return Future.value(false);
|
||||
|
||||
@ -174,7 +174,7 @@ class LocationService {
|
||||
'$serverUrl/api/inbound?ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4';
|
||||
}
|
||||
}
|
||||
print('++++++++$url');
|
||||
//print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
|
||||
Reference in New Issue
Block a user