title: How do i get a alert dialog when internet is off
body: <pre><code>Future checkConnectivity (BuildContext context) async {
    try {
      final result = await InternetAddress.lookup('google.com');
      if (result.isNotEmpty &amp;&amp; result[0].rawAddress.isNotEmpty) {
        print(result[0]);
      }
    } on SocketException catch (_) {
      //error alert dialog
    }
  }
  </code></pre>
  <p>When internet is off i want to show a alert dialog to the user that there is no internet.</p>