|
|
@ -300,134 +300,134 @@ class _EventDetailPageState extends State<EventDetailPage> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget _commentWidget(CommentListModel model, int rootIndex) {
|
|
|
|
Widget _commentWidget(CommentListModel model, int rootIndex) {
|
|
|
|
return GestureDetector(
|
|
|
|
return Container(
|
|
|
|
onTap: () {
|
|
|
|
// key: UniqueKey(),
|
|
|
|
_rootId = model.id;
|
|
|
|
color: Colors.white,
|
|
|
|
_parentId = model.id;
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w),
|
|
|
|
_focusNode.requestFocus();
|
|
|
|
width: double.infinity,
|
|
|
|
_currentCommentIndex = rootIndex;
|
|
|
|
child: Column(
|
|
|
|
},
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
child: Container(
|
|
|
|
children: [
|
|
|
|
// key: UniqueKey(),
|
|
|
|
[
|
|
|
|
color: Colors.white,
|
|
|
|
Material(
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w),
|
|
|
|
color: Color(0xFFF5F5F5),
|
|
|
|
width: double.infinity,
|
|
|
|
borderRadius: BorderRadius.circular(48.w),
|
|
|
|
child: Column(
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
child: FadeInImage.assetNetwork(
|
|
|
|
children: [
|
|
|
|
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
|
|
|
[
|
|
|
|
image: SAASAPI.image(ImgModel.first(model.avatarImgList)),
|
|
|
|
Material(
|
|
|
|
height: 96.w,
|
|
|
|
color: Color(0xFFF5F5F5),
|
|
|
|
width: 96.w,
|
|
|
|
borderRadius: BorderRadius.circular(48.w),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
imageErrorBuilder: (context, error, stackTrace) {
|
|
|
|
child: FadeInImage.assetNetwork(
|
|
|
|
return Image.asset(
|
|
|
|
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
|
|
|
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
|
|
|
image: SAASAPI.image(ImgModel.first(model.avatarImgList)),
|
|
|
|
height: 86.w,
|
|
|
|
height: 96.w,
|
|
|
|
width: 86.w,
|
|
|
|
width: 96.w,
|
|
|
|
);
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
},
|
|
|
|
imageErrorBuilder: (context, error, stackTrace) {
|
|
|
|
|
|
|
|
return Image.asset(
|
|
|
|
|
|
|
|
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
|
|
|
|
|
|
|
height: 86.w,
|
|
|
|
|
|
|
|
width: 86.w,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
20.wb,
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
model.createName,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
color: Colors.black.withOpacity(0.85),
|
|
|
|
|
|
|
|
fontSize: 30.sp,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w500),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
12.hb,
|
|
|
|
|
|
|
|
BeeDateUtil(DateUtil.getDateTime(model.createDate))
|
|
|
|
|
|
|
|
.timeAgoWithHm
|
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
.size(24.sp)
|
|
|
|
|
|
|
|
.color(Color(0xFF999999))
|
|
|
|
|
|
|
|
.make(),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
),
|
|
|
|
CommunityPopButton(
|
|
|
|
20.wb,
|
|
|
|
isMyself: _isMyself,
|
|
|
|
Column(
|
|
|
|
onSelect: (value) async {
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
if (_isMyself) {
|
|
|
|
children: [
|
|
|
|
await CommunityFunc.deleteComment(model.id);
|
|
|
|
Text(
|
|
|
|
_refreshController.callRefresh();
|
|
|
|
model.createName,
|
|
|
|
}
|
|
|
|
maxLines: 1,
|
|
|
|
})
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
].row(),
|
|
|
|
style: TextStyle(
|
|
|
|
40.hb,
|
|
|
|
color: Colors.black.withOpacity(0.85),
|
|
|
|
model.content.text.size(28.sp).color(ktextSubColor).make(),
|
|
|
|
fontSize: 30.sp,
|
|
|
|
30.hb,
|
|
|
|
fontWeight: FontWeight.w500),
|
|
|
|
GestureDetector(
|
|
|
|
),
|
|
|
|
onTap: () async {
|
|
|
|
12.hb,
|
|
|
|
var res =
|
|
|
|
BeeDateUtil(DateUtil.getDateTime(model.createDate))
|
|
|
|
await NetUtil().get(SAASAPI.community.commentLike, params: {
|
|
|
|
.timeAgoWithHm
|
|
|
|
'commentId': model.id,
|
|
|
|
.text
|
|
|
|
});
|
|
|
|
.size(24.sp)
|
|
|
|
if (res.success) {
|
|
|
|
.color(Color(0xFF999999))
|
|
|
|
_likes[rootIndex] = !_likes[rootIndex];
|
|
|
|
.make(),
|
|
|
|
setState(() {});
|
|
|
|
],
|
|
|
|
}
|
|
|
|
),
|
|
|
|
},
|
|
|
|
Spacer(),
|
|
|
|
child: Row(
|
|
|
|
CommunityPopButton(
|
|
|
|
children: [
|
|
|
|
isMyself: _isMyself,
|
|
|
|
Spacer(),
|
|
|
|
onSelect: (value) async {
|
|
|
|
GestureDetector(
|
|
|
|
if (_isMyself) {
|
|
|
|
onTap: () async {
|
|
|
|
await CommunityFunc.deleteComment(model.id);
|
|
|
|
var base = await NetUtil().get(
|
|
|
|
_refreshController.callRefresh();
|
|
|
|
SAASAPI.community.commentLike,
|
|
|
|
}
|
|
|
|
params: {'commentId': model.id});
|
|
|
|
})
|
|
|
|
if (base.success) {
|
|
|
|
].row(),
|
|
|
|
_likes[rootIndex] = !_likes[rootIndex];
|
|
|
|
40.hb,
|
|
|
|
if (_likes[rootIndex]) {
|
|
|
|
model.content.text.size(28.sp).color(ktextSubColor).make(),
|
|
|
|
_likeNums[rootIndex] += 1;
|
|
|
|
30.hb,
|
|
|
|
} else {
|
|
|
|
GestureDetector(
|
|
|
|
_likeNums[rootIndex] -= 1;
|
|
|
|
onTap: () async {
|
|
|
|
}
|
|
|
|
var res =
|
|
|
|
BotToast.showText(
|
|
|
|
await NetUtil().get(SAASAPI.community.commentLike, params: {
|
|
|
|
text: _likes[rootIndex] ? '点赞成功' : '取消点赞成功');
|
|
|
|
'commentId': model.id,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
if (res.success) {
|
|
|
|
|
|
|
|
_likes[rootIndex] = !_likes[rootIndex];
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Spacer(),
|
|
|
|
|
|
|
|
GestureDetector(
|
|
|
|
|
|
|
|
onTap: () async {
|
|
|
|
|
|
|
|
var base = await NetUtil().get(
|
|
|
|
|
|
|
|
SAASAPI.community.commentLike,
|
|
|
|
|
|
|
|
params: {'commentId': model.id});
|
|
|
|
|
|
|
|
if (base.success) {
|
|
|
|
|
|
|
|
_likes[rootIndex] = !_likes[rootIndex];
|
|
|
|
|
|
|
|
if (_likes[rootIndex]) {
|
|
|
|
|
|
|
|
_likeNums[rootIndex] += 1;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
BotToast.showText(text: base.msg);
|
|
|
|
_likeNums[rootIndex] -= 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BotToast.showText(
|
|
|
|
|
|
|
|
text: _likes[rootIndex] ? '点赞成功' : '取消点赞成功');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
BotToast.showText(text: base.msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Material(
|
|
|
|
child: Material(
|
|
|
|
color: Colors.transparent,
|
|
|
|
color: Colors.transparent,
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
|
R.ASSETS_ICONS_COMMUNITY_LIKE_PNG,
|
|
|
|
R.ASSETS_ICONS_COMMUNITY_LIKE_PNG,
|
|
|
|
width: 32.w,
|
|
|
|
width: 32.w,
|
|
|
|
height: 32.w,
|
|
|
|
height: 32.w,
|
|
|
|
color: !_likes[rootIndex]
|
|
|
|
color: !_likes[rootIndex]
|
|
|
|
? Colors.black.withOpacity(0.45)
|
|
|
|
? Colors.black.withOpacity(0.45)
|
|
|
|
: kPrimaryColor,
|
|
|
|
: kPrimaryColor,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
5.wb,
|
|
|
|
5.wb,
|
|
|
|
'${_likeNums[rootIndex]}'
|
|
|
|
'${_likeNums[rootIndex]}'
|
|
|
|
.text
|
|
|
|
.text
|
|
|
|
.size(24.sp)
|
|
|
|
.size(24.sp)
|
|
|
|
.color(Color(0xFF999999))
|
|
|
|
.color(Color(0xFF999999))
|
|
|
|
.make(),
|
|
|
|
.make(),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
32.wb,
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
32.wb,
|
|
|
|
|
|
|
|
GestureDetector(
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
_rootId = model.id;
|
|
|
|
|
|
|
|
_parentId = model.id;
|
|
|
|
|
|
|
|
_focusNode.requestFocus();
|
|
|
|
|
|
|
|
_currentCommentIndex = rootIndex;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
|
R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG,
|
|
|
|
R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG,
|
|
|
@ -436,46 +436,46 @@ class _EventDetailPageState extends State<EventDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
5.wb,
|
|
|
|
),
|
|
|
|
'${model.commentNum}'
|
|
|
|
5.wb,
|
|
|
|
.text
|
|
|
|
'${model.commentNum}'
|
|
|
|
.size(24.sp)
|
|
|
|
.text
|
|
|
|
.color(Color(0xFF999999))
|
|
|
|
.size(24.sp)
|
|
|
|
.make(),
|
|
|
|
.color(Color(0xFF999999))
|
|
|
|
],
|
|
|
|
.make(),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
40.hb,
|
|
|
|
),
|
|
|
|
model.commentTwoList.isEmpty
|
|
|
|
40.hb,
|
|
|
|
? SizedBox.shrink()
|
|
|
|
model.commentTwoList.isEmpty
|
|
|
|
: Container(
|
|
|
|
? SizedBox.shrink()
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
alignment: Alignment.topLeft,
|
|
|
|
color: Colors.black.withOpacity(0.06),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(16.w)),
|
|
|
|
color: Colors.black.withOpacity(0.06),
|
|
|
|
margin: EdgeInsets.only(left: 125.w),
|
|
|
|
borderRadius: BorderRadius.circular(16.w)),
|
|
|
|
width: 600.w,
|
|
|
|
margin: EdgeInsets.only(left: 125.w),
|
|
|
|
padding:
|
|
|
|
width: 600.w,
|
|
|
|
EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
|
|
|
|
padding:
|
|
|
|
child: Column(
|
|
|
|
EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
...List.generate(
|
|
|
|
children: <Widget>[
|
|
|
|
model.commentTwoList.length < 3
|
|
|
|
...List.generate(
|
|
|
|
? model.commentTwoList.length
|
|
|
|
model.commentTwoList.length < 3
|
|
|
|
: 3,
|
|
|
|
? model.commentTwoList.length
|
|
|
|
(index) => _subCommentWidget(
|
|
|
|
: 3,
|
|
|
|
model.commentTwoList[index],
|
|
|
|
(index) => _subCommentWidget(
|
|
|
|
model.createId,
|
|
|
|
model.commentTwoList[index],
|
|
|
|
model.id,
|
|
|
|
model.createId,
|
|
|
|
rootIndex)),
|
|
|
|
model.id,
|
|
|
|
if (model.commentTwoList.length > 3)
|
|
|
|
rootIndex)),
|
|
|
|
_foldComment(model, rootIndex)
|
|
|
|
if (model.commentTwoList.length > 3)
|
|
|
|
].sepWidget(separate: 24.hb),
|
|
|
|
_foldComment(model, rootIndex)
|
|
|
|
),
|
|
|
|
].sepWidget(separate: 24.hb),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|