Somethings, idk what I made

This commit is contained in:
Sewmina
2022-04-21 15:56:23 +05:30
parent 1f35254b5b
commit fd9cef8687
5 changed files with 549 additions and 385 deletions

View File

@@ -99,9 +99,12 @@ Future<void> BuildBridgeToServer() async {
(await http.post(Uri.parse('http://161.97.127.136/task_tracker/bridge.php'), body: <String, String>{"username": username}));
Debug.LogResponse("${response.body}",src: 'bridge');
List<String> data = response.body.split(",");
Debug.LogResponse('Update :\nactivities_rev=${data[0]} tasks_rev=${data[1]} cats_rev=${data[2]} projects_rev=${data[3]}');
bool changedOffline = offline==true;
offline=false;
if(changedOffline){refreshStream.add(false);}
if (data[4].contains('<td>')) {
List<String> ongoingData = data[4].split("<td>");
if (!prefs.containsKey('current_activity')) {
@@ -125,6 +128,9 @@ Future<void> BuildBridgeToServer() async {
}
} catch (e) {
Debug.LogError("Error with bridge : $e");
bool changedOffline = offline == false;
offline=true;
if(changedOffline){refreshStream.add(false);}
}
await Future.delayed(Duration(seconds: 5));
}