From aab51443717b4fb7bdf3b2284ee3bb7ecbbc3270 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sun, 7 Jul 2024 22:27:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AD=97=E5=B9=95req=E5=AF=BC=E8=87=B4h?= =?UTF-8?q?eaderControl=E5=88=9D=E5=A7=8B=E5=8C=96=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/video/detail/controller.dart | 21 +++++++------------ .../video/detail/widgets/header_control.dart | 2 +- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/lib/pages/video/detail/controller.dart b/lib/pages/video/detail/controller.dart index dbdd9fce..662f45f2 100644 --- a/lib/pages/video/detail/controller.dart +++ b/lib/pages/video/detail/controller.dart @@ -152,17 +152,13 @@ class VideoDetailController extends GetxController defaultAudioQa = setting.get(SettingBoxKey.defaultAudioQa, defaultValue: AudioQuality.hiRes.code); oid.value = IdUtils.bv2av(Get.parameters['bvid']!); - getSubtitle().then( - (subtitles) { - headerControl = HeaderControl( - controller: plPlayerController, - videoDetailCtr: this, - floating: floating, - bvid: bvid, - videoType: videoType, - showSubtitleBtn: subtitles.isNotEmpty, - ); - }, + getSubtitle(); + headerControl = HeaderControl( + controller: plPlayerController, + videoDetailCtr: this, + floating: floating, + bvid: bvid, + videoType: videoType, ); } @@ -439,9 +435,6 @@ class VideoDetailController extends GetxController subtitles = result['data'].subtitles; getDanmaku(subtitles); } - return subtitles; - } else { - return []; } } diff --git a/lib/pages/video/detail/widgets/header_control.dart b/lib/pages/video/detail/widgets/header_control.dart index f3b9549a..b2bed21c 100644 --- a/lib/pages/video/detail/widgets/header_control.dart +++ b/lib/pages/video/detail/widgets/header_control.dart @@ -1329,7 +1329,7 @@ class _HeaderControlState extends State { ], /// 字幕 - if (widget.showSubtitleBtn!) + if (widget.showSubtitleBtn ?? true) ComBtn( icon: const Icon( Icons.closed_caption_off,