isInternetConnectionAvailable static method
Implementation
static Future<bool> isInternetConnectionAvailable() async {
try {
final result = await InternetAddress.lookup('google.com');
return result.isNotEmpty && result[0].rawAddress.isNotEmpty;
} catch (exception) {
return false;
}
}