Skip to content

Commit

Permalink
fix: reply callback null error issues #615
Browse files Browse the repository at this point in the history
  • Loading branch information
guozhigq committed Mar 5, 2024
1 parent 3fad86e commit 12e947e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/pages/video/detail/reply/widgets/reply_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class ReplyItem extends StatelessWidget {
// 完成评论,数据添加
if (value != null && value['data'] != null)
{
addReply!(value['data'])
addReply?.call(value['data'])
// replyControl.replies.add(value['data']),
}
});
Expand Down Expand Up @@ -531,8 +531,8 @@ InlineSpan buildContent(
spanChilds.add(TextSpan(
text: str,
recognizer: TapGestureRecognizer()
..onTap =
() => replyReply(replyItem.root == 0 ? replyItem : fReplyItem)));
..onTap = () =>
replyReply?.call(replyItem.root == 0 ? replyItem : fReplyItem)));
}

// 分割文本并处理每个部分
Expand Down
4 changes: 3 additions & 1 deletion lib/pages/video/detail/reply_reply/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
icon: const Icon(Icons.close, size: 20),
onPressed: () {
_videoReplyReplyController.currentPage = 0;
widget.closePanel!();
widget.closePanel?.call;
Navigator.pop(context);
},
),
Expand Down Expand Up @@ -184,6 +184,8 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
.add(replyItem);
},
replyType: widget.replyType,
replyReply: (replyItem) =>
replyReply(replyItem),
);
}
},
Expand Down

0 comments on commit 12e947e

Please sign in to comment.