From ea310acb7adaa4d44d234aacb2422508149b1b42 Mon Sep 17 00:00:00 2001 From: orz12 Date: Sat, 20 Jul 2024 19:26:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B9=B3=E6=9D=BF=E6=A8=AA=E5=B1=8F?= =?UTF-8?q?=E4=B8=94=E5=BC=80=E5=90=AF=E2=80=9C=E4=BC=98=E5=85=88=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E8=AF=84=E8=AE=BA=E5=8C=BA=E2=80=9D=E5=90=8E=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E5=88=87=E5=88=86p?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../video/detail/introduction/controller.dart | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index 9627e669..bdc23e57 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -443,23 +443,21 @@ class VideoIntroController extends GetxController { // 重新获取视频资源 final VideoDetailController videoDetailCtr = Get.find(tag: heroTag); - final RelatedController relatedCtr = - Get.find(tag: heroTag); videoDetailCtr.bvid = bvid; videoDetailCtr.oid.value = aid ?? IdUtils.bv2av(bvid); videoDetailCtr.cid.value = cid; videoDetailCtr.danmakuCid.value = cid; videoDetailCtr.queryVideoUrl(); - relatedCtr.bvid = bvid; - relatedCtr.queryRelatedVideo(); + // 重新请求相关视频 + final RelatedController? relatedCtr = + Get.find(tag: heroTag); + relatedCtr?.bvid = bvid; + relatedCtr?.queryRelatedVideo(); // 重新请求评论 - try { - /// 未渲染回复组件时可能异常 - final VideoReplyController videoReplyCtr = - Get.find(tag: heroTag); - videoReplyCtr.aid = aid; - videoReplyCtr.queryReplyList(type: 'init'); - } catch (_) {} + final VideoReplyController? videoReplyCtr = + Get.find(tag: heroTag); + videoReplyCtr?.aid = aid; + videoReplyCtr?.queryReplyList(type: 'init'); this.bvid = bvid; lastPlayCid.value = cid; await queryVideoIntro();