修复部分语言中文
This commit is contained in:
@@ -797,12 +797,7 @@ class _WifiPageState extends State<WifiPage> {
|
||||
Get.toNamed("/calibrationPage",
|
||||
arguments: 1);
|
||||
});
|
||||
} else if (aa == 'unknown') {
|
||||
// TopSlideNotification.show(
|
||||
// context,
|
||||
// text: "获取设备网络类型失败".tr,
|
||||
// textColor: themeController.currentColor.sc9,
|
||||
// );
|
||||
} else if (aa == 'unknown') {
|
||||
blueteethBindController
|
||||
.netType.value = 3;
|
||||
blueteethBindController.updateAll();
|
||||
@@ -1185,161 +1180,6 @@ class _WifiPageState extends State<WifiPage> {
|
||||
}
|
||||
}
|
||||
|
||||
// Future<void> dealWifi(String mac) async {
|
||||
// final blueteethBindController = Get.find<BlueteethBindController>();
|
||||
// final themeController = Get.find<ThemeController>();
|
||||
|
||||
// // 显示加载对话框
|
||||
// // showLoadingDialog(Get.context!, title: "连接中...".tr);
|
||||
|
||||
// // 设置超时定时器
|
||||
// Timer? timeoutTimer;
|
||||
// bool isConnected = false;
|
||||
|
||||
// try {
|
||||
// // 开始扫描蓝牙设备
|
||||
// await FlutterBluePlus.startScan(timeout: Duration(seconds: 10));
|
||||
|
||||
// // 设置超时(20秒)
|
||||
// timeoutTimer = Timer(Duration(seconds: 20), () {
|
||||
// try {
|
||||
// if (!isConnected) {
|
||||
// blueteethBindController.blueConnectFlag.value = 1;
|
||||
// blueteethBindController.updateAll();
|
||||
// // Navigator.of(context).pop(); // 先关闭 dialog
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
// TopSlideNotification.show(
|
||||
// context,
|
||||
// text: "设备连接超时,请重试".tr,
|
||||
// textColor: themeController.currentColor.sc9,
|
||||
// );
|
||||
// });
|
||||
// FlutterBluePlus.stopScan();
|
||||
// }
|
||||
// } catch (e) {
|
||||
// print(e);
|
||||
// }
|
||||
// });
|
||||
|
||||
// // 监听扫描结果
|
||||
// StreamSubscription<List<ScanResult>>? scanSubscription;
|
||||
// scanSubscription = FlutterBluePlus.scanResults.listen((results) async {
|
||||
// // 过滤出符合条件的设备
|
||||
// ScanResult? targetDevice;
|
||||
|
||||
// for (var r in results) {
|
||||
// if (r.advertisementData.manufacturerData.containsKey(0xFFED)) {
|
||||
// List<int> rawData = r.advertisementData.manufacturerData[0xFFED]!;
|
||||
// BleDeviceData deviceData = parseBleData(rawData);
|
||||
// String deviceMac =
|
||||
// deviceData.deviceId.replaceAll(':', '').toLowerCase();
|
||||
// if (deviceMac == mac.toLowerCase()) {
|
||||
// targetDevice = r;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (targetDevice != null && !isConnected) {
|
||||
// isConnected = true;
|
||||
// FlutterBluePlus.stopScan();
|
||||
// scanSubscription?.cancel();
|
||||
// timeoutTimer?.cancel();
|
||||
|
||||
// try {
|
||||
// // 连接设备
|
||||
// // await targetDevice.device.connect();
|
||||
// THapp bledevice = THapp(device: targetDevice.device);
|
||||
// await bledevice.device.connect();
|
||||
// var res2 = bledevice.isConnected;
|
||||
// if (res2) {
|
||||
// // Navigator.pop(context);
|
||||
// blueteethBindController.blueConnectFlag.value = 2;
|
||||
// TopSlideNotification.show(
|
||||
// context,
|
||||
// text: "蓝牙绑定.连接成功".tr,
|
||||
// textColor: themeController.currentColor.sc2,
|
||||
// );
|
||||
// blueteethBindController.currentDevice = bledevice;
|
||||
// if (lisObj != null) {
|
||||
// lisObj!.cancel();
|
||||
// }
|
||||
// var aa;
|
||||
// lisObj = blueteethBindController.currentDevice!.statusStream
|
||||
// .listen((onData) async {
|
||||
// if (onData.status == BleEventType.recvLineLog) {
|
||||
// final line = onData.val;
|
||||
// print("[bleee]:" + line);
|
||||
// }
|
||||
// if (onData.status == BleEventType.ready) {
|
||||
// aa = await getDeviceNetVersion(
|
||||
// blueteethBindController.currentDevice!, 0);
|
||||
// if (aa == "4g") {
|
||||
// // TopSlideNotification.show(
|
||||
// // Get.context!,
|
||||
// // text: "4g设备配置wifi提示".tr,
|
||||
// // textColor: themeController.currentColor.sc9,
|
||||
// // );
|
||||
// updateDeviceBindStatus(
|
||||
// blueteethBindController.currentDeviceMac!.value);
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
// TopSlideNotification.show(
|
||||
// context,
|
||||
// text: "4g设备配置wifi提示".tr,
|
||||
// textColor: themeController.currentColor.sc9,
|
||||
// );
|
||||
// Get.back();
|
||||
// });
|
||||
// return;
|
||||
// } else if (aa == 'unknown') {
|
||||
// blueteethBindController.netType.value = 3;
|
||||
// blueteethBindController.updateAll();
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
// TopSlideNotification.show(
|
||||
// context,
|
||||
// text: "获取设备网络类型失败".tr,
|
||||
// textColor: themeController.currentColor.sc9,
|
||||
// );
|
||||
// });
|
||||
// } else {
|
||||
// await initWifiStatusAndWifiList();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// // Navigator.pop(context);
|
||||
// TopSlideNotification.show(
|
||||
// context,
|
||||
// text: "蓝牙绑定.连接失败".tr,
|
||||
// textColor: themeController.currentColor.sc9,
|
||||
// );
|
||||
// }
|
||||
// } catch (e) {
|
||||
// // Navigator.of(Get.context!).pop(); // 关闭加载对话框
|
||||
// TopSlideNotification.show(
|
||||
// Get.context!,
|
||||
// text: "设备连接失败".tr,
|
||||
// textColor: themeController.currentColor.sc9,
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// // 等待扫描完成
|
||||
// await Future.delayed(Duration(seconds: 20));
|
||||
// } catch (e) {
|
||||
// timeoutTimer?.cancel();
|
||||
// Navigator.of(Get.context!).pop(); // 关闭加载对话框
|
||||
// TopSlideNotification.show(
|
||||
// Get.context!,
|
||||
// text: "扫描过程中发生错误".tr,
|
||||
// textColor: themeController.currentColor.sc9,
|
||||
// );
|
||||
// } finally {
|
||||
// timeoutTimer?.cancel();
|
||||
// await FlutterBluePlus.stopScan();
|
||||
// }
|
||||
// }
|
||||
|
||||
Future<void> dealWifi(String mac,
|
||||
{bool needTip = true, bool needSuccess = false}) async {
|
||||
|
||||
Reference in New Issue
Block a user