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);
|
||||
|
||||
Reference in New Issue
Block a user