feat(comments): added comments deleting and updating

This commit is contained in:
Username1548
2025-07-09 12:34:51 +07:00
parent 0a636e05b8
commit 6dc30f4c89
8 changed files with 153 additions and 61 deletions

View File

@@ -64,6 +64,7 @@ class _CommentsWidgetState extends State<CommentsWidget> {
onTap: () {
showCommentsActionsBottomSheet(
context,
commentText: comment.body,
reply: !isChild
? () {
context.read<CommentsCubit>().setReplyId(comment.id);
@@ -73,8 +74,12 @@ class _CommentsWidgetState extends State<CommentsWidget> {
Clipboard.setData(ClipboardData(text: comment.body));
showInfoToast(s.link_was_copied);
},
edit: () {},
delete: () {},
edit: (String text) {
context.read<CommentsCubit>().updateComment(id: comment.id, body: text);
},
delete: () {
context.read<CommentsCubit>().deleteComment(id: comment.id);
},
complain: () {
showModalBottomSheet(
context: context,