hasInternet method

Future<bool> hasInternet()

Implementation

Future<bool> hasInternet() async {
  if (heartbeatUrl != null) {
    try {
      final response = await _dio.head(heartbeatUrl!);
      if (response.statusCode != null) return true;
    } catch (e) {}
  }

  return await _checkDnsConnection();
}