diff --git a/assets/file.json b/assets/file.json index 50d05df..b0b2804 100644 --- a/assets/file.json +++ b/assets/file.json @@ -1,3 +1,3 @@ [ - "assets/miniapp/mhtControl_1.0.60.zip" + "assets/miniapp/mhtControl_1.0.63.zip" ] \ No newline at end of file diff --git a/assets/miniapp/mhtControl_1.0.60.zip b/assets/miniapp/mhtControl_1.0.63.zip similarity index 97% rename from assets/miniapp/mhtControl_1.0.60.zip rename to assets/miniapp/mhtControl_1.0.63.zip index e5976d3..80623c2 100644 Binary files a/assets/miniapp/mhtControl_1.0.60.zip and b/assets/miniapp/mhtControl_1.0.63.zip differ diff --git a/lib/pages/mh_page/device/component/DeviceComponentWidget.dart b/lib/pages/mh_page/device/component/DeviceComponentWidget.dart index 654224e..7b1e197 100644 --- a/lib/pages/mh_page/device/component/DeviceComponentWidget.dart +++ b/lib/pages/mh_page/device/component/DeviceComponentWidget.dart @@ -78,12 +78,12 @@ class _DeviceComponentWidgetState extends State { return SizedBox( width: 24.rpx, height: 24.rpx, - child:CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation( - themeController.currentColor.sc1, - ), + child: CircularProgressIndicator( + strokeWidth: 2, + valueColor: AlwaysStoppedAnimation( + Colors.white, ), + ), ); } return Container(); @@ -388,12 +388,12 @@ class _DeviceComponentWidgetState extends State { return SizedBox( width: 24.rpx, height: 24.rpx, - child:CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation( - themeController.currentColor.sc1, - ), + child: CircularProgressIndicator( + strokeWidth: 2, + valueColor: AlwaysStoppedAnimation( + themeController.currentColor.sc1, ), + ), ); } return Container(); diff --git a/lib/pages/mh_page/device/mht_wifi_page.dart b/lib/pages/mh_page/device/mht_wifi_page.dart index 4afd10d..a353de8 100644 --- a/lib/pages/mh_page/device/mht_wifi_page.dart +++ b/lib/pages/mh_page/device/mht_wifi_page.dart @@ -170,11 +170,11 @@ class _MHTWifiPageState extends State { width: 24.rpx, height: 24.rpx, child: CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation( - themeController.currentColor.sc1, - ), - ), + strokeWidth: 2, + valueColor: AlwaysStoppedAnimation( + Colors.white, + ), + ), ); } if (blueteethBindController.netType.value == 0) { @@ -182,11 +182,11 @@ class _MHTWifiPageState extends State { width: 24.rpx, height: 24.rpx, child: CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation( - themeController.currentColor.sc1, - ), - ), + strokeWidth: 2, + valueColor: AlwaysStoppedAnimation( + themeController.currentColor.sc1, + ), + ), ); } if (blueteethBindController.wifiConnectStatus.value == @@ -195,11 +195,11 @@ class _MHTWifiPageState extends State { width: 24.rpx, height: 24.rpx, child: CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation( - themeController.currentColor.sc1, - ), - ), + strokeWidth: 2, + valueColor: AlwaysStoppedAnimation( + themeController.currentColor.sc1, + ), + ), ); } return Container(); @@ -643,12 +643,16 @@ class _MHTWifiPageState extends State { width: 32.rpx, height: 32.rpx, child: - CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation( - themeController.currentColor.sc1, - ), - ), + CircularProgressIndicator( + strokeWidth: 2, + valueColor: + AlwaysStoppedAnimation< + Color>( + themeController + .currentColor + .sc1, + ), + ), ) else getWifiIconByRsso( diff --git a/lib/pages/mh_page/device/mht_wifi_page_after.dart b/lib/pages/mh_page/device/mht_wifi_page_after.dart index 7c60537..cde5d06 100644 --- a/lib/pages/mh_page/device/mht_wifi_page_after.dart +++ b/lib/pages/mh_page/device/mht_wifi_page_after.dart @@ -52,7 +52,7 @@ class _MHTWifiAfterPageState extends State { }); } - void _initController() { + void _initController() { blueteethBindController.netType.value = 0; blueteethBindController.connectStatus.value = 0; blueteethBindController.wifiList = [].obs; @@ -166,24 +166,24 @@ class _MHTWifiAfterPageState extends State { return SizedBox( width: 24.rpx, height: 24.rpx, - child:CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation( - themeController.currentColor.sc1, - ), - ), + child: CircularProgressIndicator( + strokeWidth: 2, + valueColor: AlwaysStoppedAnimation( + Colors.white, + ), + ), ); } if (blueteethBindController.netType.value == 0) { return SizedBox( width: 24.rpx, height: 24.rpx, - child:CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation( - themeController.currentColor.sc1, - ), - ), + child: CircularProgressIndicator( + strokeWidth: 2, + valueColor: AlwaysStoppedAnimation( + themeController.currentColor.sc1, + ), + ), ); } if (blueteethBindController.wifiConnectStatus.value == @@ -191,12 +191,12 @@ class _MHTWifiAfterPageState extends State { return SizedBox( width: 24.rpx, height: 24.rpx, - child:CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation( - themeController.currentColor.sc1, - ), - ), + child: CircularProgressIndicator( + strokeWidth: 2, + valueColor: AlwaysStoppedAnimation( + themeController.currentColor.sc1, + ), + ), ); } return Container(); @@ -206,7 +206,7 @@ class _MHTWifiAfterPageState extends State { Positioned( left: 0, child: returnIconButtom, - ), + ), ], ), ), @@ -616,12 +616,16 @@ class _MHTWifiAfterPageState extends State { width: 32.rpx, height: 32.rpx, child: - CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation( - themeController.currentColor.sc1, - ), - ), + CircularProgressIndicator( + strokeWidth: 2, + valueColor: + AlwaysStoppedAnimation< + Color>( + themeController + .currentColor + .sc1, + ), + ), ) else getWifiIconByRsso( diff --git a/lib/pages/mh_page/homepage/component/HomeDeviceStausWidget.dart b/lib/pages/mh_page/homepage/component/HomeDeviceStausWidget.dart index 23fb9ee..7dbf8f9 100644 --- a/lib/pages/mh_page/homepage/component/HomeDeviceStausWidget.dart +++ b/lib/pages/mh_page/homepage/component/HomeDeviceStausWidget.dart @@ -206,7 +206,7 @@ Future checkBlueToothPermissin() async { if (Platform.isIOS) { PermissionStatus isBleGranted = await Permission.bluetooth.request(); - if (isBleGranted.isGranted) { + if (!isBleGranted.isGranted) { // startBluetoothScanning(); await FlutterBluePlus.startScan(timeout: Duration(seconds: 10)); data = { diff --git a/lib/pages/mh_page/test/WebviewTestModel.dart b/lib/pages/mh_page/test/WebviewTestModel.dart index 0f71465..f64a0b0 100644 --- a/lib/pages/mh_page/test/WebviewTestModel.dart +++ b/lib/pages/mh_page/test/WebviewTestModel.dart @@ -62,7 +62,24 @@ class WebviewTestController extends GetControllerEx { ); try { web.jsbridge!.bind((bridge) { - var minible = Minibleapp(bridge: bridge); + var minible = Minibleapp( + bridge: bridge, + onConnect: (args1, args2) { + final devices = args1.devices as Map; + final mac = args2 as String; + + // 找出对应设备 + final device = devices[mac]; + + if (device != null) { + ef.log('Minibleapp connected: $mac -> $device'); + return device; + } else { + ef.log('Minibleapp connected: $mac not found in devices'); + return null; + } + }, + ); // ef.kvroot.devicelist.listen((x) {}); bridge.sdk.updateDeviceRoute((args) async { ef.log('updateDeviceRoute: $args');