title: Best/efficient way to keep data up to date for all users using asp.net 6 web API, flutter and http requests
body: <p>I am in a situation, I have an app that uses http requests to get information from my database via web API. My problem is how can I keep my data updated for every user if another user makes a change it will update the UI on all devices. At the moment I use a method to populate a list and call that every time I navigate through the app which I find is very resource draining.</p>
  <p>Here is a quick example of what I have at the moment and then I would call this with getAllJobs every time I want to update</p>
  <pre><code>List&lt;Ticket&gt; listJobTickets = [];
  Future getAllJobs() async {
    client.badCertificateCallback =
        ((X509Certificate cert, String host, int port) =&gt; true);
    HttpClientRequest request =
        await client.getUrl(Uri.parse(&quot;$emulatorHost/Jobs&quot;));
    request.headers.add(&quot;Authorization&quot;, &quot;Bearer &quot; + jwt);
    HttpClientResponse result = await request.close();
    if (result.statusCode == 200) {
      List&lt;dynamic&gt; jsonData =
          jsonDecode(await result.transform(utf8.decoder).join());
      if (listJobTickets.isNotEmpty) {
        listJobTickets.clear();
        for (var i in jsonData) {
          listJobTickets.add(new Ticket(
            i['jobID'],
            i['staffName'],
            i['clientName'],
            i['jobName'],
            i['jobAddress'],
            i['clientContact'],
            i['jobDescription'],
            i['jobDate'],
            i['jobTime'],
            i['status'],
          ));
        }
      } else {
        for (var i in jsonData) {
          listJobTickets.add(new Ticket(
            i['jobID'],
            i['staffName'],
            i['clientName'],
            i['jobName'],
            i['jobAddress'],
            i['clientContact'],
            i['jobDescription'],
            i['jobDate'],
            i['jobTime'],
            i['status'],
          ));
        }
      }
    }
  }
  </code></pre>
  <p>As you can see the problem is that http is only a one way communication therefore the API wont trigger any information to the app when a user changes something.
  Any guidance, Information resources will be greatly appreciated.
  Cheers</p>