hasNetwork method

Future<bool> hasNetwork()

Implementation

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