opt: 字幕按钮显隐逻辑

This commit is contained in:
guozhigq
2024-06-30 13:02:50 +08:00
parent 9f1b74b7e2
commit a19129c596
2 changed files with 38 additions and 25 deletions

View File

@ -30,6 +30,7 @@ class HeaderControl extends StatefulWidget implements PreferredSizeWidget {
this.floating,
this.bvid,
this.videoType,
this.showSubtitleBtn,
super.key,
});
final PlPlayerController? controller;
@ -37,6 +38,7 @@ class HeaderControl extends StatefulWidget implements PreferredSizeWidget {
final Floating? floating;
final String? bvid;
final SearchType? videoType;
final bool? showSubtitleBtn;
@override
State<HeaderControl> createState() => _HeaderControlState();
@ -1327,14 +1329,15 @@ class _HeaderControlState extends State<HeaderControl> {
],
/// 字幕
ComBtn(
icon: const Icon(
Icons.closed_caption_off,
size: 22,
color: Colors.white,
if (widget.showSubtitleBtn!)
ComBtn(
icon: const Icon(
Icons.closed_caption_off,
size: 22,
color: Colors.white,
),
fuc: () => showSubtitleDialog(),
),
fuc: () => showSubtitleDialog(),
),
SizedBox(width: buttonSpace),
Obx(
() => SizedBox(