opt: 可拖动标识

This commit is contained in:
guozhigq
2024-04-13 15:46:12 +08:00
parent 2e56f23391
commit 72608bd14d

View File

@ -47,7 +47,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
late BangumiIntroController bangumiIntroController; late BangumiIntroController bangumiIntroController;
late String heroTag; late String heroTag;
PlayerStatus playerStatus = PlayerStatus.playing; Rx<PlayerStatus> playerStatus = PlayerStatus.playing.obs;
double doubleOffset = 0; double doubleOffset = 0;
final Box<dynamic> localCache = GStrorage.localCache; final Box<dynamic> localCache = GStrorage.localCache;
@ -122,7 +122,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
// 播放器状态监听 // 播放器状态监听
void playerListener(PlayerStatus? status) async { void playerListener(PlayerStatus? status) async {
playerStatus = status!; playerStatus.value = status!;
if (status == PlayerStatus.completed) { if (status == PlayerStatus.completed) {
// 结束播放退出全屏 // 结束播放退出全屏
if (autoExitFullcreen) { if (autoExitFullcreen) {
@ -368,6 +368,18 @@ class _VideoDetailPageState extends State<VideoDetailPage>
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Obx(() => AnimatedOpacity(
opacity: playerStatus.value != PlayerStatus.playing
? 1
: 0,
duration: const Duration(milliseconds: 100),
child: const Icon(
Icons.drag_handle_rounded,
size: 20,
color: Colors.grey,
),
)),
const SizedBox(width: 8),
SizedBox( SizedBox(
height: 32, height: 32,
child: TextButton( child: TextButton(
@ -406,7 +418,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
), ),
), ),
), ),
const SizedBox(width: 14), const SizedBox(width: 18),
], ],
), ),
)), )),
@ -559,7 +571,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
Orientation.landscape || Orientation.landscape ||
plPlayerController?.isFullScreen.value == true plPlayerController?.isFullScreen.value == true
? MediaQuery.sizeOf(context).height ? MediaQuery.sizeOf(context).height
: playerStatus != PlayerStatus.playing : playerStatus.value != PlayerStatus.playing
? kToolbarHeight ? kToolbarHeight
: pinnedHeaderHeight; : pinnedHeaderHeight;
}, },
@ -626,7 +638,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
return ScrollAppBar( return ScrollAppBar(
snapshot.data!.toDouble(), snapshot.data!.toDouble(),
() => continuePlay(), () => continuePlay(),
playerStatus, playerStatus.value,
null, null,
); );
}), }),