|
|
|
@ -16,7 +16,6 @@ import 'package:like_button/like_button.dart';
|
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
|
|
|
|
|
|
class CommentList extends StatefulWidget { |
|
|
|
|
|
|
|
|
|
final bool isKeyBoardShow; |
|
|
|
|
final Function reply; |
|
|
|
|
final Function delCommentTips; |
|
|
|
@ -26,8 +25,9 @@ class CommentList extends StatefulWidget {
|
|
|
|
|
final int like; |
|
|
|
|
final Function requestApiFinish; |
|
|
|
|
|
|
|
|
|
CommentList(Key key, this.like, this.relationalId,this.relationalType, |
|
|
|
|
this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize,{this.requestApiFinish}) |
|
|
|
|
CommentList(Key key, this.like, this.relationalId, this.relationalType, |
|
|
|
|
this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize, |
|
|
|
|
{this.requestApiFinish}) |
|
|
|
|
: super(key: key); |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@ -59,7 +59,6 @@ class CommentListState extends State<CommentList> {
|
|
|
|
|
} else { |
|
|
|
|
element.likes += 1; |
|
|
|
|
element.liked = true; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -129,8 +128,8 @@ class CommentListState extends State<CommentList> {
|
|
|
|
|
color: Colors.white, |
|
|
|
|
child: InkWell( |
|
|
|
|
onTap: () { |
|
|
|
|
showPressMenu(memberList[position].createUser, |
|
|
|
|
memberList[position]); |
|
|
|
|
// showPressMenu(memberList[position].createUser, |
|
|
|
|
// memberList[position]); |
|
|
|
|
}, |
|
|
|
|
child: commentItem(memberList[position]), |
|
|
|
|
), |
|
|
|
@ -198,8 +197,7 @@ class CommentListState extends State<CommentList> {
|
|
|
|
|
|
|
|
|
|
//评论列表 |
|
|
|
|
queryMemberCommentList() async { |
|
|
|
|
if(widget?.relationalId == null || widget.relationalId.isEmpty) |
|
|
|
|
return; |
|
|
|
|
if (widget?.relationalId == null || widget.relationalId.isEmpty) return; |
|
|
|
|
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); |
|
|
|
|
if (apiService == null) |
|
|
|
|
apiService = ApiService( |
|
|
|
@ -263,15 +261,27 @@ class CommentListState extends State<CommentList> {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
MImage( |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/personal_page', arguments: { |
|
|
|
|
"memberId": memberList.createUser, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
child: MImage( |
|
|
|
|
memberList.userAvatarUrl ?? "", |
|
|
|
|
fit: BoxFit.cover, |
|
|
|
|
isCircle: true, |
|
|
|
|
width: 40, |
|
|
|
|
height: 40, |
|
|
|
|
radius: BorderRadius.circular(4), |
|
|
|
|
fadeSrc: "assets/image/default_user.webp", |
|
|
|
|
errorSrc: "assets/image/default_user.webp", |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 12.w, |
|
|
|
|
), |
|
|
|
@ -366,6 +376,15 @@ class CommentListState extends State<CommentList> {
|
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
GestureDetector( |
|
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
showPressMenu(memberList.createUser, |
|
|
|
|
memberList); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: |
|
|
|
|
Container( |
|
|
|
|
padding: EdgeInsets.only( |
|
|
|
|
left: 68.w, |
|
|
|
@ -383,7 +402,7 @@ class CommentListState extends State<CommentList> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|