多语言后端数据
This commit is contained in:
@@ -595,5 +595,6 @@
|
|||||||
"该设备的历史数据将被清除": "The device's historical data will be deleted",
|
"该设备的历史数据将被清除": "The device's historical data will be deleted",
|
||||||
"有一条新的设备分享消息": "You have a new device sharing message",
|
"有一条新的设备分享消息": "You have a new device sharing message",
|
||||||
"去查看": "View now",
|
"去查看": "View now",
|
||||||
"正常值":"range:"
|
"正常值": "range:",
|
||||||
|
"设备分享提醒": "Device Sharing Alert"
|
||||||
}
|
}
|
||||||
@@ -591,5 +591,5 @@
|
|||||||
"皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。": "皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。",
|
"皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。": "皮肤指数通过用户睡眠过程中的体征数据,计算皮肤电反应,生成综合评估指标,用于睡眠中的生理应激状态或自主神经活动。",
|
||||||
"删除后": "删除后",
|
"删除后": "删除后",
|
||||||
"该设备的历史数据将被清除": "该设备的历史数据将被清除","有一条新的设备分享消息":"有一条新的设备分享消息","去查看":"去查看",
|
"该设备的历史数据将被清除": "该设备的历史数据将被清除","有一条新的设备分享消息":"有一条新的设备分享消息","去查看":"去查看",
|
||||||
"正常值":"正常值:"
|
"正常值":"正常值:","设备分享提醒":"设备分享提醒"
|
||||||
}
|
}
|
||||||
@@ -593,5 +593,5 @@
|
|||||||
"该设备的历史数据将被清除": "該設備的歷史數據將被清除",
|
"该设备的历史数据将被清除": "該設備的歷史數據將被清除",
|
||||||
"有一条新的设备分享消息": "有一條新的設備分享消息",
|
"有一条新的设备分享消息": "有一條新的設備分享消息",
|
||||||
"去查看": "去查看",
|
"去查看": "去查看",
|
||||||
"正常值": "正常值:"
|
"正常值": "正常值:","设备分享提醒":"設備分享提醒"
|
||||||
}
|
}
|
||||||
@@ -185,8 +185,10 @@ Timer? _messageTimer;
|
|||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
void startMessagePolling(int ent_type) {
|
void startMessagePolling(int ent_type) {
|
||||||
// Get.put(MhMessageController());
|
Get.put(MhMessageController());
|
||||||
// MhMessageController messageController = Get.find();
|
MhMessageController messageController = Get.find();
|
||||||
|
final Set<String> _poppedMessageIds = {}; // 本地已弹窗的消息 ID(无论是否已读成功)
|
||||||
|
final Set<String> _readMessageIds = {};
|
||||||
_messageTimer?.cancel();
|
_messageTimer?.cancel();
|
||||||
if (ent_type == APPPackageType.MHT.code) {
|
if (ent_type == APPPackageType.MHT.code) {
|
||||||
if (Get.isRegistered<MhMessageController>()) {
|
if (Get.isRegistered<MhMessageController>()) {
|
||||||
@@ -197,11 +199,56 @@ void startMessagePolling(int ent_type) {
|
|||||||
Get.find<MessageController>().getMessageStatus();
|
Get.find<MessageController>().getMessageStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_messageTimer = Timer.periodic(Duration(seconds: 10), (timer) async {
|
_messageTimer = Timer.periodic(Duration(seconds: 10), (timer) async {
|
||||||
try {
|
try {
|
||||||
if (ent_type == APPPackageType.MHT.code) {
|
if (ent_type == APPPackageType.MHT.code) {
|
||||||
if (Get.isRegistered<MhMessageController>()) {
|
if (Get.isRegistered<MhMessageController>()) {
|
||||||
Get.find<MhMessageController>().getMessageStatus();
|
final controller = Get.find<MhMessageController>();
|
||||||
|
await controller.getMessageStatus();
|
||||||
|
|
||||||
|
if (controller.model.system_message_read == 1) {
|
||||||
|
await controller.getMessageList("app_system");
|
||||||
|
|
||||||
|
final unhandledShareMessages =
|
||||||
|
controller.systemMessageList.where((item) {
|
||||||
|
final data = item['data'];
|
||||||
|
final id = item['_id']?.toString();
|
||||||
|
return data is Map &&
|
||||||
|
data['type'] == 'share' &&
|
||||||
|
id != null &&
|
||||||
|
!_poppedMessageIds.contains(id) &&
|
||||||
|
(item['read_time'] == null);
|
||||||
|
}).toList();
|
||||||
|
|
||||||
|
if (unhandledShareMessages.isNotEmpty) {
|
||||||
|
for (final message in unhandledShareMessages) {
|
||||||
|
final messageId = message['_id']?.toString();
|
||||||
|
if (messageId == null || _poppedMessageIds.contains(messageId))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// 新增:如果当前页面是消息页,则跳过弹窗
|
||||||
|
if (Get.currentRoute == '/messagePage') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
_poppedMessageIds.add(messageId);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await controller.updateMessageReadStatus(
|
||||||
|
Get.context!, messageId);
|
||||||
|
} catch (e) {
|
||||||
|
print("标记消息 $messageId 为已读失败: $e");
|
||||||
|
}
|
||||||
|
|
||||||
|
final result =
|
||||||
|
await showMessageConfirmDialog(title: '设备分享提醒'.tr);
|
||||||
|
if (result == 'confirm') {
|
||||||
|
Get.toNamed('/messageDetail', arguments:message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (Get.isRegistered<MessageController>()) {
|
if (Get.isRegistered<MessageController>()) {
|
||||||
@@ -404,7 +451,7 @@ class MyApp extends StatelessWidget {
|
|||||||
Get.lazyPut(() => SleepingHabitController()),
|
Get.lazyPut(() => SleepingHabitController()),
|
||||||
Get.lazyPut(() => PeopleInfoController()),
|
Get.lazyPut(() => PeopleInfoController()),
|
||||||
Get.lazyPut(() => MainPageController()),
|
Get.lazyPut(() => MainPageController()),
|
||||||
Get.lazyPut(() => MhMessageController()),
|
|
||||||
Get.lazyPut(() => AddressListController()),
|
Get.lazyPut(() => AddressListController()),
|
||||||
Get.lazyPut(() => AddressController()),
|
Get.lazyPut(() => AddressController()),
|
||||||
// Get.lazyPut(() => MHLanguageController()),
|
// Get.lazyPut(() => MHLanguageController()),
|
||||||
|
|||||||
@@ -1467,12 +1467,10 @@ Future<void> showDeleteDeviceConfirmDialog({
|
|||||||
// },
|
// },
|
||||||
// );
|
// );
|
||||||
// }
|
// }
|
||||||
Future<void> showMessageConfirmDialog({
|
Future<String?> showMessageConfirmDialog({
|
||||||
required VoidCallback onConfirm,
|
|
||||||
required VoidCallback onCancel,
|
|
||||||
required String title,
|
required String title,
|
||||||
}) async {
|
}) async {
|
||||||
await Get.dialog(
|
return await Get.dialog<String>(
|
||||||
FrostedDialog(
|
FrostedDialog(
|
||||||
blurSigma: 3.0,
|
blurSigma: 3.0,
|
||||||
child: Container(
|
child: Container(
|
||||||
@@ -1491,10 +1489,7 @@ Future<void> showMessageConfirmDialog({
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 30.rpx, color: Colors.black),
|
||||||
fontSize: 30.rpx,
|
|
||||||
color: Colors.black,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
RichText(
|
RichText(
|
||||||
@@ -1503,7 +1498,7 @@ Future<void> showMessageConfirmDialog({
|
|||||||
style: TextStyle(fontSize: 26.rpx, color: Colors.black87),
|
style: TextStyle(fontSize: 26.rpx, color: Colors.black87),
|
||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: '有一条新的设备分享消息,'.tr,
|
text: '有一条新的设备分享消息'.tr,
|
||||||
style: TextStyle(color: Colors.red, fontSize: 26.rpx)),
|
style: TextStyle(color: Colors.red, fontSize: 26.rpx)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -1516,8 +1511,7 @@ Future<void> showMessageConfirmDialog({
|
|||||||
gradientDirection: GradientDirection.vertical,
|
gradientDirection: GradientDirection.vertical,
|
||||||
borderRadius: 16.rpx,
|
borderRadius: 16.rpx,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.back();
|
Get.back(result: 'cancel');
|
||||||
onCancel();
|
|
||||||
},
|
},
|
||||||
colors: [
|
colors: [
|
||||||
Color(0xFF1592AA),
|
Color(0xFF1592AA),
|
||||||
@@ -1537,8 +1531,7 @@ Future<void> showMessageConfirmDialog({
|
|||||||
CustomCard(
|
CustomCard(
|
||||||
borderRadius: 16.rpx,
|
borderRadius: 16.rpx,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.back();
|
Get.back(result: 'confirm');
|
||||||
onConfirm();
|
|
||||||
},
|
},
|
||||||
colors: [
|
colors: [
|
||||||
Color(0xFF1592AA),
|
Color(0xFF1592AA),
|
||||||
@@ -1562,8 +1555,6 @@ Future<void> showMessageConfirmDialog({
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
barrierDismissible: true,
|
barrierDismissible: true,
|
||||||
// 监听返回或点击遮罩关闭事件
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,9 +193,9 @@ class _MhMessageListWidgetState extends State<MhMessageListWidget> {
|
|||||||
child: Align(
|
child: Align(
|
||||||
alignment: AlignmentDirectional(-1, 0),
|
alignment: AlignmentDirectional(-1, 0),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
label.tr,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
label.tr,
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Inter',
|
fontFamily: 'Inter',
|
||||||
fontSize: 26.rpx,
|
fontSize: 26.rpx,
|
||||||
@@ -215,9 +215,9 @@ class _MhMessageListWidgetState extends State<MhMessageListWidget> {
|
|||||||
child: Align(
|
child: Align(
|
||||||
alignment: AlignmentDirectional(-1, 0),
|
alignment: AlignmentDirectional(-1, 0),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
"${value}",
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
"${value}",
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: 'Inter',
|
fontFamily: 'Inter',
|
||||||
fontSize: 26.rpx,
|
fontSize: 26.rpx,
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ class VitalWidget extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: MediaQuery.sizeOf(context).width * 0.14,
|
width: MediaQuery.sizeOf(context).width * 0.14,
|
||||||
constraints: BoxConstraints(minWidth: 106.rpx),
|
constraints: BoxConstraints(minWidth: 110.rpx),
|
||||||
child: Text(
|
child: Text(
|
||||||
"设备ID".tr,
|
"设备ID".tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -192,7 +192,7 @@ class VitalWidget extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: MediaQuery.sizeOf(context).width * 0.14,
|
width: MediaQuery.sizeOf(context).width * 0.14,
|
||||||
constraints: BoxConstraints(minWidth: 106.rpx),
|
constraints: BoxConstraints(minWidth: 110.rpx),
|
||||||
child: Text(
|
child: Text(
|
||||||
"更新时间".tr,
|
"更新时间".tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
@@ -214,7 +214,7 @@ class VitalWidget extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: MediaQuery.sizeOf(context).width * 0.14,
|
width: MediaQuery.sizeOf(context).width * 0.14,
|
||||||
constraints: BoxConstraints(minWidth: 106.rpx),
|
constraints: BoxConstraints(minWidth: 110.rpx),
|
||||||
child: Text(
|
child: Text(
|
||||||
"设备状态".tr,
|
"设备状态".tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|||||||
@@ -1959,9 +1959,9 @@ class ApplyRepairPage extends GetView<ApplyRepairController> {
|
|||||||
case 1:
|
case 1:
|
||||||
return '体征检测设备'.tr;
|
return '体征检测设备'.tr;
|
||||||
case 2:
|
case 2:
|
||||||
return '智能床'.tr;
|
return '智能电动床'.tr;
|
||||||
case 3:
|
case 3:
|
||||||
return '智能床垫'.tr;
|
return '律动智能床垫'.tr;
|
||||||
default:
|
default:
|
||||||
return '未知设备'.tr;
|
return '未知设备'.tr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,465 +43,531 @@ class ShareDeviceWidget extends GetView<MHDeviceShareController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
automaticallyImplyLeading: false,
|
|
||||||
iconTheme: const IconThemeData(color: Colors.white),
|
|
||||||
titleSpacing: 0,
|
|
||||||
title: Container(
|
|
||||||
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(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
actions: [],
|
|
||||||
centerTitle: false,
|
|
||||||
),
|
|
||||||
key: scaffoldKey,
|
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
body: SingleChildScrollView(
|
automaticallyImplyLeading: false,
|
||||||
child: Container(
|
iconTheme: const IconThemeData(color: Colors.white),
|
||||||
width: MediaQuery.sizeOf(context).width,
|
titleSpacing: 0,
|
||||||
height: MediaQuery.sizeOf(context).height * 1,
|
title: Container(
|
||||||
child: Padding(
|
width: double.infinity,
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(30.rpx, 0, 30.rpx, 0),
|
height: 180.rpx,
|
||||||
child: Column(
|
child: Stack(
|
||||||
mainAxisSize: MainAxisSize.max,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
// 中间居中的标题
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(0, 30.rpx, 0, 0),
|
Text(
|
||||||
child: Container(
|
'分享设备'.tr,
|
||||||
width: MediaQuery.sizeOf(context).width,
|
textAlign: TextAlign.center,
|
||||||
decoration: BoxDecoration(
|
style: TextStyle(
|
||||||
color: const Color(0xFF003058),
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(16.rpx),
|
fontSize: 30.rpx,
|
||||||
),
|
),
|
||||||
child: Padding(
|
),
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
// 左侧图标
|
||||||
30.rpx, 49.rpx, 30.rpx, 80.rpx),
|
Positioned(
|
||||||
child: Column(
|
left: 0.rpx,
|
||||||
|
child: returnIconButtomNew(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: [],
|
||||||
|
centerTitle: false,
|
||||||
|
),
|
||||||
|
key: scaffoldKey,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
body: Container(
|
||||||
|
width: MediaQuery.sizeOf(context).width,
|
||||||
|
height: MediaQuery.sizeOf(context).height * 1,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(30.rpx, 0, 30.rpx, 0),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(0, 30.rpx, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: MediaQuery.sizeOf(context).width,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: const Color(0xFF003058),
|
||||||
|
borderRadius: BorderRadius.circular(16.rpx),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
30.rpx, 49.rpx, 30.rpx, 80.rpx),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Column(
|
Text(
|
||||||
mainAxisSize: MainAxisSize.max,
|
'将以下设备分享给您的家人或朋友'.tr,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
style: TextStyle(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
height: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'将以下设备分享给您的家人或朋友'.tr,
|
"设备ID:".tr,
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: const Color(0xFF6BFDAC),
|
||||||
|
fontSize: 26.rpx,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
height: 1),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
data['mac'],
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: const Color(0xFF6BFDAC),
|
||||||
|
fontSize: 26.rpx,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
height: 1),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
].divide(SizedBox(height: 65.rpx)),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsetsDirectional.fromSTEB(0, 80.rpx, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: MediaQuery.sizeOf(context).width,
|
||||||
|
constraints: const BoxConstraints(
|
||||||
|
minHeight: 46,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(16.rpx),
|
||||||
|
),
|
||||||
|
child: Align(
|
||||||
|
alignment: const AlignmentDirectional(0, 0),
|
||||||
|
child: Form(
|
||||||
|
key: _formKey,
|
||||||
|
child: TextFormField(
|
||||||
|
controller: _phoneController,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: '请输入对方手机号/邮箱号'.tr,
|
||||||
|
hintStyle: TextStyle(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: const Color(0xFF929699),
|
||||||
|
fontSize: 36.rpx,
|
||||||
|
),
|
||||||
|
enabledBorder:
|
||||||
|
const UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Color(0xFF929699),
|
||||||
|
width: 0),
|
||||||
|
),
|
||||||
|
focusedBorder:
|
||||||
|
const UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Color(0xFF929699),
|
||||||
|
width: 0),
|
||||||
|
),
|
||||||
|
errorBorder: const UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.red, width: 0),
|
||||||
|
),
|
||||||
|
focusedErrorBorder:
|
||||||
|
const UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Colors.redAccent,
|
||||||
|
width: 0),
|
||||||
|
),
|
||||||
|
contentPadding: const EdgeInsets.only(
|
||||||
|
left: 10, bottom: 5),
|
||||||
|
),
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 36.rpx,
|
||||||
|
),
|
||||||
|
onChanged: (value) {
|
||||||
|
controller.model.account = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ClickableContainer(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
highlightColor: Colors.transparent,
|
||||||
|
padding: EdgeInsets.only(top: 30.rpx),
|
||||||
|
onTap: () {},
|
||||||
|
child: Container(
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
border: Border(
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Color(0xFF85F5FF),
|
||||||
|
width: 0), // 下边线
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'点击复制APP下载链接'.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Color(0xFF85F5FF), // 蓝色文字
|
||||||
|
|
||||||
|
fontSize: 22.rpx,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
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(
|
style: TextStyle(
|
||||||
fontFamily: 'Readex Pro',
|
fontFamily: 'Readex Pro',
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 30.rpx,
|
fontSize: 26.rpx,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
height: 1,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Obx(() {
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
double h = 33.rpx;
|
||||||
children: [
|
bool check = controller.model.type == 1;
|
||||||
Text(
|
|
||||||
"设备ID:".tr,
|
|
||||||
style: TextStyle(
|
|
||||||
fontFamily: 'Readex Pro',
|
|
||||||
color: const Color(0xFF6BFDAC),
|
|
||||||
fontSize: 26.rpx,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
height: 1),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
data['mac'],
|
|
||||||
style: TextStyle(
|
|
||||||
fontFamily: 'Readex Pro',
|
|
||||||
color: const Color(0xFF6BFDAC),
|
|
||||||
fontSize: 26.rpx,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
height: 1),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
].divide(SizedBox(height: 65.rpx)),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0, 80.rpx, 0, 0),
|
|
||||||
child: Container(
|
|
||||||
width: MediaQuery.sizeOf(context).width,
|
|
||||||
constraints: const BoxConstraints(
|
|
||||||
minHeight: 46,
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(16.rpx),
|
|
||||||
),
|
|
||||||
child: Align(
|
|
||||||
alignment:
|
|
||||||
const AlignmentDirectional(0, 0),
|
|
||||||
child: Form(
|
|
||||||
key: _formKey,
|
|
||||||
child: TextFormField(
|
|
||||||
controller: _phoneController,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
hintText: '请输入对方手机号/邮箱号'.tr,
|
|
||||||
hintStyle: TextStyle(
|
|
||||||
fontFamily: 'Readex Pro',
|
|
||||||
color: const Color(0xFF929699),
|
|
||||||
fontSize: 36.rpx,
|
|
||||||
),
|
|
||||||
enabledBorder:
|
|
||||||
const UnderlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Color(0xFF929699),
|
|
||||||
width: 0),
|
|
||||||
),
|
|
||||||
focusedBorder:
|
|
||||||
const UnderlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Color(0xFF929699),
|
|
||||||
width: 0),
|
|
||||||
),
|
|
||||||
errorBorder:
|
|
||||||
const UnderlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Colors.red, width: 0),
|
|
||||||
),
|
|
||||||
focusedErrorBorder:
|
|
||||||
const UnderlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Colors.redAccent,
|
|
||||||
width: 0),
|
|
||||||
),
|
|
||||||
contentPadding:
|
|
||||||
const EdgeInsets.only(
|
|
||||||
left: 10, bottom: 5),
|
|
||||||
),
|
|
||||||
style: TextStyle(
|
|
||||||
fontFamily: 'Readex Pro',
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 36.rpx,
|
|
||||||
),
|
|
||||||
onChanged: (value) {
|
|
||||||
controller.model.account = value;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ClickableContainer(
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
highlightColor: Colors.transparent,
|
|
||||||
padding: EdgeInsets.only(top: 30.rpx),
|
|
||||||
onTap: () {},
|
|
||||||
child: Container(
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
border: Border(
|
|
||||||
bottom: BorderSide(
|
|
||||||
color: Color(0xFF85F5FF),
|
|
||||||
width: 0), // 下边线
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
'点击复制APP下载链接'.tr,
|
|
||||||
style: TextStyle(
|
|
||||||
color: Color(0xFF85F5FF), // 蓝色文字
|
|
||||||
|
|
||||||
fontSize: 22.rpx,
|
return Container(
|
||||||
),
|
height: 33.rpx,
|
||||||
),
|
child: AspectRatio(
|
||||||
)),
|
aspectRatio: 1,
|
||||||
GestureDetector(
|
child: Center(
|
||||||
onTap: () {
|
child: Container(
|
||||||
// 当点击时,将 type 设置为 0(允许控制)
|
height: h,
|
||||||
controller.model.type = 1;
|
width: h,
|
||||||
controller.updateAll();
|
decoration: BoxDecoration(
|
||||||
},
|
borderRadius:
|
||||||
child: Container(
|
BorderRadius.circular(h / 2),
|
||||||
margin: EdgeInsets.only(top: 76.rpx),
|
border: Border.all(
|
||||||
width: MediaQuery.sizeOf(context).width,
|
width: check ? 1 : 0.5,
|
||||||
constraints: const BoxConstraints(
|
color: Color(0xFFC8CBD2),
|
||||||
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,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
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: check
|
||||||
|
? Center(
|
||||||
|
child: ClipOval(
|
||||||
|
child: Container(
|
||||||
|
width: h * 0.6,
|
||||||
|
height: h * 0.6,
|
||||||
|
color: const Color(
|
||||||
|
0xFF6BFDAC),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
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,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// ✅ 只包住响应式控件部分
|
|
||||||
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,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(0, 0),
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0, 46.rpx, 0, 0),
|
|
||||||
child: Container(
|
|
||||||
width: 108,
|
|
||||||
height: 31,
|
|
||||||
decoration: BoxDecoration(),
|
|
||||||
child: FFButtonWidget(
|
|
||||||
onPressed: () async {
|
|
||||||
//todo 1:验证用户是否存在 2:发送邀请
|
|
||||||
ApiResponse apiResponse =
|
|
||||||
await controller
|
|
||||||
.shareDevice(data['mac'.tr]);
|
|
||||||
if (apiResponse.code ==
|
|
||||||
HttpStatusCodes.ok) {
|
|
||||||
TopSlideNotification.show(context,
|
|
||||||
text: apiResponse.msg!);
|
|
||||||
} else {
|
|
||||||
TopSlideNotification.show(context,
|
|
||||||
text: apiResponse.msg!,
|
|
||||||
textColor: themeController
|
|
||||||
.currentColor.sc9);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
text: '发送邀请'.tr,
|
|
||||||
options: FFButtonOptions(
|
|
||||||
height: 60.rpx,
|
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
|
||||||
30.rpx, 0, 30.rpx, 0),
|
|
||||||
color: const Color(0xFF84F5FF),
|
|
||||||
textStyle: TextStyle(
|
|
||||||
fontFamily: 'Readex Pro',
|
|
||||||
color: Color(0xFF011D33),
|
|
||||||
fontSize: 26.rpx,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
),
|
|
||||||
elevation: 0,
|
|
||||||
borderRadius: BorderRadius.circular(50),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsetsDirectional.fromSTEB(
|
|
||||||
0, 100.rpx, 0, 32.rpx),
|
|
||||||
child: Container(
|
|
||||||
width: MediaQuery.sizeOf(context).width,
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment: const AlignmentDirectional(-1, 0),
|
|
||||||
child: Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsetsDirectional.fromSTEB(
|
|
||||||
14, 0, 0, 16),
|
|
||||||
child: Text(
|
|
||||||
'已分享用户'.tr,
|
|
||||||
style: TextStyle(
|
|
||||||
fontFamily: 'Readex Pro',
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 30.rpx,
|
|
||||||
letterSpacing: 0.0,
|
|
||||||
height: 1),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Obx(
|
|
||||||
() {
|
|
||||||
// 检查 shareUser 是否为空或数量为 0
|
|
||||||
if (controller.model.shareUser == null ||
|
|
||||||
controller.model.shareUser!.isEmpty) {
|
|
||||||
// return Container(
|
|
||||||
// alignment: AlignmentDirectional
|
|
||||||
// .centerStart, // 确保文字靠左对齐
|
|
||||||
// padding: EdgeInsets.symmetric(
|
|
||||||
// horizontal: 16.0), // 根据需要设置内边距
|
|
||||||
// child: Text(
|
|
||||||
// "暂无分享!",
|
|
||||||
// textAlign: TextAlign.left, // 文字左对齐
|
|
||||||
// style: FlutterFlowTheme.of(context)
|
|
||||||
// .bodyMedium, // 可根据需要自定义样式
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
return NullDataWidget();
|
|
||||||
// EmptyMessageWidget(
|
|
||||||
// imagePath:
|
|
||||||
// "assets/images/emptyUser.png",
|
|
||||||
// );
|
|
||||||
}
|
|
||||||
|
|
||||||
// 否则显示正常的 ListView
|
|
||||||
return ListView(
|
|
||||||
controller:
|
|
||||||
scrollController, // 绑定 ScrollController
|
|
||||||
shrinkWrap: true,
|
|
||||||
scrollDirection: Axis.vertical,
|
|
||||||
children: (controller.model.shareUser!
|
|
||||||
.asMap()
|
|
||||||
.entries
|
|
||||||
.map((e) => ShareUserWidget(
|
|
||||||
index: e.key,
|
|
||||||
mac: data['mac'.tr],
|
|
||||||
repairListController:
|
|
||||||
controller))
|
|
||||||
.toList() as List<Widget>)
|
|
||||||
// .divide(const SizedBox(
|
|
||||||
// height: 13,
|
|
||||||
// ))
|
|
||||||
.addToEnd(const SizedBox(
|
|
||||||
height: AppConstants.list_end_height,
|
|
||||||
)),
|
|
||||||
);
|
);
|
||||||
},
|
}),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// ✅ 只包住响应式控件部分
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: const AlignmentDirectional(0, 0),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
0, 46.rpx, 0, 0),
|
||||||
|
child: Container(
|
||||||
|
width: 108,
|
||||||
|
height: 31,
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: FFButtonWidget(
|
||||||
|
onPressed: () async {
|
||||||
|
//todo 1:验证用户是否存在 2:发送邀请
|
||||||
|
ApiResponse apiResponse = await controller
|
||||||
|
.shareDevice(data['mac'.tr]);
|
||||||
|
if (apiResponse.code ==
|
||||||
|
HttpStatusCodes.ok) {
|
||||||
|
TopSlideNotification.show(context,
|
||||||
|
text: apiResponse.msg!);
|
||||||
|
} else {
|
||||||
|
TopSlideNotification.show(context,
|
||||||
|
text: apiResponse.msg!,
|
||||||
|
textColor:
|
||||||
|
themeController.currentColor.sc9);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
text: '发送邀请'.tr,
|
||||||
|
options: FFButtonOptions(
|
||||||
|
height: 60.rpx,
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
30.rpx, 0, 30.rpx, 0),
|
||||||
|
color: const Color(0xFF84F5FF),
|
||||||
|
textStyle: TextStyle(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: Color(0xFF011D33),
|
||||||
|
fontSize: 26.rpx,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
),
|
||||||
|
elevation: 0,
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
// Expanded(
|
||||||
|
// child: Padding(
|
||||||
|
// padding:
|
||||||
|
// EdgeInsetsDirectional.fromSTEB(0, 100.rpx, 0, 32.rpx),
|
||||||
|
// child: Container(
|
||||||
|
// width: MediaQuery.sizeOf(context).width,
|
||||||
|
// child: SingleChildScrollView(
|
||||||
|
// child: Column(
|
||||||
|
// mainAxisSize: MainAxisSize.max,
|
||||||
|
// children: [
|
||||||
|
// Align(
|
||||||
|
// alignment: const AlignmentDirectional(-1, 0),
|
||||||
|
// child: Padding(
|
||||||
|
// padding: const EdgeInsetsDirectional.fromSTEB(
|
||||||
|
// 14, 0, 0, 16),
|
||||||
|
// child: Text(
|
||||||
|
// '已分享用户'.tr,
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontFamily: 'Readex Pro',
|
||||||
|
// color: Colors.white,
|
||||||
|
// fontSize: 30.rpx,
|
||||||
|
// letterSpacing: 0.0,
|
||||||
|
// height: 1),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Obx(
|
||||||
|
// () {
|
||||||
|
// // 检查 shareUser 是否为空或数量为 0
|
||||||
|
// if (controller.model.shareUser == null ||
|
||||||
|
// controller.model.shareUser!.isEmpty) {
|
||||||
|
// return NullDataWidget();
|
||||||
|
// // return SingleChildScrollView(
|
||||||
|
// // physics:
|
||||||
|
// // NeverScrollableScrollPhysics(), // 禁止滚动
|
||||||
|
// // child: Center(
|
||||||
|
// // child: Padding(
|
||||||
|
// // padding: EdgeInsets.symmetric(
|
||||||
|
// // vertical: 60),
|
||||||
|
// // child: NullDataWidget(),
|
||||||
|
// // ),
|
||||||
|
// // ),
|
||||||
|
// // );
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // 否则显示正常的 ListView
|
||||||
|
// return ListView(
|
||||||
|
// controller:
|
||||||
|
// scrollController, // 绑定 ScrollController
|
||||||
|
// shrinkWrap: true,
|
||||||
|
// scrollDirection: Axis.vertical,
|
||||||
|
// children: (controller.model.shareUser!
|
||||||
|
// .asMap()
|
||||||
|
// .entries
|
||||||
|
// .map((e) => ShareUserWidget(
|
||||||
|
// index: e.key,
|
||||||
|
// mac: data['mac'.tr],
|
||||||
|
// repairListController: controller))
|
||||||
|
// .toList() as List<Widget>)
|
||||||
|
// // .divide(const SizedBox(
|
||||||
|
// // height: 13,
|
||||||
|
// // ))
|
||||||
|
// .addToEnd(const SizedBox(
|
||||||
|
// height: AppConstants.list_end_height,
|
||||||
|
// )),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsetsDirectional.fromSTEB(0, 100.rpx, 0, 32.rpx),
|
||||||
|
child: Obx(() {
|
||||||
|
final shareUsers = controller.model.shareUser;
|
||||||
|
|
||||||
|
// 无数据时,直接返回不带滚动的 Column
|
||||||
|
if (shareUsers == null || shareUsers.isEmpty) {
|
||||||
|
return Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional(-1, 0),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsetsDirectional.fromSTEB(
|
||||||
|
14, 0, 0, 16),
|
||||||
|
child: Text(
|
||||||
|
'已分享用户'.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
height: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Center(
|
||||||
|
child: NullDataWidget(),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 有数据时,返回 ListView(可滚动)
|
||||||
|
return Column(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional(-1, 0),
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsetsDirectional.fromSTEB(14, 0, 0, 16),
|
||||||
|
child: Text(
|
||||||
|
'已分享用户'.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily: 'Readex Pro',
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 30.rpx,
|
||||||
|
letterSpacing: 0.0,
|
||||||
|
height: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: ListView(
|
||||||
|
controller: scrollController,
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
children: shareUsers
|
||||||
|
.asMap()
|
||||||
|
.entries
|
||||||
|
.map((e) => ShareUserWidget(
|
||||||
|
index: e.key,
|
||||||
|
mac: data['mac'.tr],
|
||||||
|
repairListController: controller,
|
||||||
|
))
|
||||||
|
.toList()
|
||||||
|
.addToEnd(SizedBox(
|
||||||
|
height: AppConstants.list_end_height)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
)),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -795,10 +795,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: fluwx
|
name: fluwx
|
||||||
sha256: "46c78b678e2586ad21883dd1b1875b2f4548cf6bf52a388c839fe5d2a6a37e02"
|
sha256: "8dbbe3f2dd93cd5f689de7b1342b86a47db3f03005e2020904fc45a204d0df4f"
|
||||||
url: "https://pub.flutter-io.cn"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.7.1"
|
version: "5.5.2"
|
||||||
font_awesome_flutter:
|
font_awesome_flutter:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
Reference in New Issue
Block a user