Future<bool> hasInternetConnection() async { try { final response = await Dio().get('https://www.google.cn'); return response.statusCode == 200; } catch (e) { return false; } }