title: Flutter Web- How to check internet connectivity?
body: <p>For mobile apps <a href="https://pub.dev/packages/connectivity" rel="nofollow noreferrer">connectivity</a> plugin is working fine.</p>
  
  <pre><code>import 'package:connectivity/connectivity.dart';
  
  var connectivityResult = await (Connectivity().checkConnectivity());
  if (connectivityResult == ConnectivityResult.mobile) {
    // I am connected to a mobile network.
  } else if (connectivityResult == ConnectivityResult.wifi) {
    // I am connected to a wifi network.
  }
  </code></pre>
  
  <p><strong>But is there is any way to detect internet connectivity on <code>onPressed</code> of button in Flutter web?</strong></p>