connectionChecker static method

Future<bool> connectionChecker()

Implementation

static Future<bool> connectionChecker() async {
  try {
    final result = await InternetAddress.lookup('www.google.com');
    if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) {
      print(result);
      return true;
    } else {
      return false;
    }
  } on SocketException catch (_) {
    return false;
  }
}