isNetworkConnected static method

Future<bool> isNetworkConnected()

Implementation

static Future<bool> isNetworkConnected() async {
  var connectivityResult = await (Connectivity().checkConnectivity());
  return connectivityResult.contains(ConnectivityResult.mobile) ||
      connectivityResult.contains(ConnectivityResult.wifi) ||
      connectivityResult.contains(ConnectivityResult.other);
}