hasInternetConnection method
Check if internet is available (more reliable than just connectivity check)
Implementation
Future<bool> hasInternetConnection() async {
try {
// First check connectivity
final hasConnectivity = await checkConnectivity();
if (!hasConnectivity) return false;
// You can add additional ping test here if needed
// For now, we trust the connectivity result
return true;
} catch (e) {
return false;
}
}