Revert "opt: video page"

This reverts commit 82030b8d06.
This commit is contained in:
bggRGjQaUbCoE
2025-02-28 17:30:50 +08:00
parent c37a631df2
commit 5c029c8f64
2 changed files with 477 additions and 431 deletions

View File

@@ -530,7 +530,18 @@ class _VideoDetailPageState extends State<VideoDetailPage>
} }
} }
Widget get childWhenDisabled => Scaffold( Widget get childWhenDisabled => SafeArea(
top: !removeSafeArea &&
MediaQuery.of(context).orientation == Orientation.portrait &&
isFullScreen,
bottom: !removeSafeArea &&
MediaQuery.of(context).orientation == Orientation.portrait &&
isFullScreen,
left: false, //!isFullScreen,
right: false, //!isFullScreen,
child: Stack(
children: [
Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
key: videoDetailController.scaffoldKey, key: videoDetailController.scaffoldKey,
// backgroundColor: Colors.black, // backgroundColor: Colors.black,
@@ -538,7 +549,16 @@ class _VideoDetailPageState extends State<VideoDetailPage>
? null ? null
: AppBar( : AppBar(
backgroundColor: Colors.black, backgroundColor: Colors.black,
// showStatusBarBackgroundColor ? null : Colors.black,
toolbarHeight: 0, toolbarHeight: 0,
// systemOverlayStyle: SystemUiOverlayStyle(
// statusBarIconBrightness:
// Theme.of(context).brightness == Brightness.dark ||
// !showStatusBarBackgroundColor
// ? Brightness.light
// : Brightness.dark,
// systemNavigationBarColor: Colors.transparent,
// ),
), ),
body: Column( body: Column(
children: [ children: [
@@ -598,7 +618,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
child: Scaffold( child: Scaffold(
key: videoDetailController.childKey, key: videoDetailController.childKey,
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
backgroundColor: Colors.transparent,
body: Column( body: Column(
children: [ children: [
buildTabbar( buildTabbar(
@@ -609,7 +628,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
controller: videoDetailController.tabCtr, controller: videoDetailController.tabCtr,
children: [ children: [
videoIntro(), videoIntro(),
if (videoDetailController.showReply) videoReplyPanel, if (videoDetailController.showReply)
videoReplyPanel,
if (_shouldShowSeasonPanel) seasonPanel, if (_shouldShowSeasonPanel) seasonPanel,
], ],
), ),
@@ -620,6 +640,9 @@ class _VideoDetailPageState extends State<VideoDetailPage>
), ),
], ],
), ),
),
],
),
); );
Widget get childWhenDisabledAlmostSquareInner => Obx( Widget get childWhenDisabledAlmostSquareInner => Obx(
@@ -647,7 +670,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
child: Scaffold( child: Scaffold(
key: videoDetailController.childKey, key: videoDetailController.childKey,
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
backgroundColor: Colors.transparent,
body: Column( body: Column(
children: [ children: [
buildTabbar(showReply: videoDetailController.showReply), buildTabbar(showReply: videoDetailController.showReply),
@@ -692,7 +714,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
child: Scaffold( child: Scaffold(
key: videoDetailController.childKey, key: videoDetailController.childKey,
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
backgroundColor: Colors.transparent,
body: Column( body: Column(
children: [ children: [
buildTabbar( buildTabbar(
@@ -745,7 +766,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
child: Scaffold( child: Scaffold(
key: videoDetailController.childKey, key: videoDetailController.childKey,
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
backgroundColor: Colors.transparent,
body: Column( body: Column(
children: [ children: [
buildTabbar( buildTabbar(
@@ -852,7 +872,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
child: Scaffold( child: Scaffold(
key: videoDetailController.childKey, key: videoDetailController.childKey,
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
backgroundColor: Colors.transparent,
body: Column( body: Column(
children: [ children: [
buildTabbar( buildTabbar(
@@ -869,7 +888,9 @@ class _VideoDetailPageState extends State<VideoDetailPage>
if (videoDetailController.videoType == if (videoDetailController.videoType ==
SearchType.video && SearchType.video &&
videoDetailController.showRelatedVideo) videoDetailController.showRelatedVideo)
CustomScrollView( Material(
color: Colors.transparent,
child: CustomScrollView(
controller: _introController, controller: _introController,
slivers: [ slivers: [
RelatedVideoPanel( RelatedVideoPanel(
@@ -877,6 +898,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
heroTag: heroTag), heroTag: heroTag),
], ],
), ),
),
if (videoDetailController.showReply) if (videoDetailController.showReply)
videoReplyPanel, videoReplyPanel,
if (_shouldShowSeasonPanel) seasonPanel, if (_shouldShowSeasonPanel) seasonPanel,
@@ -1483,7 +1505,9 @@ class _VideoDetailPageState extends State<VideoDetailPage>
); );
Widget videoIntro([bool needRelated = true]) { Widget videoIntro([bool needRelated = true]) {
Widget introPanel() => CustomScrollView( Widget introPanel() => Material(
color: Colors.transparent,
child: CustomScrollView(
key: const PageStorageKey<String>('简介'), key: const PageStorageKey<String>('简介'),
controller: needRelated ? _introController : null, controller: needRelated ? _introController : null,
slivers: [ slivers: [
@@ -1498,7 +1522,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
if (needRelated && videoDetailController.showRelatedVideo) ...[ if (needRelated && videoDetailController.showRelatedVideo) ...[
SliverToBoxAdapter( SliverToBoxAdapter(
child: Padding( child: Padding(
padding: const EdgeInsets.only(top: StyleString.safeSpace), padding:
const EdgeInsets.only(top: StyleString.safeSpace),
child: Divider( child: Divider(
height: 1, height: 1,
indent: 12, indent: 12,
@@ -1510,7 +1535,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
), ),
), ),
), ),
RelatedVideoPanel(key: relatedVideoPanelKey, heroTag: heroTag), RelatedVideoPanel(
key: relatedVideoPanelKey, heroTag: heroTag),
] else ] else
SliverToBoxAdapter( SliverToBoxAdapter(
child: SizedBox( child: SizedBox(
@@ -1539,6 +1565,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
), ),
) )
], ],
),
); );
if (videoDetailController.isPlayAll) { if (videoDetailController.isPlayAll) {
return Stack( return Stack(

View File

@@ -613,13 +613,25 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
} }
} }
Widget get childWhenDisabled => Scaffold( Widget get childWhenDisabled => SafeArea(
top: !removeSafeArea &&
MediaQuery.of(context).orientation == Orientation.portrait &&
isFullScreen,
bottom: !removeSafeArea &&
MediaQuery.of(context).orientation == Orientation.portrait &&
isFullScreen,
left: false, //!isFullScreen,
right: false, //!isFullScreen,
child: Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
key: videoDetailController.scaffoldKey, key: videoDetailController.scaffoldKey,
// backgroundColor: Colors.black, // backgroundColor: Colors.black,
appBar: PreferredSize( appBar: removeSafeArea
? null
: PreferredSize(
preferredSize: Size.fromHeight(0), preferredSize: Size.fromHeight(0),
child: Stack( child: Obx(
() => Stack(
children: [ children: [
AppBar( AppBar(
backgroundColor: Colors.black, backgroundColor: Colors.black,
@@ -632,12 +644,14 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
backgroundColor: Theme.of(context) backgroundColor: Theme.of(context)
.colorScheme .colorScheme
.surface .surface
.withOpacity(videoDetailController.scrollRatio.value), .withOpacity(
videoDetailController.scrollRatio.value),
toolbarHeight: 0, toolbarHeight: 0,
), ),
], ],
), ),
), ),
),
body: ExtendedNestedScrollView( body: ExtendedNestedScrollView(
key: videoDetailController.scrollKey, key: videoDetailController.scrollKey,
physics: const NeverScrollableScrollPhysics( physics: const NeverScrollableScrollPhysics(
@@ -646,8 +660,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
controller: videoDetailController.scrollCtr, controller: videoDetailController.scrollCtr,
onlyOneScrollInBody: true, onlyOneScrollInBody: true,
pinnedHeaderSliverHeightBuilder: () { pinnedHeaderSliverHeightBuilder: () {
double height = double height = isFullScreen ||
isFullScreen || context.orientation == Orientation.landscape context.orientation == Orientation.landscape
? MediaQuery.sizeOf(context).height ? MediaQuery.sizeOf(context).height
: videoDetailController.isExpanding || : videoDetailController.isExpanding ||
videoDetailController.isCollapsing videoDetailController.isCollapsing
@@ -673,13 +687,14 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
} }
return height; return height;
}, },
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return [ return [
SliverAppBar( SliverAppBar(
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
pinned: true, pinned: true,
expandedHeight: expandedHeight: isFullScreen ||
isFullScreen || context.orientation == Orientation.landscape context.orientation == Orientation.landscape
? MediaQuery.sizeOf(context).height ? MediaQuery.sizeOf(context).height
: videoDetailController.isExpanding || : videoDetailController.isExpanding ||
videoDetailController.isCollapsing videoDetailController.isCollapsing
@@ -756,7 +771,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
Obx( Obx(
() { () {
Widget toolbar() => Opacity( Widget toolbar() => Opacity(
opacity: videoDetailController.scrollRatio.value, opacity:
videoDetailController.scrollRatio.value,
child: Container( child: Container(
color: Theme.of(context).colorScheme.surface, color: Theme.of(context).colorScheme.surface,
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
@@ -797,8 +813,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
.onSurface, .onSurface,
), ),
onPressed: () { onPressed: () {
Get.until( Get.until((route) =>
(route) => route.isFirst); route.isFirst);
}, },
), ),
), ),
@@ -833,9 +849,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
); );
return videoDetailController.scrollRatio.value == 0 || return videoDetailController.scrollRatio.value == 0 ||
videoDetailController.scrollCtr.offset == 0 || videoDetailController.scrollCtr.offset == 0 ||
context.orientation != Orientation.portrait || context.orientation != Orientation.portrait
plPlayerController?.playerStatus.status.value ==
PlayerStatus.playing
? const SizedBox.shrink() ? const SizedBox.shrink()
: Positioned.fill( : Positioned.fill(
bottom: -2, bottom: -2,
@@ -854,7 +868,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
videoDetailController.queryVideoUrl(); videoDetailController.queryVideoUrl();
return; return;
} }
videoDetailController.scrollRatio.value = 0; videoDetailController.scrollRatio.value =
0;
if (plPlayerController == null || if (plPlayerController == null ||
videoDetailController.playedTime == videoDetailController.playedTime ==
null) { null) {
@@ -916,6 +931,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
), ),
), ),
), ),
),
); );
Widget get childWhenDisabledAlmostSquareInner => Obx( Widget get childWhenDisabledAlmostSquareInner => Obx(
@@ -1161,7 +1177,9 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
if (videoDetailController.videoType == if (videoDetailController.videoType ==
SearchType.video && SearchType.video &&
videoDetailController.showRelatedVideo) videoDetailController.showRelatedVideo)
CustomScrollView( Material(
color: Colors.transparent,
child: CustomScrollView(
controller: _introController, controller: _introController,
slivers: [ slivers: [
RelatedVideoPanel( RelatedVideoPanel(
@@ -1169,6 +1187,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
heroTag: heroTag), heroTag: heroTag),
], ],
), ),
),
if (videoDetailController.showReply) if (videoDetailController.showReply)
videoReplyPanel(), videoReplyPanel(),
if (_shouldShowSeasonPanel) seasonPanel, if (_shouldShowSeasonPanel) seasonPanel,