fix: 非横屏逻辑短路

This commit is contained in:
orz12
2024-03-13 21:21:15 +08:00
parent a302b6f703
commit ff4ea8c457

View File

@@ -382,6 +382,16 @@ class _VideoDetailPageState extends State<VideoDetailPage>
videoDetailController.tabCtr.index != 1) { videoDetailController.tabCtr.index != 1) {
videoheight = context.width * 5 / 4; videoheight = context.width * 5 / 4;
} }
if (MediaQuery.of(context).orientation ==
Orientation.landscape &&
!horizontalScreen && !isFullScreen.value && isShowing && mounted) {
hideStatusBar();
}
if (MediaQuery.of(context).orientation ==
Orientation.portrait &&
!isFullScreen.value && isShowing && mounted) {
showStatusBar();
}
return SizedBox( return SizedBox(
height: MediaQuery.of(context).orientation == height: MediaQuery.of(context).orientation ==
Orientation.landscape || Orientation.landscape ||
@@ -855,6 +865,18 @@ class _VideoDetailPageState extends State<VideoDetailPage>
), ),
), ),
); );
if (!horizontalScreen) {
Orientation orientation = MediaQuery.of(context).orientation;
if (Platform.isAndroid) {
return PiPSwitcher(
childWhenDisabled: childWhenDisabled,
childWhenEnabled: childWhenEnabled,
floating: floating,
);
}
return childWhenDisabled;
}
return OrientationBuilder( return OrientationBuilder(
builder: (BuildContext context, Orientation orientation) { builder: (BuildContext context, Orientation orientation) {
if (!isShowing) { if (!isShowing) {