title: Hot to get Firebase connection Status for user is online or offline
body: <p>I want to check user's server connection in my Firestore linked account. I don't want to check wifi or cellular data for this because even if they are there may not be server connection.</p>
  <p>The method I use temporarily is to find out whether the firebase data was pulled from the cache memory or from the server and say &quot;connection exists&quot; or &quot;no connection&quot; to the user.</p>
  <p>For this i use this method, where is data from cache / server</p>
  <pre><code>.addSnapshotListener(includeMetadataChanges: true)
  let source = snapshot!.metadata.isFromCache ? &quot;cache&quot; : &quot;server&quot;
  if source == &quot;cache&quot;{
     print(&quot;not connect&quot;)
  }
  </code></pre>
  <p>But this method says no connection (even if there is a server connection) when the application is opened after a long time.</p>