From 312ce6e63945e6ccbb13d0266abd630b655efc10 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Fri, 28 Feb 2025 21:54:53 +0800 Subject: [PATCH] opt: pages Signed-off-by: bggRGjQaUbCoE --- lib/pages/dynamics/detail/view.dart | 1 + lib/pages/html/view.dart | 1 + lib/pages/video/detail/view.dart | 133 ++++++++++++++-------------- lib/pages/video/detail/view_v.dart | 22 ++--- 4 files changed, 79 insertions(+), 78 deletions(-) diff --git a/lib/pages/dynamics/detail/view.dart b/lib/pages/dynamics/detail/view.dart index 9b96116f..38aec795 100644 --- a/lib/pages/dynamics/detail/view.dart +++ b/lib/pages/dynamics/detail/view.dart @@ -406,6 +406,7 @@ class _DynamicDetailPageState extends State flex: _ratio[1].toInt(), child: Scaffold( key: _key, + backgroundColor: Colors.transparent, body: refreshIndicator( onRefresh: () async { await _dynamicDetailController.onRefresh(); diff --git a/lib/pages/html/view.dart b/lib/pages/html/view.dart index 70630bfc..11cabd5f 100644 --- a/lib/pages/html/view.dart +++ b/lib/pages/html/view.dart @@ -399,6 +399,7 @@ class _HtmlRenderPageState extends State flex: _ratio[1].toInt(), child: Scaffold( key: _key, + backgroundColor: Colors.transparent, body: CustomScrollView( controller: _htmlRenderCtr.scrollController, slivers: [ diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index db77a8a8..e876c80a 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -618,6 +618,7 @@ class _VideoDetailPageState extends State child: Scaffold( key: videoDetailController.childKey, resizeToAvoidBottomInset: false, + backgroundColor: Colors.transparent, body: Column( children: [ buildTabbar( @@ -670,6 +671,7 @@ class _VideoDetailPageState extends State child: Scaffold( key: videoDetailController.childKey, resizeToAvoidBottomInset: false, + backgroundColor: Colors.transparent, body: Column( children: [ buildTabbar(showReply: videoDetailController.showReply), @@ -714,6 +716,7 @@ class _VideoDetailPageState extends State child: Scaffold( key: videoDetailController.childKey, resizeToAvoidBottomInset: false, + backgroundColor: Colors.transparent, body: Column( children: [ buildTabbar( @@ -766,6 +769,7 @@ class _VideoDetailPageState extends State child: Scaffold( key: videoDetailController.childKey, resizeToAvoidBottomInset: false, + backgroundColor: Colors.transparent, body: Column( children: [ buildTabbar( @@ -872,6 +876,7 @@ class _VideoDetailPageState extends State child: Scaffold( key: videoDetailController.childKey, resizeToAvoidBottomInset: false, + backgroundColor: Colors.transparent, body: Column( children: [ buildTabbar( @@ -888,16 +893,13 @@ class _VideoDetailPageState extends State if (videoDetailController.videoType == SearchType.video && videoDetailController.showRelatedVideo) - Material( - color: Colors.transparent, - child: CustomScrollView( - controller: _introController, - slivers: [ - RelatedVideoPanel( - key: relatedVideoPanelKey, - heroTag: heroTag), - ], - ), + CustomScrollView( + controller: _introController, + slivers: [ + RelatedVideoPanel( + key: relatedVideoPanelKey, + heroTag: heroTag), + ], ), if (videoDetailController.showReply) videoReplyPanel, @@ -1505,67 +1507,62 @@ class _VideoDetailPageState extends State ); Widget videoIntro([bool needRelated = true]) { - Widget introPanel() => Material( - color: Colors.transparent, - child: CustomScrollView( - key: const PageStorageKey('简介'), - controller: needRelated ? _introController : null, - slivers: [ - if (videoDetailController.videoType == SearchType.video) ...[ - VideoIntroPanel( + Widget introPanel() => CustomScrollView( + key: const PageStorageKey('简介'), + controller: needRelated ? _introController : null, + slivers: [ + if (videoDetailController.videoType == SearchType.video) ...[ + VideoIntroPanel( + heroTag: heroTag, + showAiBottomSheet: showAiBottomSheet, + showIntroDetail: showIntroDetail, + showEpisodes: showEpisodes, + onShowMemberPage: onShowMemberPage, + ), + if (needRelated && videoDetailController.showRelatedVideo) ...[ + SliverToBoxAdapter( + child: Padding( + padding: const EdgeInsets.only(top: StyleString.safeSpace), + child: Divider( + height: 1, + indent: 12, + endIndent: 12, + color: Theme.of(context) + .colorScheme + .outline + .withOpacity(0.08), + ), + ), + ), + RelatedVideoPanel(key: relatedVideoPanelKey, heroTag: heroTag), + ] else + SliverToBoxAdapter( + child: SizedBox( + height: MediaQuery.paddingOf(context).bottom + + StyleString.safeSpace, + ), + ), + ] else if (videoDetailController.videoType == + SearchType.media_bangumi) + Obx( + () => BangumiIntroPanel( heroTag: heroTag, - showAiBottomSheet: showAiBottomSheet, - showIntroDetail: showIntroDetail, + cid: videoDetailController.cid.value, showEpisodes: showEpisodes, - onShowMemberPage: onShowMemberPage, + showIntroDetail: showIntroDetail, ), - if (needRelated && videoDetailController.showRelatedVideo) ...[ - SliverToBoxAdapter( - child: Padding( - padding: - const EdgeInsets.only(top: StyleString.safeSpace), - child: Divider( - height: 1, - indent: 12, - endIndent: 12, - color: Theme.of(context) - .colorScheme - .outline - .withOpacity(0.08), - ), - ), - ), - RelatedVideoPanel( - key: relatedVideoPanelKey, heroTag: heroTag), - ] else - SliverToBoxAdapter( - child: SizedBox( - height: MediaQuery.paddingOf(context).bottom + - StyleString.safeSpace, - ), - ), - ] else if (videoDetailController.videoType == - SearchType.media_bangumi) - Obx( - () => BangumiIntroPanel( - heroTag: heroTag, - cid: videoDetailController.cid.value, - showEpisodes: showEpisodes, - showIntroDetail: showIntroDetail, - ), - ), - SliverToBoxAdapter( - child: SizedBox( - height: MediaQuery.paddingOf(context).bottom + - (videoDetailController.isPlayAll && - MediaQuery.orientationOf(context) == - Orientation.landscape - ? 75 - : 0), - ), - ) - ], - ), + ), + SliverToBoxAdapter( + child: SizedBox( + height: MediaQuery.paddingOf(context).bottom + + (videoDetailController.isPlayAll && + MediaQuery.orientationOf(context) == + Orientation.landscape + ? 75 + : 0), + ), + ) + ], ); if (videoDetailController.isPlayAll) { return Stack( diff --git a/lib/pages/video/detail/view_v.dart b/lib/pages/video/detail/view_v.dart index 43a7ea10..e4261a2e 100644 --- a/lib/pages/video/detail/view_v.dart +++ b/lib/pages/video/detail/view_v.dart @@ -908,6 +908,7 @@ class _VideoDetailPageVState extends State body: Scaffold( key: videoDetailController.childKey, resizeToAvoidBottomInset: false, + backgroundColor: Colors.transparent, body: Column( children: [ buildTabbar( @@ -961,6 +962,7 @@ class _VideoDetailPageVState extends State child: Scaffold( key: videoDetailController.childKey, resizeToAvoidBottomInset: false, + backgroundColor: Colors.transparent, body: Column( children: [ buildTabbar(showReply: videoDetailController.showReply), @@ -1005,6 +1007,7 @@ class _VideoDetailPageVState extends State child: Scaffold( key: videoDetailController.childKey, resizeToAvoidBottomInset: false, + backgroundColor: Colors.transparent, body: Column( children: [ buildTabbar( @@ -1057,6 +1060,7 @@ class _VideoDetailPageVState extends State child: Scaffold( key: videoDetailController.childKey, resizeToAvoidBottomInset: false, + backgroundColor: Colors.transparent, body: Column( children: [ buildTabbar( @@ -1163,6 +1167,7 @@ class _VideoDetailPageVState extends State child: Scaffold( key: videoDetailController.childKey, resizeToAvoidBottomInset: false, + backgroundColor: Colors.transparent, body: Column( children: [ buildTabbar( @@ -1179,16 +1184,13 @@ class _VideoDetailPageVState extends State if (videoDetailController.videoType == SearchType.video && videoDetailController.showRelatedVideo) - Material( - color: Colors.transparent, - child: CustomScrollView( - controller: _introController, - slivers: [ - RelatedVideoPanel( - key: relatedVideoPanelKey, - heroTag: heroTag), - ], - ), + CustomScrollView( + controller: _introController, + slivers: [ + RelatedVideoPanel( + key: relatedVideoPanelKey, + heroTag: heroTag), + ], ), if (videoDetailController.showReply) videoReplyPanel(),