checkConnection static method
Implementation
static Future<bool> checkConnection({String url="google.com"}) async {
bool connected=false;
try {
final result = await InternetAddress.lookup(url);
if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) {
connected=true;
}
} on SocketException catch (_) {
}
return connected;
}