更新快检报告
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'dart:ui';
|
||||
import 'dart:io'; // 添加这个导入
|
||||
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -22,6 +23,18 @@ class _MattressControlPageState extends State<MattressControlPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// 如果是 iOS 平台,使用 PopScope 禁用左滑返回
|
||||
if (Platform.isIOS) {
|
||||
return PopScope(
|
||||
canPop: false, // 禁用返回手势
|
||||
child: buildContent(),
|
||||
);
|
||||
}
|
||||
return buildContent();
|
||||
}
|
||||
|
||||
// 将原有的 build 内容提取到这个方法中
|
||||
Widget buildContent() {
|
||||
return LayoutBuilder(
|
||||
builder: (context, bodySize) => GestureDetector(
|
||||
child: Obx(() {
|
||||
@@ -73,4 +86,4 @@ class _MattressControlPageState extends State<MattressControlPage> {
|
||||
|
||||
class ControlCardController extends GetxController {
|
||||
final List<RxBool> switchStates = List.generate(9, (index) => false.obs);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user