opt: watchLater visible logic

This commit is contained in:
guozhigq
2024-12-02 21:01:33 +08:00
parent 97d20b1145
commit 1395f7ebf3
2 changed files with 5 additions and 8 deletions

View File

@ -624,10 +624,8 @@ class VideoDetailController extends GetxController
} }
void toggeleWatchLaterVisible(bool val) { void toggeleWatchLaterVisible(bool val) {
if (sourceType.value == 'watchLater' || if (['watchLater', 'fav', 'up_archive'].contains(sourceType.value)) {
sourceType.value == 'fav' || isWatchLaterVisible.value = val;
sourceType.value == 'up_archive') {
isWatchLaterVisible.value = !isWatchLaterVisible.value;
} }
} }

View File

@ -206,12 +206,12 @@ class _VideoDetailPageState extends State<VideoDetailPage>
vdCtr.bottomList.insert(3, BottomControlType.episode); vdCtr.bottomList.insert(3, BottomControlType.episode);
} }
} }
vdCtr.toggeleWatchLaterVisible(false);
} else { } else {
if (vdCtr.bottomList.contains(BottomControlType.episode)) { if (vdCtr.bottomList.contains(BottomControlType.episode)) {
vdCtr.bottomList.removeAt(3); vdCtr.bottomList.removeAt(3);
} }
} }
vdCtr.toggeleWatchLaterVisible(!isFullScreen);
}); });
} }
@ -825,9 +825,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
/// 稍后再看列表 /// 稍后再看列表
Obx( Obx(
() => Visibility( () => Visibility(
visible: vdCtr.sourceType.value == 'watchLater' || visible: ['watchLater', 'fav', 'up_archive']
vdCtr.sourceType.value == 'fav' || .contains(vdCtr.sourceType.value),
vdCtr.sourceType.value == 'up_archive',
child: AnimatedPositioned( child: AnimatedPositioned(
duration: const Duration(milliseconds: 400), duration: const Duration(milliseconds: 400),
curve: Curves.easeInOut, curve: Curves.easeInOut,