This commit is contained in:
wyf
2025-05-22 08:56:27 +08:00
parent 489e907e00
commit 8a418c9c98
39 changed files with 5964 additions and 144 deletions

View File

@@ -102,138 +102,298 @@ class _MessagePageState extends State<MessagePage> {
child: Column(
children: [
SizedBox(height: 40.rpx),
// Expanded(
// child: Stack(
// alignment: Alignment.bottomLeft,
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Obx(() {
// return ClickableContainer(
// padding: EdgeInsets.all(0),
// backgroundColor: Colors.transparent,
// highlightColor:
// themeController.currentColor.sc21,
// borderRadius: 8.rpx,
// onTap: () => _onTabChanged(0),
// child: Container(
// width: 160.rpx,
// alignment: Alignment.center,
// child: Stack(
// alignment: Alignment.center,
// clipBehavior: Clip.none,
// children: [
// Text(
// '体征消息'.tr,
// style: FlutterFlowTheme.of(context)
// .bodyMedium
// .override(
// fontFamily: 'Inter',
// fontSize: AppConstants()
// .title_text_fontSize,
// color:
// messageController
// .model.type ==
// 2
// ? themeController
// .currentColor.sc3
// : themeController
// .currentColor.sc2,
// ),
// ),
// Obx(() {
// return messageController.model
// .body_message_read ==
// 1
// ? Positioned(
// top: -4,
// right: -14,
// child: Container(
// width: 8,
// height: 8,
// decoration:
// const BoxDecoration(
// color: Colors.red,
// shape: BoxShape.circle,
// ),
// ),
// )
// : const SizedBox.shrink();
// }),
// ],
// ),
// ),
// );
// }),
// Obx(() {
// return ClickableContainer(
// padding: EdgeInsets.all(0),
// backgroundColor: Colors.transparent,
// highlightColor:
// themeController.currentColor.sc21,
// borderRadius: 8.rpx,
// onTap: () => _onTabChanged(1),
// child: Container(
// width: 160.rpx,
// alignment: Alignment.center,
// child: Stack(
// alignment: Alignment.center,
// clipBehavior: Clip.none,
// children: [
// Text(
// '系统消息'.tr,
// style: FlutterFlowTheme.of(context)
// .bodyMedium
// .override(
// fontFamily: 'Inter',
// fontSize: AppConstants()
// .title_text_fontSize,
// color:
// messageController
// .model.type ==
// 1
// ? themeController
// .currentColor.sc3
// : themeController
// .currentColor.sc2,
// ),
// ),
// Obx(() {
// return messageController.model
// .system_message_read ==
// 1
// ? Positioned(
// top: -4,
// right: -14,
// child: Container(
// width: 8,
// height: 8,
// decoration:
// const BoxDecoration(
// color: Colors.red,
// shape: BoxShape.circle,
// ),
// ),
// )
// : const SizedBox.shrink();
// }),
// ],
// ),
// ),
// );
// }),
// ].divide(SizedBox(width: 10.rpx)),
// ),
// Obx(() {
// double lineWidth = 170.rpx;
// return AnimatedPositioned(
// duration: const Duration(milliseconds: 300),
// curve: Curves.easeInOut,
// bottom: 0,
// left: messageController.model.type == 1
// ? 0
// : 170.rpx,
// child: Container(
// width: lineWidth,
// height: 4.rpx,
// decoration: BoxDecoration(
// color: themeController.currentColor.sc2,
// borderRadius: BorderRadius.circular(2.rpx),
// ),
// ),
// );
// }),
// ],
// ),
// ),
Expanded(
child: Stack(
alignment: Alignment.bottomLeft,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
// 第一个容器,宽度占屏幕一半
Obx(() {
return ClickableContainer(
padding: EdgeInsets.all(0),
backgroundColor: Colors.transparent,
highlightColor:
themeController.currentColor.sc21,
borderRadius: 8.rpx,
onTap: () => _onTabChanged(0),
child: Container(
width: 160.rpx,
alignment: Alignment.center,
child: Stack(
return Expanded(
child: ClickableContainer(
padding: EdgeInsets.all(0),
backgroundColor: Colors.transparent,
highlightColor:
themeController.currentColor.sc21,
borderRadius: 8.rpx,
onTap: () => _onTabChanged(0),
child: Container(
alignment: Alignment.center,
clipBehavior: Clip.none,
children: [
Text(
'体征消息'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
fontSize: AppConstants()
.title_text_fontSize,
color:
messageController
.model.type ==
2
? themeController
.currentColor.sc3
: themeController
.currentColor.sc2,
),
),
Obx(() {
return messageController.model
.body_message_read ==
1
? Positioned(
top: -4,
right: -14,
child: Container(
width: 8,
height: 8,
decoration:
const BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
child: Stack(
alignment: Alignment.center,
clipBehavior: Clip.none,
children: [
Text(
'体征消息'.tr,
style:
FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
fontSize: AppConstants()
.title_text_fontSize,
color: messageController
.model.type ==
2
? themeController
.currentColor
.sc3
: themeController
.currentColor
.sc2,
),
),
)
: const SizedBox.shrink();
}),
],
),
Obx(() {
return messageController.model
.body_message_read ==
1
? Positioned(
top: -4,
right: -14,
child: Container(
width: 8,
height: 8,
decoration:
const BoxDecoration(
color: Colors.red,
shape:
BoxShape.circle,
),
),
)
: const SizedBox.shrink();
}),
],
),
),
),
);
}),
SizedBox(width: 10.rpx),
// 第二个容器,宽度占屏幕一半
Obx(() {
return ClickableContainer(
padding: EdgeInsets.all(0),
backgroundColor: Colors.transparent,
highlightColor:
themeController.currentColor.sc21,
borderRadius: 8.rpx,
onTap: () => _onTabChanged(1),
child: Container(
width: 160.rpx,
alignment: Alignment.center,
child: Stack(
return Expanded(
child: ClickableContainer(
padding: EdgeInsets.all(0),
backgroundColor: Colors.transparent,
highlightColor:
themeController.currentColor.sc21,
borderRadius: 8.rpx,
onTap: () => _onTabChanged(1),
child: Container(
alignment: Alignment.center,
clipBehavior: Clip.none,
children: [
Text(
'系统消息'.tr,
style: FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
fontSize: AppConstants()
.title_text_fontSize,
color:
messageController
.model.type ==
1
? themeController
.currentColor.sc3
: themeController
.currentColor.sc2,
),
),
Obx(() {
return messageController.model
.system_message_read ==
1
? Positioned(
top: -4,
right: -14,
child: Container(
width: 8,
height: 8,
decoration:
const BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
child: Stack(
alignment: Alignment.center,
clipBehavior: Clip.none,
children: [
Text(
'系统消息'.tr,
style:
FlutterFlowTheme.of(context)
.bodyMedium
.override(
fontFamily: 'Inter',
fontSize: AppConstants()
.title_text_fontSize,
color: messageController
.model.type ==
1
? themeController
.currentColor
.sc3
: themeController
.currentColor
.sc2,
),
),
)
: const SizedBox.shrink();
}),
],
),
Obx(() {
return messageController.model
.system_message_read ==
1
? Positioned(
top: -4,
right: -14,
child: Container(
width: 8,
height: 8,
decoration:
const BoxDecoration(
color: Colors.red,
shape:
BoxShape.circle,
),
),
)
: const SizedBox.shrink();
}),
],
),
),
),
);
}),
].divide(SizedBox(width: 10.rpx)),
],
),
// 动画线
Obx(() {
double lineWidth = 170.rpx;
double lineWidth =
MediaQuery.sizeOf(context).width * 0.5 -
20.rpx; // 每个容器占宽度的一半
return AnimatedPositioned(
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
bottom: 0,
left: messageController.model.type == 1
? 0
: 170.rpx,
: MediaQuery.sizeOf(context).width * 0.5 +
10.rpx, // 动态设置左侧位置
child: Container(
width: lineWidth,
height: 4.rpx,