1.更新眠花糖ios控制页空白 2.修复ios首页第一次点击控制无效果 3.修复ios扫描蓝牙的错误提示
This commit is contained in:
@@ -61,7 +61,7 @@ class _BlueteethDevicePageState extends State<BlueteethDevicePage> {
|
|||||||
Get.find<BlueteethBindController>().startStatusPolling();
|
Get.find<BlueteethBindController>().startStatusPolling();
|
||||||
blueteethBindController.search.value = "";
|
blueteethBindController.search.value = "";
|
||||||
blueteethBindController.currentDeviceMac?.value = "";
|
blueteethBindController.currentDeviceMac?.value = "";
|
||||||
BluetoothHelper.listenBluetoothState((isOn) {
|
BluetoothHelper.listenBluetoothState((isOn) async {
|
||||||
blueteethBindController.model.bluetooth = isOn;
|
blueteethBindController.model.bluetooth = isOn;
|
||||||
if (isOn) {
|
if (isOn) {
|
||||||
isScanning = false;
|
isScanning = false;
|
||||||
@@ -69,6 +69,9 @@ class _BlueteethDevicePageState extends State<BlueteethDevicePage> {
|
|||||||
}
|
}
|
||||||
blueteethBindController.updateAll();
|
blueteethBindController.updateAll();
|
||||||
if (!isOn && !_isDialogShowing) {
|
if (!isOn && !_isDialogShowing) {
|
||||||
|
await Future.delayed(Duration(seconds: 2));
|
||||||
|
bool isReallyOn = await FlutterBluePlus.isOn;
|
||||||
|
if (!isReallyOn) {
|
||||||
_isDialogShowing = true;
|
_isDialogShowing = true;
|
||||||
blueteethBindController.model.devicelist = [];
|
blueteethBindController.model.devicelist = [];
|
||||||
blueteethBindController.model.betDevicelist = [];
|
blueteethBindController.model.betDevicelist = [];
|
||||||
@@ -77,6 +80,7 @@ class _BlueteethDevicePageState extends State<BlueteethDevicePage> {
|
|||||||
_isDialogShowing = false;
|
_isDialogShowing = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,11 +63,14 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
|||||||
mhtBlueToothController.startStatusPolling();
|
mhtBlueToothController.startStatusPolling();
|
||||||
mhtBlueToothController.search.value = "";
|
mhtBlueToothController.search.value = "";
|
||||||
mhtBlueToothController.currentDeviceMac?.value = "";
|
mhtBlueToothController.currentDeviceMac?.value = "";
|
||||||
BluetoothHelper.listenBluetoothState((isOn) {
|
BluetoothHelper.listenBluetoothState((isOn) async {
|
||||||
mhtBlueToothController.model.bluetooth = isOn;
|
mhtBlueToothController.model.bluetooth = isOn;
|
||||||
mhtBlueToothController.updateAll();
|
mhtBlueToothController.updateAll();
|
||||||
|
|
||||||
if (!isOn && !_isDialogShowing) {
|
if (!isOn && !_isDialogShowing) {
|
||||||
|
await Future.delayed(Duration(seconds: 2));
|
||||||
|
bool isReallyOn = await FlutterBluePlus.isOn;
|
||||||
|
if (!isReallyOn) {
|
||||||
_isDialogShowing = true;
|
_isDialogShowing = true;
|
||||||
mhtBlueToothController.model.blueRawData = [];
|
mhtBlueToothController.model.blueRawData = [];
|
||||||
mhtBlueToothController.model.deviceDataStatus = [];
|
mhtBlueToothController.model.deviceDataStatus = [];
|
||||||
@@ -76,6 +79,7 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
|
|||||||
_isDialogShowing = false;
|
_isDialogShowing = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -238,6 +238,7 @@ Future<Map> checkBlueToothPermissin() async {
|
|||||||
var locationGranted;
|
var locationGranted;
|
||||||
|
|
||||||
if (Platform.isIOS) {
|
if (Platform.isIOS) {
|
||||||
|
try {
|
||||||
PermissionStatus isBleGranted = await Permission.bluetooth.request();
|
PermissionStatus isBleGranted = await Permission.bluetooth.request();
|
||||||
if (!isBleGranted.isGranted) {
|
if (!isBleGranted.isGranted) {
|
||||||
// startBluetoothScanning();
|
// startBluetoothScanning();
|
||||||
@@ -256,6 +257,9 @@ Future<Map> checkBlueToothPermissin() async {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
|
} catch (e) {
|
||||||
|
ef.log("${e.toString()}");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
// 先显示权限说明弹窗(同屏显示)
|
// 先显示权限说明弹窗(同屏显示)
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
|||||||
),
|
),
|
||||||
settings: buildsettings(),
|
settings: buildsettings(),
|
||||||
params: PlatformHeadlessInAppWebViewCreationParams(
|
params: PlatformHeadlessInAppWebViewCreationParams(
|
||||||
onLoadStop: (controller, url) {
|
onLoadStop: (controller, url) async {
|
||||||
setState(() {
|
setState(() {
|
||||||
ready.value = true;
|
ready.value = true;
|
||||||
});
|
});
|
||||||
@@ -64,6 +64,9 @@ class WebviewTestController extends GetControllerEx<WebviewTestModel> {
|
|||||||
// ef.log("[请求资源时间]${web.requestTimestamp}");
|
// ef.log("[请求资源时间]${web.requestTimestamp}");
|
||||||
// _startMonitoringIfNeeded();
|
// _startMonitoringIfNeeded();
|
||||||
},
|
},
|
||||||
|
initialSettings: InAppWebViewSettings(
|
||||||
|
allowsBackForwardNavigationGestures: false, // 禁用侧滑返回/前进手势
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
@@ -617,7 +620,12 @@ class WebviewTestView extends GetComponent<WebviewTestController> {
|
|||||||
final mainAxisAlignment =
|
final mainAxisAlignment =
|
||||||
showWeb ? MainAxisAlignment.start : MainAxisAlignment.center;
|
showWeb ? MainAxisAlignment.start : MainAxisAlignment.center;
|
||||||
|
|
||||||
return Scaffold(
|
return PopScope(
|
||||||
|
canPop: false, // 完全禁止页面返回
|
||||||
|
onPopInvoked: (didPop) async {
|
||||||
|
if (didPop) return;
|
||||||
|
},
|
||||||
|
child: Scaffold(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
body: Column(
|
body: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
@@ -730,38 +738,6 @@ class WebviewTestView extends GetComponent<WebviewTestController> {
|
|||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.topLeft,
|
alignment: Alignment.topLeft,
|
||||||
child: Obx(() {
|
child: Obx(() {
|
||||||
// return (controller.ready.value && (MainPageBBottomChange.getCurrentIndex() == 2))
|
|
||||||
// return (controller.ready.value && (MainPageBBottomChange.getCurrentIndex() == 2)&& controller.loadRecource.value == true)
|
|
||||||
// return Stack(children: [
|
|
||||||
// controller.ready.value
|
|
||||||
// ? controller.web.build()
|
|
||||||
// : Container(),
|
|
||||||
// Text("1222121212"),
|
|
||||||
// ]);
|
|
||||||
// return Stack(
|
|
||||||
// children: [
|
|
||||||
// controller.ready.value
|
|
||||||
// ? controller.web.build()
|
|
||||||
// : Container(),
|
|
||||||
|
|
||||||
// // 只有 loadRecource == false 时才显示覆盖文字
|
|
||||||
// if (!controller.loadRecource.value)
|
|
||||||
// Positioned.fill(
|
|
||||||
// child: Container(
|
|
||||||
// color: Colors.black54, // 半透明遮罩,可选
|
|
||||||
// alignment: Alignment.center,
|
|
||||||
// child: Text(
|
|
||||||
// "资源加载中...",
|
|
||||||
// style: TextStyle(
|
|
||||||
// color: Colors.red,
|
|
||||||
// fontSize: 30.rpx,
|
|
||||||
// fontWeight: FontWeight.bold,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ],
|
|
||||||
// );
|
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
controller.ready.value
|
controller.ready.value
|
||||||
@@ -782,7 +758,8 @@ class WebviewTestView extends GetComponent<WebviewTestController> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
CircularProgressIndicator(
|
CircularProgressIndicator(
|
||||||
valueColor: AlwaysStoppedAnimation<Color>(
|
valueColor:
|
||||||
|
AlwaysStoppedAnimation<Color>(
|
||||||
Colors.white),
|
Colors.white),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -796,7 +773,7 @@ class WebviewTestView extends GetComponent<WebviewTestController> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user