This commit is contained in:
czz
2025-06-27 09:15:45 +08:00
parent 12c6a260c9
commit 943f5a778a
36 changed files with 1850 additions and 1355 deletions

View File

@@ -4,16 +4,13 @@ import 'package:flutter/services.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'package:vbvs_app/common/color/appConstants.dart';
import 'package:vbvs_app/common/color/app_uri_status.dart';
import 'package:vbvs_app/common/util/CommonVariables.dart';
import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/NullDataComponentWidget.dart';
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
import 'package:vbvs_app/controller/mh_controller/mhdevice_share_controller.dart';
import 'package:vbvs_app/model/api_response.dart';
import 'package:vbvs_app/pages/mh_page/EmptyMessageWidget.dart';
import 'package:vbvs_app/pages/mh_page/ShareUserWidget.dart';
class ShareDeviceWidget extends GetView<MHDeviceShareController> {
@@ -216,125 +213,280 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
),
),
)),
Obx(
() => GestureDetector(
onTap: () {
// 当点击时,将 type 设置为 0允许控制
controller.model.type = 1;
controller.updateAll();
},
child: Container(
margin: EdgeInsets.only(top: 76.rpx),
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(
'允许对方控制该设备',
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
fontSize: 26.rpx,
letterSpacing: 0.0,
),
GestureDetector(
onTap: () {
// 当点击时,将 type 设置为 0允许控制
controller.model.type = 1;
controller.updateAll();
},
child: Container(
margin: EdgeInsets.only(top: 76.rpx),
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: Colors.white,
fontSize: 26.rpx,
letterSpacing: 0.0,
),
Theme(
data:
Theme.of(context).copyWith(
unselectedWidgetColor: Color(
0xFFC8CBD2), // 改变未选中状态边框颜色
),
Obx(() {
double h = 33.rpx;
bool check =
controller.model.type == 1;
return Container(
height: 33.rpx,
child: AspectRatio(
aspectRatio: 1,
child: Center(
child: Container(
height: h,
width: h,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
h / 2),
border: Border.all(
width: check ? 1 : 0.5,
color:
Color(0xFFC8CBD2),
),
),
child: check
? Center(
child: ClipOval(
child: Container(
width: h * 0.6,
height: h * 0.6,
color: const Color(
0xFF6BFDAC),
),
),
)
: null,
),
),
child: Radio<int>(
value: 1,
groupValue:
controller.model.type,
onChanged: (value) {
controller.model.type =
value!;
controller.updateAll();
},
activeColor:
const Color(0xFF6BFDAC),
materialTapTargetSize:
MaterialTapTargetSize
.shrinkWrap, // 减少内边距
visualDensity: VisualDensity(
horizontal: -4,
vertical: -4), // 缩小视觉密度
))
],
),
),
);
}),
],
),
),
),
Obx(
() => GestureDetector(
onTap: () {
// 当点击时,将 type 设置为 1仅允许查看
controller.model.type = 2;
controller.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(
'仅允许对方查看该设备',
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
fontSize: 26.rpx,
letterSpacing: 0.0,
),
// Obx(
// () => GestureDetector(
// onTap: () {
// controller.model.type = 2;
// controller.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(
// '仅允许对方查看该设备'.tr,
// style: TextStyle(
// fontFamily: 'Readex Pro',
// color: Colors.white,
// fontSize: 26.rpx,
// letterSpacing: 0.0,
// ),
// ),
// // Theme(
// // data:
// // Theme.of(context).copyWith(
// // unselectedWidgetColor: Color(
// // 0xFFC8CBD2), // 改变未选中状态边框颜色
// // ),
// // child: Radio<int>(
// // value: 2,
// // groupValue:
// // controller.model.type,
// // onChanged: (value) {
// // controller.model.type =
// // value!;
// // controller.updateAll();
// // },
// // activeColor:
// // const Color(0xFF6BFDAC),
// // materialTapTargetSize:
// // MaterialTapTargetSize
// // .shrinkWrap, // 减少内边距
// // visualDensity: VisualDensity(
// // horizontal: -4,
// // vertical: -4), // 缩小视觉密度
// // ))
// ClipOval(
// child: Container(
// height:
// MediaQuery.sizeOf(context)
// .height *
// 0.0449,
// child: AspectRatio(
// aspectRatio: 1,
// child: Center(
// child: LayoutBuilder(
// builder: (context,
// constraints) {
// double h =
// MediaQuery.sizeOf(
// context)
// .height *
// 0.0326;
// bool check = controller
// .model.type ==
// 2;
// if (check) {
// return Container(
// height: h,
// width: h,
// decoration:
// BoxDecoration(
// borderRadius:
// BorderRadius
// .circular(
// h / 2),
// border: Border.all(
// width: 1,
// color: Color(
// 0xFF6BFDAC)),
// ),
// child: Center(
// child: ClipOval(
// child: Container(
// width:
// h * 0.6,
// height:
// h * 0.6,
// color: Color(
// 0xFF6BFDAC)),
// ),
// ),
// );
// } else {
// return Container(
// height: h,
// width: h,
// decoration:
// BoxDecoration(
// borderRadius:
// BorderRadius
// .circular(
// h / 2),
// border: Border.all(
// width: 0.5,
// color: Colors
// .white),
// ),
// );
// }
// },
// ),
// ),
// ),
// ),
// ),
// ],
// ),
// ),
// ),
// ),
GestureDetector(
onTap: () {
controller.model.type = 2;
controller.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(
'仅允许对方查看该设备'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,
fontSize: 26.rpx,
letterSpacing: 0.0,
),
Theme(
data:
Theme.of(context).copyWith(
unselectedWidgetColor: Color(
0xFFC8CBD2), // 改变未选中状态边框颜色
),
// ✅ 只包住响应式控件部分
Obx(() {
double h = 33.rpx;
bool check =
controller.model.type == 2;
return Container(
height: 33.rpx,
child: AspectRatio(
aspectRatio: 1,
child: Center(
child: Container(
height: h,
width: h,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
h / 2),
border: Border.all(
width: check ? 1 : 0.5,
color:
Color(0xFFC8CBD2),
),
),
child: check
? Center(
child: ClipOval(
child: Container(
width: h * 0.6,
height: h * 0.6,
color: const Color(
0xFF6BFDAC),
),
),
)
: null,
),
),
child: Radio<int>(
value: 2,
groupValue:
controller.model.type,
onChanged: (value) {
controller.model.type =
value!;
controller.updateAll();
},
activeColor:
const Color(0xFF6BFDAC),
materialTapTargetSize:
MaterialTapTargetSize
.shrinkWrap, // 减少内边距
visualDensity: VisualDensity(
horizontal: -4,
vertical: -4), // 缩小视觉密度
))
],
),
),
);
}),
],
),
),
),
Align(
alignment: const AlignmentDirectional(0, 0),
child: Padding(
@@ -361,7 +513,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
.currentColor.sc9);
}
},
text: '发送邀请',
text: '发送邀请'.tr,
options: FFButtonOptions(
height: 60.rpx,
padding:
@@ -404,7 +556,7 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
padding: const EdgeInsetsDirectional
.fromSTEB(14, 0, 0, 16),
child: Text(
'已分享用户',
'已分享用户'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: Colors.white,