Skip to content

Commit

Permalink
fix: add reply
Browse files Browse the repository at this point in the history
Signed-off-by: bggRGjQaUbCoE <[email protected]>
  • Loading branch information
bggRGjQaUbCoE committed Nov 25, 2024
1 parent e26ec2e commit bae395c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
5 changes: 4 additions & 1 deletion lib/pages/common/reply_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) {
Expand Down
6 changes: 5 additions & 1 deletion lib/pages/dynamics/detail/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions lib/pages/html/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
_htmlRenderCtr.onReply(
context,
oid: _htmlRenderCtr.oid.value,
replyType: ReplyType.values[type],
);
},
tooltip: '评论动态',
Expand Down
6 changes: 5 additions & 1 deletion lib/pages/video/detail/reply/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/video/detail/reply_reply/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit bae395c

Please sign in to comment.