From b85413be9bb6fbf1fa73bce554caf7a472c7f5b1 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Fri, 7 Mar 2025 15:04:13 +0800 Subject: [PATCH] opt: video bg Closes #397 Signed-off-by: bggRGjQaUbCoE --- lib/pages/video/detail/view.dart | 36 +++--------------------------- lib/pages/video/detail/view_v.dart | 27 +++------------------- 2 files changed, 6 insertions(+), 57 deletions(-) diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index 0d70b2407..79df6baf4 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -543,21 +543,11 @@ class _VideoDetailPageState extends State Scaffold( resizeToAvoidBottomInset: false, key: videoDetailController.scaffoldKey, - // backgroundColor: Colors.black, appBar: removeSafeArea ? null : AppBar( backgroundColor: Colors.black, - // showStatusBarBackgroundColor ? null : Colors.black, toolbarHeight: 0, - // systemOverlayStyle: SystemUiOverlayStyle( - // statusBarIconBrightness: - // Theme.of(context).brightness == Brightness.dark || - // !showStatusBarBackgroundColor - // ? Brightness.light - // : Brightness.dark, - // systemNavigationBarColor: Colors.transparent, - // ), ), body: Column( children: [ @@ -588,9 +578,7 @@ class _VideoDetailPageState extends State showStatusBar(); } } - return Container( - color: Colors.black, - // showStatusBarBackgroundColor ? null : Colors.black, + return SizedBox( height: MediaQuery.of(context).orientation == Orientation.landscape || isFullScreen @@ -921,21 +909,11 @@ class _VideoDetailPageState extends State Scaffold( resizeToAvoidBottomInset: false, key: videoDetailController.scaffoldKey, - // backgroundColor: Colors.black, appBar: removeSafeArea ? null : AppBar( backgroundColor: Colors.black, - // showStatusBarBackgroundColor ? null : Colors.black, toolbarHeight: 0, - // systemOverlayStyle: SystemUiOverlayStyle( - // statusBarIconBrightness: - // Theme.of(context).brightness == Brightness.dark || - // !showStatusBarBackgroundColor - // ? Brightness.light - // : Brightness.dark, - // systemNavigationBarColor: Colors.transparent, - // ), ), body: Container( color: Theme.of(context).colorScheme.surface, @@ -954,21 +932,11 @@ class _VideoDetailPageState extends State Scaffold( resizeToAvoidBottomInset: false, key: videoDetailController.scaffoldKey, - // backgroundColor: Colors.black, appBar: removeSafeArea ? null : AppBar( backgroundColor: Colors.black, - // showStatusBarBackgroundColor ? null : Colors.black, toolbarHeight: 0, - // systemOverlayStyle: SystemUiOverlayStyle( - // statusBarIconBrightness: - // Theme.of(context).brightness == Brightness.dark || - // !showStatusBarBackgroundColor - // ? Brightness.light - // : Brightness.dark, - // systemNavigationBarColor: Colors.transparent, - // ), ), body: Container( color: Theme.of(context).colorScheme.surface, @@ -1394,6 +1362,8 @@ class _VideoDetailPageState extends State Widget videoPlayer(double videoWidth, double videoHeight) => Stack( children: [ + Positioned.fill(child: ColoredBox(color: Colors.black)), + if (isShowing) plPlayer, /// 关闭自动播放时 手动播放 diff --git a/lib/pages/video/detail/view_v.dart b/lib/pages/video/detail/view_v.dart index 182baa414..441c6bf38 100644 --- a/lib/pages/video/detail/view_v.dart +++ b/lib/pages/video/detail/view_v.dart @@ -631,7 +631,6 @@ class _VideoDetailPageVState extends State child: Scaffold( resizeToAvoidBottomInset: false, key: videoDetailController.scaffoldKey, - // backgroundColor: Colors.black, appBar: removeSafeArea ? null : PreferredSize( @@ -754,9 +753,7 @@ class _VideoDetailPageVState extends State showStatusBar(); } } - return Container( - color: Colors.black, - // showStatusBarBackgroundColor ? null : Colors.black, + return SizedBox( height: MediaQuery.of(context).orientation == Orientation.landscape || isFullScreen @@ -1302,21 +1299,11 @@ class _VideoDetailPageVState extends State Scaffold( resizeToAvoidBottomInset: false, key: videoDetailController.scaffoldKey, - // backgroundColor: Colors.black, appBar: removeSafeArea ? null : AppBar( backgroundColor: Colors.black, - // showStatusBarBackgroundColor ? null : Colors.black, toolbarHeight: 0, - // systemOverlayStyle: SystemUiOverlayStyle( - // statusBarIconBrightness: - // Theme.of(context).brightness == Brightness.dark || - // !showStatusBarBackgroundColor - // ? Brightness.light - // : Brightness.dark, - // systemNavigationBarColor: Colors.transparent, - // ), ), body: Container( color: Theme.of(context).colorScheme.surface, @@ -1335,21 +1322,11 @@ class _VideoDetailPageVState extends State Scaffold( resizeToAvoidBottomInset: false, key: videoDetailController.scaffoldKey, - // backgroundColor: Colors.black, appBar: removeSafeArea ? null : AppBar( backgroundColor: Colors.black, - // showStatusBarBackgroundColor ? null : Colors.black, toolbarHeight: 0, - // systemOverlayStyle: SystemUiOverlayStyle( - // statusBarIconBrightness: - // Theme.of(context).brightness == Brightness.dark || - // !showStatusBarBackgroundColor - // ? Brightness.light - // : Brightness.dark, - // systemNavigationBarColor: Colors.transparent, - // ), ), body: Container( color: Theme.of(context).colorScheme.surface, @@ -1781,6 +1758,8 @@ class _VideoDetailPageVState extends State Widget videoPlayer(double videoWidth, double videoHeight) { return Stack( children: [ + Positioned.fill(child: ColoredBox(color: Colors.black)), + if (isShowing) plPlayer, if (!videoDetailController.autoPlay.value) ...[