fix: add reply

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-11-25 17:45:03 +08:00
parent e26ec2ea42
commit bae395c5d0
6 changed files with 18 additions and 6 deletions

View File

@@ -121,6 +121,7 @@ abstract class ReplyController extends CommonController {
dynamic oid,
dynamic replyItem,
int index = 0,
ReplyType? replyType,
}) {
dynamic key = oid ?? replyItem.oid + replyItem.id;
Navigator.of(context)
@@ -131,7 +132,9 @@ abstract class ReplyController extends CommonController {
oid: oid ?? replyItem.oid.toInt(),
root: oid != null ? 0 : replyItem.id.toInt(),
parent: oid != null ? 0 : replyItem.id.toInt(),
replyType: ReplyType.video,
replyType: replyItem != null
? ReplyType.values[replyItem.type.toInt()]
: replyType,
replyItem: replyItem,
savedReply: savedReplies[key],
onSaveReply: (reply) {

View File

@@ -301,7 +301,11 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
feedBack();
dynamic oid = _dynamicDetailController.oid ??
IdUtils.bv2av(Get.parameters['bvid']!);
_dynamicDetailController.onReply(context, oid: oid);
_dynamicDetailController.onReply(
context,
oid: oid,
replyType: ReplyType.values[replyType],
);
},
tooltip: '评论动态',
child: const Icon(Icons.reply),

View File

@@ -307,6 +307,7 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
_htmlRenderCtr.onReply(
context,
oid: _htmlRenderCtr.oid.value,
replyType: ReplyType.values[type],
);
},
tooltip: '评论动态',

View File

@@ -187,7 +187,11 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
feedBack();
dynamic oid = _videoReplyController.aid ??
IdUtils.bv2av(Get.parameters['bvid']!);
_videoReplyController.onReply(context, oid: oid);
_videoReplyController.onReply(
context,
oid: oid,
replyType: ReplyType.video,
);
},
tooltip: '发表评论',
child: const Icon(Icons.reply),

View File

@@ -251,7 +251,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
oid: oid,
root: root,
parent: parent,
replyType: ReplyType.video,
replyType: widget.replyType,
replyItem: item,
savedReply: _savedReplies[key],
onSaveReply: (reply) {

View File

@@ -27,8 +27,8 @@ class Utils {
static final Random random = Random();
static ReplyInfo replyCast(res) {
Map emote = res['content']['emote'];
emote.forEach((key, value) {
Map? emote = res['content']['emote'];
emote?.forEach((key, value) {
value['size'] = value['meta']['size'];
});
return ReplyInfo.create()