opt: vertical video layout

This commit is contained in:
guozhigq
2024-11-17 15:59:54 +08:00
parent e5d3e84b61
commit 88d8027b60
2 changed files with 22 additions and 8 deletions

View File

@ -221,9 +221,15 @@ class _VideoDetailPageState extends State<VideoDetailPage>
// _extendNestCtr监听
void _extendNestCtrListener() {
final double offset = _extendNestCtr.position.pixels;
vdCtr.sheetHeight.value =
Get.size.height - videoHeight - statusBarHeight + offset;
appbarStream.add(offset);
if (vdCtr.videoDirection.value == 'horizontal') {
vdCtr.sheetHeight.value =
Get.size.height - videoHeight - statusBarHeight + offset;
appbarStream.add(offset);
} else {
if (offset > (Get.size.width * 22 / 16 - videoHeight)) {
appbarStream.add(offset - (Get.size.width * 22 / 16 - videoHeight));
}
}
}
@override
@ -501,6 +507,12 @@ class _VideoDetailPageState extends State<VideoDetailPage>
final double pinnedHeaderHeight =
statusBarHeight + kToolbarHeight + videoHeight.value;
// ignore: no_leading_underscores_for_local_identifiers
vdCtr.videoDirection.listen((p0) {
if (p0 == 'vertical') {
defaultVideoHeight = sizeContext.width * 22 / 16;
videoHeight.value = sizeContext.width * 22 / 16;
}
});
// 竖屏
final bool isPortrait = _context.orientation == Orientation.portrait;