替换点赞类型的评论通知样式

hmxc
张萌 4 years ago
parent 76dd5e6621
commit 431f8926a7

@ -1,4 +1,5 @@
import 'package:akuCommunity/model/common/img_model.dart'; import 'package:akuCommunity/model/common/img_model.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flustars/flustars.dart'; import 'package:flustars/flustars.dart';
@ -41,6 +42,24 @@ class _CommentMessagePageState extends State<CommentMessagePage> {
return BeeDateUtil(DateUtil.getDateTime(time)).timeAgo; return BeeDateUtil(DateUtil.getDateTime(time)).timeAgo;
} }
Widget _messageContent(CommentMessageModel model) {
if (model.type == 2) {
return Icon(
CupertinoIcons.heart,
size: 32.w,
);
} else {
return ((model.respondentName?.isEmptyOrNull ?? true)
? model.content
: '回复了${model.respondentName}:${model.content}')
.text
.black
.size(28.sp)
.isIntrinsic
.make();
}
}
Widget buildCard(CommentMessageModel model) { Widget buildCard(CommentMessageModel model) {
return Container( return Container(
width: double.infinity, width: double.infinity,
@ -66,14 +85,9 @@ class _CommentMessagePageState extends State<CommentMessagePage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
model.createName.text.black.size(36.sp).make(), model.createName.text.black.size(36.sp).make(),
((model.respondentName?.isEmptyOrNull ?? true) 10.w.heightBox,
? model.content _messageContent(model),
: '回复了${model.respondentName}:${model.content}') 16.w.heightBox,
.text
.black
.size(28.sp)
.isIntrinsic
.make(),
getTime(model.createDate) getTime(model.createDate)
.text .text
.color(Color(0xFF999999)) .color(Color(0xFF999999))

@ -111,6 +111,7 @@ class _MessageCenterPageState extends State<MessageCenterPage> {
onTap: () async { onTap: () async {
await NetUtil().dio.get(API.message.allReadComment); await NetUtil().dio.get(API.message.allReadComment);
Get.to(() => CommentMessagePage()); Get.to(() => CommentMessagePage());
setState(() {});
}, },
), ),
// _buildCard( // _buildCard(

Loading…
Cancel
Save