判断设备是否连接WiFi
Future<bool> isConnectedToWiFi() async { var connectivityResult = await Connectivity().checkConnectivity(); return connectivityResult.contains(ConnectivityResult.wifi); }