更新睡眠报告正式地址

This commit is contained in:
wyf
2025-08-30 09:15:18 +08:00
parent ae6933bd96
commit f7b11fbb7e
14 changed files with 278 additions and 168 deletions

View File

@@ -42,6 +42,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
Timer? _timeoutTimer;
StreamSubscription<List<ScanResult>>? _scanSubscription;
bool _isDisposed = false;
ScanResult? targetDevice;
@override
void initState() {
@@ -916,7 +917,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
_scanSubscription = FlutterBluePlus.scanResults.listen((results) async {
if (_isDisposed) return;
ScanResult? targetDevice;
for (var r in results) {
if (r.advertisementData.manufacturerData.containsKey(0xFFED)) {
@@ -937,7 +938,7 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
_scanSubscription?.cancel();
try {
THapp bledevice = THapp(device: targetDevice.device);
THapp bledevice = THapp(device: targetDevice!.device);
await bledevice.device.connect();
var res2 = bledevice.isConnected;
@@ -1085,7 +1086,8 @@ class _MHTWifiAfterPageState extends State<MHTWifiAfterPage> {
Future<void> _disconnectDevice() async {
try {
THapp bledevice = THapp(device: widget.deviceInfo.scanResult.device);
// THapp bledevice = THapp(device: widget.deviceInfo.scanResult.device);
THapp bledevice = THapp(device: targetDevice!.device);
await bledevice.disconnect();
DailyLogUtils.writeLog("关闭蓝牙连接成功".tr);
} catch (e) {