fix: reply callback null error issues #615

This commit is contained in:
guozhigq
2024-03-05 23:21:51 +08:00
parent 3fad86e7e3
commit 12e947ef84
2 changed files with 6 additions and 4 deletions

View File

@ -280,7 +280,7 @@ class ReplyItem extends StatelessWidget {
// 完成评论,数据添加 // 完成评论,数据添加
if (value != null && value['data'] != null) if (value != null && value['data'] != null)
{ {
addReply!(value['data']) addReply?.call(value['data'])
// replyControl.replies.add(value['data']), // replyControl.replies.add(value['data']),
} }
}); });
@ -531,8 +531,8 @@ InlineSpan buildContent(
spanChilds.add(TextSpan( spanChilds.add(TextSpan(
text: str, text: str,
recognizer: TapGestureRecognizer() recognizer: TapGestureRecognizer()
..onTap = ..onTap = () =>
() => replyReply(replyItem.root == 0 ? replyItem : fReplyItem))); replyReply?.call(replyItem.root == 0 ? replyItem : fReplyItem)));
} }
// 分割文本并处理每个部分 // 分割文本并处理每个部分

View File

@ -92,7 +92,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
icon: const Icon(Icons.close, size: 20), icon: const Icon(Icons.close, size: 20),
onPressed: () { onPressed: () {
_videoReplyReplyController.currentPage = 0; _videoReplyReplyController.currentPage = 0;
widget.closePanel!(); widget.closePanel?.call;
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
@ -184,6 +184,8 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
.add(replyItem); .add(replyItem);
}, },
replyType: widget.replyType, replyType: widget.replyType,
replyReply: (replyItem) =>
replyReply(replyItem),
); );
} }
}, },