opt: show video sheet

Closes #761

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-27 14:00:05 +08:00
parent dc1cca0d4c
commit 3722ff1f33
3 changed files with 17 additions and 13 deletions

View File

@@ -126,6 +126,7 @@ class _SettingPageState extends State<SettingPage> {
child: MediaQuery.removePadding(
context: context,
removeRight: true,
removeTop: true,
child: _buildList,
),
),
@@ -138,6 +139,7 @@ class _SettingPageState extends State<SettingPage> {
child: MediaQuery.removePadding(
context: context,
removeLeft: true,
removeTop: true,
child: switch (_type) {
'privacySetting' => PrivacySetting(showAppBar: false),
'recommendSetting' => RecommendSetting(showAppBar: false),

View File

@@ -423,7 +423,7 @@ class VideoDetailController extends GetxController
}
: null,
);
if (plPlayerController.isFullScreen.value) {
if (plPlayerController.isFullScreen.value || showVideoSheet) {
PageUtils.showVideoBottomSheet(
context,
child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
@@ -445,6 +445,11 @@ class VideoDetailController extends GetxController
}
}
bool horizontalScreen =
GStorage.setting.get(SettingBoxKey.horizontalScreen, defaultValue: false);
bool get showVideoSheet =>
!horizontalScreen && Get.context!.orientation == Orientation.landscape;
int? _lastPos;
double? _blockLimit;
List<Pair<SegmentType, SkipType>>? _blockSettings;
@@ -1356,7 +1361,7 @@ class VideoDetailController extends GetxController
),
);
}
if (plPlayerController.isFullScreen.value) {
if (plPlayerController.isFullScreen.value || showVideoSheet) {
PageUtils.showVideoBottomSheet(
context,
child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
@@ -1649,7 +1654,7 @@ class VideoDetailController extends GetxController
title =
Get.find<VideoIntroController>(tag: heroTag).videoDetail.value.title;
} catch (_) {}
if (plPlayerController.isFullScreen.value) {
if (plPlayerController.isFullScreen.value || showVideoSheet) {
PageUtils.showVideoBottomSheet(
context,
child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null

View File

@@ -78,7 +78,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
// 自动退出全屏
late bool autoExitFullscreen;
late bool autoPlayEnable;
late bool horizontalScreen;
late bool enableVerticalExpand;
late bool autoPiP;
late bool pipNoDanmaku;
@@ -151,8 +150,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
}
autoExitFullscreen =
setting.get(SettingBoxKey.enableAutoExit, defaultValue: true);
horizontalScreen =
setting.get(SettingBoxKey.horizontalScreen, defaultValue: false);
autoPlayEnable =
setting.get(SettingBoxKey.autoPlayEnable, defaultValue: false);
autoPiP = setting.get(SettingBoxKey.autoPiP, defaultValue: false);
@@ -359,7 +356,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
videoIntroController.canelTimer();
videoIntroController.videoDetail.close();
videoDetailController.cid.close();
if (!horizontalScreen) {
if (!videoDetailController.horizontalScreen) {
AutoOrientation.portraitUpMode();
}
shutdownTimerService.handleWaitingFinished();
@@ -648,7 +645,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
final double videoWidth = context.width;
if (MediaQuery.of(context).orientation ==
Orientation.landscape &&
!horizontalScreen &&
!videoDetailController.horizontalScreen &&
!isFullScreen &&
isShowing &&
mounted) {
@@ -1454,7 +1451,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
late ThemeData themeData;
Widget get child {
if (!horizontalScreen) {
if (!videoDetailController.horizontalScreen) {
return autoChoose(childWhenDisabled);
}
@@ -1633,7 +1630,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
Widget videoPlayer(double videoWidth, double videoHeight) {
return PopScope(
canPop: !isFullScreen &&
(horizontalScreen ||
(videoDetailController.horizontalScreen ||
MediaQuery.of(context).orientation == Orientation.portrait),
onPopInvokedWithResult: _onPopInvokedWithResult,
child: Stack(
@@ -2143,7 +2140,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
);
},
);
if (isFullScreen) {
if (isFullScreen || videoDetailController.showVideoSheet) {
PageUtils.showVideoBottomSheet(
context,
isFullScreen: () => isFullScreen,
@@ -2241,7 +2238,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
}
void showViewPoints() {
if (isFullScreen) {
if (isFullScreen || videoDetailController.showVideoSheet) {
PageUtils.showVideoBottomSheet(
context,
isFullScreen: () => isFullScreen,
@@ -2280,7 +2277,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
plPlayerController!.triggerFullScreen(status: false);
}
if (MediaQuery.of(context).orientation == Orientation.landscape &&
!horizontalScreen) {
!videoDetailController.horizontalScreen) {
verticalScreenForTwoSeconds();
}
}