Compare commits

...

4 Commits

Author SHA1 Message Date
dom
add633bc66 upgrade deps
Signed-off-by: dom <githubaccount56556@proton.me>
2026-04-19 14:37:34 +08:00
dom
54a88fa2ff fix initial isDyAllowed
Signed-off-by: dom <githubaccount56556@proton.me>
2026-04-19 14:37:34 +08:00
dom
9543f3b457 bring back remove player safearea
Signed-off-by: dom <githubaccount56556@proton.me>
2026-04-19 11:50:31 +08:00
dom
e88769308e fix retry
Signed-off-by: dom <githubaccount56556@proton.me>
2026-04-19 09:33:30 +08:00
13 changed files with 81 additions and 22 deletions

View File

@@ -13,7 +13,7 @@ class CustomVerticalDragGestureRecognizer
IsDyAllowed? isDyAllowed;
bool _isDyAllowed = false;
bool _isDyAllowed = true;
@override
bool isPointerAllowed(PointerEvent event) {

View File

@@ -30,6 +30,7 @@ import 'package:PiliPlus/pages/video/widgets/player_focus.dart';
import 'package:PiliPlus/plugin/pl_player/controller.dart';
import 'package:PiliPlus/plugin/pl_player/models/play_status.dart';
import 'package:PiliPlus/plugin/pl_player/utils/danmaku_options.dart';
import 'package:PiliPlus/plugin/pl_player/utils/fullscreen.dart';
import 'package:PiliPlus/plugin/pl_player/view/view.dart';
import 'package:PiliPlus/services/service_locator.dart';
import 'package:PiliPlus/utils/extension/num_ext.dart';
@@ -81,12 +82,19 @@ class _LiveRoomPageState extends State<LiveRoomPage>
plPlayerController = _liveRoomController.plPlayerController
..addStatusLister(playerListener);
PlPlayerController.setPlayCallBack(plPlayerController.play);
if (plPlayerController.removeSafeArea) {
hideStatusBar();
}
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
padding = MediaQuery.viewPaddingOf(context);
if (plPlayerController.removeSafeArea) {
padding = .zero;
} else {
padding = MediaQuery.viewPaddingOf(context);
}
final size = MediaQuery.sizeOf(context);
maxWidth = size.width;
maxHeight = size.height;
@@ -391,6 +399,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
},
),
Scaffold(
primary: !plPlayerController.removeSafeArea,
resizeToAvoidBottomInset: false,
backgroundColor: Colors.transparent,
appBar: isFullScreen && !isPortrait
@@ -486,6 +495,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
PreferredSizeWidget _buildAppBar(bool isFullScreen) {
final color = Theme.of(context).colorScheme.onSurfaceVariant;
return AppBar(
primary: !plPlayerController.removeSafeArea,
toolbarHeight: isFullScreen ? 0 : null,
backgroundColor: Colors.transparent,
foregroundColor: Colors.white,

View File

@@ -136,6 +136,12 @@ List<SettingsModel> get styleSettings => [
'当前: 主页${Pref.recommendCardWidth.toInt()}dp 其他${Pref.smallCardWidth.toInt()}dp屏幕宽度:${MediaQuery.widthOf(Get.context!).toPrecision(2)}dp。宽度越小列数越多。',
onTap: _showCardWidthDialog,
),
const SwitchModel(
title: '播放页移除安全边距',
leading: Icon(Icons.fit_screen_outlined),
setKey: SettingBoxKey.removeSafeArea,
defaultVal: false,
),
SwitchModel(
title: '视频播放页使用深色主题',
leading: const Icon(Icons.dark_mode_outlined),

View File

@@ -124,6 +124,7 @@ class VideoDetailController extends GetxController
final plPlayerController = PlPlayerController.getInstance()
..brightness.value = -1;
bool get setSystemBrightness => plPlayerController.setSystemBrightness;
bool get removeSafeArea => plPlayerController.removeSafeArea;
late VideoItem firstVideo;
String? videoUrl;

View File

@@ -59,7 +59,6 @@ import 'package:PiliPlus/utils/image_utils.dart';
import 'package:PiliPlus/utils/mobile_observer.dart';
import 'package:PiliPlus/utils/num_utils.dart';
import 'package:PiliPlus/utils/page_utils.dart';
import 'package:PiliPlus/utils/platform_utils.dart';
import 'package:PiliPlus/utils/storage.dart';
import 'package:PiliPlus/utils/storage_key.dart';
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
@@ -142,6 +141,10 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
PlPlayerController.setPlayCallBack(playCallBack);
videoDetailController = Get.put(VideoDetailController(), tag: heroTag);
if (videoDetailController.removeSafeArea) {
hideStatusBar();
}
if (videoDetailController.showReply) {
_videoReplyController = Get.put(
VideoReplyController(
@@ -347,6 +350,10 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
}
}
if (!videoDetailController.removeSafeArea) {
showStatusBar();
}
if (!videoDetailController.plPlayerController.isCloseAll) {
videoPlayerServiceHandler?.onVideoDetailDispose(heroTag);
if (plPlayerController != null) {
@@ -357,9 +364,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
}
}
removeObserverMobile(this);
if (PlatformUtils.isMobile) {
showStatusBar();
}
super.dispose();
}
@@ -449,7 +454,11 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
@override
void didChangeDependencies() {
super.didChangeDependencies();
padding = MediaQuery.viewPaddingOf(context);
if (videoDetailController.removeSafeArea) {
padding = .zero;
} else {
padding = MediaQuery.viewPaddingOf(context);
}
final size = MediaQuery.sizeOf(context);
maxWidth = size.width;
@@ -507,6 +516,9 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
}
}
bool get removeAppBar =>
videoDetailController.removeSafeArea || (isFullScreen && !isPortrait);
Widget get childWhenDisabled {
videoDetailController.animationController
..removeListener(animListener)
@@ -516,7 +528,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
final isFullScreen = this.isFullScreen;
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: isFullScreen && !isPortrait
appBar: removeAppBar
? null
: PreferredSize(
preferredSize: const Size.fromHeight(0),
@@ -818,7 +830,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
final isFullScreen = this.isFullScreen;
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: isFullScreen && !isPortrait
appBar: removeAppBar
? null
: AppBar(backgroundColor: Colors.black, toolbarHeight: 0),
body: Padding(
@@ -1048,7 +1060,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
final isFullScreen = this.isFullScreen;
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: isFullScreen && !isPortrait
appBar: removeAppBar
? null
: AppBar(backgroundColor: Colors.black, toolbarHeight: 0),
body: Padding(

View File

@@ -1881,7 +1881,7 @@ class HeaderControlState extends State<HeaderControl>
: const SizedBox.shrink(),
),
],
if (isFullScreen || PlatformUtils.isDesktop) ...[
if (!isPortrait || isFullScreen || PlatformUtils.isDesktop) ...[
SizedBox(
width: btnWidth,
height: btnHeight,

View File

@@ -1424,6 +1424,7 @@ class PlPlayerController with BlockConfigMixin {
bool isManualFS = true;
late final FullScreenMode mode = Pref.fullScreenMode;
late final horizontalScreen = Pref.horizontalScreen;
late final removeSafeArea = Pref.removeSafeArea;
// 全屏
bool _fsProcessing = false;
@@ -1475,12 +1476,26 @@ class PlPlayerController with BlockConfigMixin {
}
} else {
if (PlatformUtils.isMobile) {
showStatusBar();
if (!removeSafeArea) {
showStatusBar();
}
if (orientation == null && mode == .none) {
return;
}
if (!horizontalScreen) {
await portraitUpMode();
} else {
switch (_orientation) {
case .portraitUp:
await portraitUpMode();
case .landscapeLeft:
await landscapeLeftMode();
case .portraitDown:
await portraitDownMode();
case .landscapeRight:
await landscapeRightMode();
case _:
}
}
} else {
await exitDesktopFullScreen();
@@ -1617,6 +1632,9 @@ class PlPlayerController with BlockConfigMixin {
}
_playerCount = 0;
if (removeSafeArea) {
showStatusBar();
}
danmakuController = null;
_stopOrientationListener();
_disableAutoEnterPip();

View File

@@ -1616,6 +1616,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
isTop: true,
controller: animationController,
isFullScreen: isFullScreen,
removeSafeArea: plPlayerController.removeSafeArea,
child: plPlayerController.isDesktopPip
? GestureDetector(
behavior: HitTestBehavior.translucent,
@@ -1628,6 +1629,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
isTop: false,
controller: animationController,
isFullScreen: isFullScreen,
removeSafeArea: plPlayerController.removeSafeArea,
child:
widget.bottomControl ??
BottomControl(
@@ -1816,6 +1818,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
if (plPlayerController.showFsLockBtn)
ViewSafeArea(
right: false,
left: !plPlayerController.removeSafeArea,
child: Align(
alignment: Alignment.centerLeft,
child: FractionalTranslation(
@@ -1859,6 +1862,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
if (plPlayerController.showFsScreenshotBtn)
ViewSafeArea(
left: false,
right: !plPlayerController.removeSafeArea,
child: Obx(
() => Align(
alignment: Alignment.centerRight,

View File

@@ -8,12 +8,14 @@ class AppBarAni extends StatelessWidget {
required this.controller,
required this.isTop,
required this.isFullScreen,
required this.removeSafeArea,
});
final Widget child;
final AnimationController controller;
final bool isTop;
final bool isFullScreen;
final bool removeSafeArea;
static final _topPos = Tween<Offset>(
begin: const Offset(0.0, -1.0),
@@ -53,11 +55,13 @@ class AppBarAni extends StatelessWidget {
decoration: BoxDecoration(
gradient: isTop ? _topDecoration : _bottomDecoration,
),
child: ViewSafeArea(
left: isFullScreen,
right: isFullScreen,
child: child,
),
child: removeSafeArea
? child
: ViewSafeArea(
left: isFullScreen,
right: isFullScreen,
child: child,
),
),
);
}

View File

@@ -77,7 +77,7 @@ class AccountManager extends Interceptor {
if (!account.accessKey.isNullOrEmpty) {
dataPtr['access_key'] = account.accessKey!;
}
AppSign.appSign(dataPtr);
AppSign.appSign(dataPtr..remove('sign'));
// if (kDebugMode) debugPrint(dataPtr.toString());
}
return handler.next(options);

View File

@@ -149,7 +149,8 @@ abstract final class SettingBoxKey {
enableImgMenu = 'enableImgMenu',
showDynDispute = 'showDynDispute',
touchSlopH = 'touchSlopH',
floatingNavBar = 'floatingNavBar';
floatingNavBar = 'floatingNavBar',
removeSafeArea = 'removeSafeArea';
static const String minimizeOnExit = 'minimizeOnExit',
windowSize = 'windowSize',

View File

@@ -970,4 +970,7 @@ abstract final class Pref {
static bool get floatingNavBar =>
_setting.get(SettingBoxKey.floatingNavBar, defaultValue: false);
static bool get removeSafeArea =>
_setting.get(SettingBoxKey.removeSafeArea, defaultValue: false);
}

View File

@@ -1260,7 +1260,7 @@ packages:
description:
path: "."
ref: master
resolved-ref: "240534adb4b4b5c2c7e6c4578b1fc052ce98d7fd"
resolved-ref: "487209167d7174785a469b929e19a7c587671117"
url: "https://github.com/bggRGjQaUbCoE/flutter_native_device_orientation.git"
source: git
version: "2.0.5"
@@ -1596,10 +1596,10 @@ packages:
dependency: transitive
description:
name: sentry
sha256: "9f9a35c2e74ed79e16373268e0c79bc00988412d4b30b63eb369d2fa32e6814e"
sha256: "8c07a413ce5691db5b299024498f1ad6376e015f61b6d8fc8819b042f65df6c7"
url: "https://pub.dev"
source: hosted
version: "9.17.0"
version: "9.18.0"
share_plus:
dependency: "direct main"
description: