更新分享设备权限

This commit is contained in:
wyf
2025-12-08 11:06:54 +08:00
parent db51c42664
commit 8285599aa9
14 changed files with 935 additions and 108 deletions

View File

@@ -203,9 +203,12 @@ class _BodyDevicePageState extends State<BodyDeviceWidget> {
}
// 标签切换回调
void _onTabChanged(int index) {
Future<void> _onTabChanged(int index) async {
_pageController.animateToPage(index,
duration: const Duration(milliseconds: 300), curve: Curves.easeInOut);
BodyDeviceController deviceController = Get.find();
await deviceController.getDeviceList();
await deviceController.getSleepReport();
}
// 页面切换回调

View File

@@ -106,8 +106,12 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
// 计算弹窗需要的实际高度(估算)
final estimatedItemHeight = 66.rpx; // 每个菜单项的估算高度
//todo 更新菜单项,需要在此添加数量
final itemCount =
widget.device['bind_type'] == BindType.active.code ? 9 : 5;
// final itemCount =
// widget.device['bind_type'] == BindType.active.code ? 9 : 5;
final itemCount = widget.device['bind_type'] == BindType.active.code
? 9
: (getWifiPermissionByOpType(widget.device) ? 6 : 5);
final estimatedPopupHeight =
(itemCount * estimatedItemHeight) + 40.rpx; // 加上padding
@@ -288,59 +292,129 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
),
];
if (widget.device['bind_type'] == BindType.active.code &&
!AppConstants.is_test_account) {
items.addAll([
_buildMenuItem(
text: "WIFI配置".tr,
onTap: () {
setState(() {
_isPopupOpen = false;
});
_popupEntry?.remove();
_popupEntry = null;
dealWifi(widget.device);
},
),
_buildMenuItem(
text: "设备校准".tr,
onTap: () async {
setState(() {
_isPopupOpen = false;
});
_popupEntry?.remove();
_popupEntry = null;
BlueteethBindController blueteethBindController = Get.find();
blueteethBindController.currentDeviceMac?.value =
widget.device['mac'];
await Get.toNamed("/calibrationPersonPage", arguments: 2);
},
),
_buildMenuItem(
text: "分享设备".tr,
onTap: () {
setState(() {
_isPopupOpen = false;
});
_popupEntry?.remove();
_popupEntry = null;
Get.toNamed("/deviceSharePage", arguments: widget.device);
},
),
_buildMenuItem(
text: "消息设置".tr,
onTap: () {
setState(() {
_isPopupOpen = false;
});
_popupEntry?.remove();
_popupEntry = null;
// Get.toNamed("/deviceDetail", arguments: widget.device);
Get.toNamed("/messageSettingPage", arguments: widget.device);
// TopSlideNotification.show(context, text: "待开发功能".tr);
},
),
]);
// if ((widget.device['bind_type'] == BindType.active.code &&
// !AppConstants.is_test_account) ||
// (getWifiPermissionByOpType(widget.device))) {
// items.addAll([
// _buildMenuItem(
// text: "WIFI配置".tr,
// onTap: () {
// setState(() {
// _isPopupOpen = false;
// });
// _popupEntry?.remove();
// _popupEntry = null;
// dealWifi(widget.device);
// },
// ),
// _buildMenuItem(
// text: "设备校准".tr,
// onTap: () async {
// setState(() {
// _isPopupOpen = false;
// });
// _popupEntry?.remove();
// _popupEntry = null;
// BlueteethBindController blueteethBindController = Get.find();
// blueteethBindController.currentDeviceMac?.value =
// widget.device['mac'];
// await Get.toNamed("/calibrationPersonPage", arguments: 2);
// },
// ),
// _buildMenuItem(
// text: "分享设备".tr,
// onTap: () {
// setState(() {
// _isPopupOpen = false;
// });
// _popupEntry?.remove();
// _popupEntry = null;
// Get.toNamed("/deviceSharePage", arguments: widget.device);
// },
// ),
// _buildMenuItem(
// text: "消息设置".tr,
// onTap: () {
// setState(() {
// _isPopupOpen = false;
// });
// _popupEntry?.remove();
// _popupEntry = null;
// // Get.toNamed("/deviceDetail", arguments: widget.device);
// Get.toNamed("/messageSettingPage", arguments: widget.device);
// // TopSlideNotification.show(context, text: "待开发功能".tr);
// },
// ),
// ]);
// }
// 是否有基础操作权限(除 WIFI 外)
bool hasBasePermission =
widget.device['bind_type'] == BindType.active.code &&
!AppConstants.is_test_account;
// 是否有 WIFI 权限
bool hasWifiPermission = getWifiPermissionByOpType(widget.device);
// WIFI 配置 —— 单独判断
if (hasBasePermission || hasWifiPermission) {
if (hasWifiPermission) {
items.add(
_buildMenuItem(
text: "WIFI配置".tr,
onTap: () {
setState(() {
_isPopupOpen = false;
});
_popupEntry?.remove();
_popupEntry = null;
dealWifi(widget.device);
},
),
);
}
// 下面这些 **只受 hasBasePermission 影响**
if (hasBasePermission) {
items.addAll([
_buildMenuItem(
text: "设备校准".tr,
onTap: () async {
setState(() {
_isPopupOpen = false;
});
_popupEntry?.remove();
_popupEntry = null;
BlueteethBindController blueteethBindController = Get.find();
blueteethBindController.currentDeviceMac?.value =
widget.device['mac'];
await Get.toNamed("/calibrationPersonPage", arguments: 2);
},
),
_buildMenuItem(
text: "分享设备".tr,
onTap: () {
setState(() {
_isPopupOpen = false;
});
_popupEntry?.remove();
_popupEntry = null;
Get.toNamed("/deviceSharePage", arguments: widget.device);
},
),
_buildMenuItem(
text: "消息设置".tr,
onTap: () {
setState(() {
_isPopupOpen = false;
});
_popupEntry?.remove();
_popupEntry = null;
Get.toNamed("/messageSettingPage", arguments: widget.device);
},
),
]);
}
}
items.addAll([
@@ -1620,4 +1694,12 @@ class _DeviceDataComponentWidgetState extends State<DeviceDataComponentWidget> {
personController.updateAll();
}
}
getWifiPermissionByOpType(Map<String, dynamic> device) {
int opType = device['op_type'] ?? 2;
if (opType != null && opType == 1) {
return true;
}
return false;
}
}

View File

@@ -0,0 +1,538 @@
import 'package:ef/base/widget/flutterflow/FlutterFlowTheme.dart';
import 'package:ef/ef.dart';
import 'package:flutter/material.dart';
import 'package:vbvs_app/common/color/ServiceConstant.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/common/util/requestWithLog.dart';
import 'package:vbvs_app/component/tool/CustomCard.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/device/body_device_controller.dart';
import 'package:vbvs_app/controller/device/device_share_list_controller.dart';
import 'package:vbvs_app/pages/device_bind/componnet/bind_dialog.dart';
import 'package:vbvs_app/pages/mh_page/test/WebviewTestModel.dart';
class THShareDeviceDetailWidget extends GetView {
final scaffoldKey = GlobalKey<ScaffoldState>();
List data; // 保持原始类型
String device; // 新增:设备信息
THShareDeviceDetailWidget(
{super.key, required this.data, required this.device}); // 修改构造函数
DeviceShareListController deviceShareListController = Get.find();
// 转换为List<Map>的getter
List<Map<String, dynamic>> get dataList {
if (data is List<Map<String, dynamic>>) {
return data as List<Map<String, dynamic>>;
} else if (data is List) {
// 尝试转换
return (data as List).map((item) {
if (item is Map<String, dynamic>) {
return item;
} else if (item is Map) {
// 转换为Map<String, dynamic>
return Map<String, dynamic>.from(item);
}
return <String, dynamic>{};
}).toList();
}
return [];
}
// 获取分享id
String? get shareId {
try {
for (var item in dataList) {
if (item.containsKey('id') && item['id'] != null) {
return item['id'].toString();
}
}
return null;
} catch (e) {
print('获取shareId错误: $e');
return null;
}
}
// 获取uid
String? get uid {
try {
for (var item in dataList) {
if (item.containsKey('uid') && item['uid'] != null) {
return item['uid'].toString();
}
}
return null;
} catch (e) {
print('获取uid错误: $e');
return null;
}
}
// 获取opType
int get currentOpType {
try {
for (var item in dataList) {
if (item.containsKey('opType') && item['opType'] != null) {
return int.tryParse(item['opType'].toString()) ?? 1;
}
}
return 1;
} catch (e) {
print('获取opType错误: $e');
return 1;
}
}
// 切换wifi配置开关的方法
void toggleWifiConfig() {
int newOpType;
if (opType.value == 1) {
// 如果当前是允许配置wifi则切换为不允许
newOpType = 2;
} else {
// 如果当前是不允许配置wifi则切换为允许
newOpType = 1;
}
// 更新数据列表中的opType
bool updated = false;
for (var i = 0; i < dataList.length; i++) {
if (dataList[i].containsKey('opType')) {
// 如果是原始数据是List<Map>类型,我们需要更新原始数据
if (data is List<Map>) {
(data as List<Map>)[i]['opType'] = newOpType;
} else if (data is List) {
// 尝试更新原始数据
try {
(data as List)[i] = {...dataList[i], 'opType': newOpType};
} catch (e) {
print('更新opType错误: $e');
}
}
updated = true;
break;
}
}
// 如果没有找到opType项添加一个
if (!updated) {
if (data is List<Map>) {
(data as List<Map>).add({'opType': newOpType});
} else if (data is List) {
(data as List).add({'opType': newOpType});
}
}
opType.value = newOpType;
print('切换opType为: $newOpType');
}
// 检查是否允许配置wifi
bool get isAllowWifiConfig => opType.value == 1;
getLine() {
return Divider(
color: const Color(0XFF929699),
thickness: 0.5.rpx,
);
}
var opType = 2.obs;
bool isProgrammaticPop = false;
DateTime? _lastBackPressedTime;
BodyDeviceController bodyDeviceController = Get.find();
@override
Widget build(BuildContext context) {
// 初始化opType
WidgetsBinding.instance.addPostFrameCallback((_) {
final current = currentOpType;
if (opType.value != current) {
opType.value = current;
}
print('初始化opType: ${opType.value}');
});
return GestureDetector(
child: Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/img/bgNoImg.png'), // 本地图片
fit: BoxFit.fill,
),
),
child: Scaffold(
key: scaffoldKey,
backgroundColor: Colors.transparent,
appBar: AppBar(
iconTheme: IconThemeData(color: themeController.currentColor.sc3),
backgroundColor: themeController.currentColor.sc17,
automaticallyImplyLeading: false,
titleSpacing: 0,
title: SizedBox(
width: double.infinity,
height: 180.rpx,
child: Stack(
alignment: Alignment.center,
children: [
Text(
'详情'.tr,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 30.rpx,
),
),
Positioned(
left: 0.rpx,
child: returnIconButtomNew(onBack: () async {
// await _updateDeviceInfo(context);
}),
),
],
),
),
centerTitle: false,
),
body: PopScope(
canPop: false,
onPopInvokedWithResult: (disposition, result) async {
if (isProgrammaticPop) {
isProgrammaticPop = false;
return;
}
await _updateDeviceInfo(context);
},
child: Container(
width: MediaQuery.sizeOf(context).width,
height: MediaQuery.sizeOf(context).height * 1,
child: Padding(
padding:
EdgeInsetsDirectional.fromSTEB(30.rpx, 34.rpx, 30.rpx, 0),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: MediaQuery.sizeOf(context).width,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
),
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// 展示数据项k:v格式
Padding(
padding: EdgeInsetsDirectional.only(
start: 27.rpx,
bottom: 18.rpx,
),
child: Column(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start,
children: _buildDataItems(),
),
),
getLine(),
SizedBox(height: 25.rpx),
// opType选择部分 - 保持原来的样式
Container(
decoration: BoxDecoration(
// color: Color(0xFF003058),
borderRadius: BorderRadius.circular(16.rpx)),
child: Padding(
padding: EdgeInsetsDirectional.only(
start: 30.rpx,
top: 0.rpx,
end: 30.rpx,
bottom: 0.rpx),
child: Column(
children: [
GestureDetector(
onTap: () {
print('点击允许配置wifi');
toggleWifiConfig();
},
child: Container(
width: MediaQuery.sizeOf(context).width,
constraints: const BoxConstraints(
minHeight: 46,
),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(0),
),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
'允许对方配置wifi'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: const Color(0xFFFFFFFF),
fontSize: 27.rpx,
letterSpacing: 0.0,
),
),
Obx(() {
print(
'Obx重建当前opType: ${opType.value}');
return Container(
height: 33.rpx,
child: AspectRatio(
aspectRatio: 1,
child: Center(
child: Container(
height: 33.rpx,
width: 33.rpx,
decoration: BoxDecoration(
borderRadius:
BorderRadius
.circular(
33.rpx / 2),
border: Border.all(
width:
opType.value == 1
? 1
: 0.5,
color:
Color(0xFFC8CBD2),
),
),
child: opType.value == 1
? Center(
child: ClipOval(
child:
Container(
width:
33.rpx *
0.6,
height:
33.rpx *
0.6,
color: const Color(
0xFF6BFDAC),
),
),
)
: null,
),
),
),
);
})
],
),
),
),
],
),
)),
],
),
),
// 解除分享按钮
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
0,
0,
0,
AppConstants.page_button_bottom_padding,
),
child: Container(
width: MediaQuery.sizeOf(context).width,
height: MediaQuery.sizeOf(context).height * 0.056,
constraints: const BoxConstraints(minHeight: 46),
decoration: BoxDecoration(
color:
FlutterFlowTheme.of(context).secondaryBackground,
borderRadius: BorderRadius.circular(16.rpx),
),
child: CustomCard(
borderRadius: 16.rpx,
gradientDirection: GradientDirection.vertical,
onTap: () async {
if (uid != null) {
showConfirmDialog(context, Container(), "删除提示".tr,
onConfirm: () async {
String serviceAddress =
ServiceConstant.service_address;
String serviceName =
ServiceConstant.server_service;
String serviceApi = ServiceConstant.device_bind;
String queryUrl =
"${serviceAddress}${serviceName}${serviceApi}";
final data = {
"mac": device, // 修改使用传入的device参数
"uid": uid,
};
await requestWithLog(
logTitle: "删除分享设备",
method: MyHttpMethod.delete,
queryUrl: queryUrl,
data: data,
onSuccess: (res) {
TopSlideNotification.show(context,
text: res.msg!);
// deviceShareListController.model.all = 0;
// deviceShareListController
// .selectedShareInfo.value = [];
deviceShareListController
.getDeviceShareList(
device); // 修改使用传入的device参数
deviceShareListController.updateAll();
Get.back();
},
onFailure: (res) {
TopSlideNotification.show(context,
text: res.msg!,
textColor:
themeController.currentColor.sc9);
deviceShareListController.updateAll();
},
);
}, onCancel: () {});
}
},
colors: const [
Color(0xFFFCFCFC),
Color(0xFFF8FAF9),
Color(0XFFECF6F3),
Color(0XFFD9F0E9),
Color(0xFFCEECE3)
],
child: Container(
width: double.infinity,
height: 90.rpx,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.rpx),
),
child: Text(
"解除分享".tr,
style: TextStyle(
color: const Color(0xFF003058),
fontSize: 30.rpx,
),
),
),
),
),
),
],
),
),
),
),
),
),
);
}
// 构建数据项列表k:v格式
List<Widget> _buildDataItems() {
List<Widget> widgets = [];
for (var item in dataList) {
// 只显示包含k和v的项
if (item.containsKey('k') &&
item.containsKey('v') &&
item['k'] != null &&
item['v'] != null) {
String key = item['k'].toString();
String value = item['v'].toString();
// 跳过opType相关的显示因为我们在下面单独处理了
if (key.toLowerCase().contains('optype')) {
continue;
}
widgets.add(
Padding(
padding: EdgeInsets.only(bottom: 10.rpx),
child: Text(
'$key: $value',
style: TextStyle(
fontFamily: 'Readex Pro',
color: key == '名称' ? Color(0xFFFFFFFF) : Color(0xFF9EA4B7),
fontSize: key == '名称' ? 28.rpx : 20.rpx,
letterSpacing: 0.0,
),
),
),
);
}
}
return widgets;
}
// 更新设备信息
Future<void> _updateDeviceInfo(BuildContext context) async {
try {
String? id = shareId;
if (id == null) {
TopSlideNotification.show(
context,
text: "设备ID不存在".tr,
textColor: Color(0xFFFF7159),
);
return;
}
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.device_show;
String queryUrl = "$serviceAddress$serviceName$serviceApi";
print('准备更新设备信息id: $id, opType: ${opType.value}');
await requestWithLog(
logTitle: "更新设备信息".tr,
method: MyHttpMethod.put,
queryUrl: queryUrl,
data: {
"id": id,
"opType": opType.value,
},
onSuccess: (res) {
TopSlideNotification.show(
context,
text: "更新成功".tr,
textColor: Color(0XFF00C1AA),
);
bodyDeviceController.getDeviceList();
try {
WebviewTestController webviewTestController = Get.find();
webviewTestController.web.jsbridge?.dart.alterDevice();
} catch (e) {
ef.log("[h5]通知列表更新错误:$e");
}
isProgrammaticPop = true;
},
onFailure: (res) {
TopSlideNotification.show(
context,
text: "更新失败".tr,
textColor: Color(0xFFFF7159),
);
},
);
} catch (e) {
print('更新设备信息错误: $e');
TopSlideNotification.show(
context,
text: "更新失败".tr,
textColor: Color(0xFFFF7159),
);
}
}
}

