169 lines
5.7 KiB
Dart
169 lines
5.7 KiB
Dart
import 'package:ef/ef.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
|
import 'package:vbvs_app/common/color/appConstants.dart';
|
|
import 'package:vbvs_app/common/util/FitTool.dart';
|
|
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
|
import 'package:vbvs_app/component/tool/CustomCard.dart';
|
|
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
|
|
|
class MessageWidgetWidget extends StatefulWidget {
|
|
const MessageWidgetWidget({super.key});
|
|
|
|
@override
|
|
State<MessageWidgetWidget> createState() => _MessageWidgetWidgetState();
|
|
}
|
|
|
|
class _MessageWidgetWidgetState extends State<MessageWidgetWidget> {
|
|
ThemeController themeController = Get.find();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Stack(
|
|
children: [
|
|
ClickableContainer(
|
|
backgroundColor: themeController.currentColor.sc5,
|
|
highlightColor: themeController.currentColor.sc3,
|
|
borderRadius: 20.rpx,
|
|
padding:
|
|
EdgeInsetsDirectional.fromSTEB(31.rpx, 33.rpx, 0.rpx, 33.rpx),
|
|
onTap: () {},
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Container(
|
|
width: double.infinity,
|
|
constraints: BoxConstraints(
|
|
minHeight: 66.rpx,
|
|
),
|
|
child: Align(
|
|
alignment: AlignmentDirectional(-1, 0),
|
|
child: Text(
|
|
'实时监测结果通知'.tr,
|
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
fontFamily: 'Inter',
|
|
fontSize: 30.rpx,
|
|
letterSpacing: 0.0,
|
|
color: themeController.currentColor.sc3,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
Row(
|
|
mainAxisSize: MainAxisSize.max,
|
|
children: [
|
|
Container(
|
|
constraints: BoxConstraints(
|
|
minWidth: 30.rpx,
|
|
maxWidth: 120.rpx,
|
|
),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
_buildInfoItem(context, '设备ID'),
|
|
_buildInfoItem(context, '使用人员'),
|
|
_buildInfoItem(context, '消息类型'),
|
|
_buildInfoItem(context, '检测数值'),
|
|
_buildInfoItem(context, '发生时间'),
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
constraints: BoxConstraints(
|
|
minWidth: 30.rpx,
|
|
),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.max,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
_buildValueItem(context, '设备ID'),
|
|
_buildValueItem(context, '使用人员'),
|
|
_buildValueItem(context, '消息类型'),
|
|
_buildValueItem(context, '检测数值'),
|
|
_buildValueItem(context, '发生时间'),
|
|
],
|
|
),
|
|
),
|
|
].divide(SizedBox(width: 35.rpx)),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Positioned(
|
|
bottom: 46.rpx,
|
|
right: 20.rpx,
|
|
child: Container(
|
|
width: 123.rpx,
|
|
height: 47.rpx,
|
|
child: CustomCard(
|
|
borderRadius: AppConstants().button_container_radius, // 直角
|
|
colors: [
|
|
themeController.currentColor.sc1,
|
|
themeController.currentColor.sc2
|
|
], // 单色背景
|
|
enableAnimation: true, // 有点击缩放动画
|
|
enableGradient: false, // 不用渐变
|
|
onTap: () {
|
|
// 点击处理逻辑
|
|
print('处理按钮点击了');
|
|
},
|
|
child: Center(
|
|
child: Text(
|
|
'处理'.tr,
|
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
fontFamily: 'Inter',
|
|
fontSize: 26.rpx,
|
|
letterSpacing: 0.0,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget _buildInfoItem(BuildContext context, String label) {
|
|
return Container(
|
|
constraints: BoxConstraints(
|
|
minHeight: 62.rpx,
|
|
),
|
|
child: Align(
|
|
alignment: AlignmentDirectional(-1, 0),
|
|
child: Text(
|
|
label.tr,
|
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
fontFamily: 'Inter',
|
|
fontSize: 26.rpx,
|
|
letterSpacing: 0.0,
|
|
color: themeController.currentColor.sc4,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildValueItem(BuildContext context, String value) {
|
|
return Container(
|
|
constraints: BoxConstraints(
|
|
minHeight: 62.rpx,
|
|
),
|
|
child: Align(
|
|
alignment: AlignmentDirectional(-1, 0),
|
|
child: Text(
|
|
value,
|
|
style: FlutterFlowTheme.of(context).bodyMedium.override(
|
|
fontFamily: 'Inter',
|
|
fontSize: 26.rpx,
|
|
letterSpacing: 0.0,
|
|
color: themeController.currentColor.sc3,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|