networkCheck static method

Future<bool> networkCheck()

Implementation

static Future<bool> networkCheck() async {
  bool result = false;
  try {
    final connectivityResult = await (Connectivity().checkConnectivity());
    if (connectivityResult == ConnectivityResult.mobile ||
        connectivityResult == ConnectivityResult.wifi) {
      result = true;
    }
  } catch (e) {
    result = true;
  }

  return result;
}