View File

@@ -10,8 +10,9 @@ import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
class DeviceShareInfoWidget extends StatefulWidget {
final data;
final String device; // 新增:设备信息
const DeviceShareInfoWidget({super.key, required this.data});
const DeviceShareInfoWidget({super.key, required this.data, required this.device}); // 修改构造函数
@override
State<DeviceShareInfoWidget> createState() => _DeviceShareInfoWidgetState();
@@ -45,7 +46,13 @@ class _DeviceShareInfoWidgetState extends State<DeviceShareInfoWidget> {
highlightColor: themeController.currentColor.sc4,
borderRadius: 20.rpx,
padding: EdgeInsetsDirectional.fromSTEB(0.rpx, 33.rpx, 0.rpx, 33.rpx),
onTap: () {},
onTap: () {
print("aa");
Get.toNamed("/thShareDeviceDetailWidget", arguments: {
'data': widget.data,
'device': widget.device // 修改使用传入的device参数
});
},
child: Row(
mainAxisSize: MainAxisSize.max,
children: [
@@ -202,4 +209,4 @@ class _DeviceShareInfoWidgetState extends State<DeviceShareInfoWidget> {
),
);
}
}
}

View File

@@ -465,7 +465,7 @@ class _DeviceShareListPageState extends State<DeviceShareListPage> {
child: Column(
children: list
.map((item) =>
DeviceShareInfoWidget(data: item))
DeviceShareInfoWidget(data: item,device: widget.device,))
.toList()
.divide(SizedBox(height: 30.rpx))
.addToEnd(SizedBox(height: 30.rpx)),

View File

@@ -29,6 +29,7 @@ class _DeviceSharePageState extends State<DeviceSharePage> {
deviceShareController.msg = "".obs;
deviceShareController.code = 0.obs;
deviceShareController.account = "".obs;
deviceShareController.type = 1.obs;
super.initState();
}
@@ -139,32 +140,184 @@ class _DeviceSharePageState extends State<DeviceSharePage> {
),
].divide(SizedBox(width: 20.rpx)),
),
// Row(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Obx(() => FancyCircleCheckbox(
// borderColor:
// themeController.currentColor.sc3,
// fillColor:
// themeController.currentColor.sc2,
// value: true,
// onChanged: (value) {},
// )),
// Text(
// '主设备蓝盈盈A9876451',
// style: FlutterFlowTheme.of(context)
// .bodyMedium
// .override(
// fontFamily: 'Inter',
// fontSize: 26.rpx,
// letterSpacing: 0.0,
// color:
// themeController.currentColor.sc3,
// ),
// ),
// ].divide(SizedBox(width: 20.rpx)),
// ),
Container(
child: Padding(
padding: EdgeInsetsDirectional.only(
start: 0.rpx,
top: 0.rpx,
end: 0.rpx,
bottom: 0.rpx),
child: Column(
children: [
GestureDetector(
onTap: () {
// 当点击时,将 type 设置为 0允许控制
// data['info'][3]['opType'] = 1;
// opType.value = 1;
updateWifiConfigSwitch();
deviceShareController.updateAll();
},
child: Container(
width: MediaQuery.sizeOf(context).width,
constraints: const BoxConstraints(
minHeight: 46,
),
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(0),
),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(
'允许对方配置wifi'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: const Color(0xFFFFFFFF),
fontSize: 27.rpx,
letterSpacing: 0.0,
),
),
Obx(() {
return Container(
height: 33.rpx,
child: AspectRatio(
aspectRatio: 1,
child: Center(
child: Container(
height: 33.rpx,
width: 33.rpx,
decoration: BoxDecoration(
borderRadius:
BorderRadius
.circular(
33.rpx / 2),
border: Border.all(
width:
getWifiConfigSwitch()
? 1
: 0.5,
color:
Color(0xFFC8CBD2),
),
),
child:
getWifiConfigSwitch()
? Center(
child:
ClipOval(
child:
Container(
width:
33.rpx *
0.6,
height:
33.rpx *
0.6,
color: const Color(
0xFF6BFDAC),
),
),
)
: null,
),
),
),
);
})
],
),
),
),
// GestureDetector(
// onTap: () {
// // 当点击时,将 type 设置为 1仅允许查看
// // data['info'][3]['opType'] = 2;
// // opType.value = 2;
// },
// child: Container(
// width: MediaQuery.sizeOf(context)
// .width,
// constraints: const BoxConstraints(
// minHeight: 46,
// ),
// decoration: BoxDecoration(
// borderRadius:
// BorderRadius.circular(0),
// ),
// child: Row(
// mainAxisSize: MainAxisSize.max,
// mainAxisAlignment:
// MainAxisAlignment
// .spaceBetween,
// children: [
// Text(
// '仅允许对方查看该设备'.tr,
// style: TextStyle(
// fontFamily: 'Readex Pro',
// color:
// const Color(0xFFFFFFFF),
// fontSize: 27.rpx,
// letterSpacing: 0.0,
// ),
// ),
// Obx(() {
// flag2;
// return Container(
// height: 33.rpx,
// child: AspectRatio(
// aspectRatio: 1,
// child: Center(
// child: Container(
// height: 33.rpx,
// width: 33.rpx,
// decoration:
// BoxDecoration(
// borderRadius:
// BorderRadius
// .circular(
// 33.rpx /
// 2),
// border: Border.all(
// width: 2 == 2
// ? 1
// : 0.5,
// color: Color(
// 0xFFC8CBD2),
// ),
// ),
// child: 2 == 2
// ? Center(
// child:
// ClipOval(
// child:
// Container(
// width:
// 33.rpx *
// 0.6,
// height:
// 33.rpx *
// 0.6,
// color: const Color(
// 0xFF6BFDAC),
// ),
// ),
// )
// : null,
// ),
// ),
// ),
// );
// })
// ],
// ),
// ),
// ),
],
),
)),
].divide(SizedBox(height: 64.rpx)),
),
),
@@ -361,4 +514,19 @@ class _DeviceSharePageState extends State<DeviceSharePage> {
),
);
}
getWifiConfigSwitch() {
if (deviceShareController.type.value == 1) {
return true;
}
return false;
}
void updateWifiConfigSwitch() {
if (deviceShareController.type.value == 1) {
deviceShareController.type.value = 2;
} else if (deviceShareController.type.value == 2) {
deviceShareController.type.value = 1;
}
}
}

View File

@@ -397,6 +397,7 @@ class ShareDeviceDetailWidget extends GetView {
],
),
))
]),
),
Padding(