checkInternet static method

Future<bool> checkInternet()

Implementation

static Future<bool> checkInternet() async {
  try {
    var connectivityResult = await (Connectivity().checkConnectivity());
    if (connectivityResult == ConnectivityResult.none) {
      return false;
    } else {
      return true;
    }
  } catch (e) {
    return false;
  }
}