mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: video page
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -530,18 +530,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
}
|
||||
}
|
||||
|
||||
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(
|
||||
Widget get childWhenDisabled => Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
key: videoDetailController.scaffoldKey,
|
||||
// backgroundColor: Colors.black,
|
||||
@@ -549,16 +538,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
? 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: [
|
||||
@@ -618,6 +598,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
child: Scaffold(
|
||||
key: videoDetailController.childKey,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Column(
|
||||
children: [
|
||||
buildTabbar(
|
||||
@@ -628,8 +609,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
controller: videoDetailController.tabCtr,
|
||||
children: [
|
||||
videoIntro(),
|
||||
if (videoDetailController.showReply)
|
||||
videoReplyPanel,
|
||||
if (videoDetailController.showReply) videoReplyPanel,
|
||||
if (_shouldShowSeasonPanel) seasonPanel,
|
||||
],
|
||||
),
|
||||
@@ -640,9 +620,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Widget get childWhenDisabledAlmostSquareInner => Obx(
|
||||
@@ -670,6 +647,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
child: Scaffold(
|
||||
key: videoDetailController.childKey,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Column(
|
||||
children: [
|
||||
buildTabbar(showReply: videoDetailController.showReply),
|
||||
@@ -714,6 +692,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
child: Scaffold(
|
||||
key: videoDetailController.childKey,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Column(
|
||||
children: [
|
||||
buildTabbar(
|
||||
@@ -766,6 +745,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
child: Scaffold(
|
||||
key: videoDetailController.childKey,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Column(
|
||||
children: [
|
||||
buildTabbar(
|
||||
@@ -872,6 +852,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
child: Scaffold(
|
||||
key: videoDetailController.childKey,
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Column(
|
||||
children: [
|
||||
buildTabbar(
|
||||
@@ -888,9 +869,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
if (videoDetailController.videoType ==
|
||||
SearchType.video &&
|
||||
videoDetailController.showRelatedVideo)
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
child: CustomScrollView(
|
||||
CustomScrollView(
|
||||
controller: _introController,
|
||||
slivers: [
|
||||
RelatedVideoPanel(
|
||||
@@ -898,7 +877,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
heroTag: heroTag),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (videoDetailController.showReply)
|
||||
videoReplyPanel,
|
||||
if (_shouldShowSeasonPanel) seasonPanel,
|
||||
@@ -1505,9 +1483,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
);
|
||||
|
||||
Widget videoIntro([bool needRelated = true]) {
|
||||
Widget introPanel() => Material(
|
||||
color: Colors.transparent,
|
||||
child: CustomScrollView(
|
||||
Widget introPanel() => CustomScrollView(
|
||||
key: const PageStorageKey<String>('简介'),
|
||||
controller: needRelated ? _introController : null,
|
||||
slivers: [
|
||||
@@ -1522,8 +1498,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
if (needRelated && videoDetailController.showRelatedVideo) ...[
|
||||
SliverToBoxAdapter(
|
||||
child: Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(top: StyleString.safeSpace),
|
||||
padding: const EdgeInsets.only(top: StyleString.safeSpace),
|
||||
child: Divider(
|
||||
height: 1,
|
||||
indent: 12,
|
||||
@@ -1535,8 +1510,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
),
|
||||
),
|
||||
),
|
||||
RelatedVideoPanel(
|
||||
key: relatedVideoPanelKey, heroTag: heroTag),
|
||||
RelatedVideoPanel(key: relatedVideoPanelKey, heroTag: heroTag),
|
||||
] else
|
||||
SliverToBoxAdapter(
|
||||
child: SizedBox(
|
||||
@@ -1565,7 +1539,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
if (videoDetailController.isPlayAll) {
|
||||
return Stack(
|
||||
|
||||
@@ -613,25 +613,13 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
}
|
||||
}
|
||||
|
||||
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(
|
||||
Widget get childWhenDisabled => Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
key: videoDetailController.scaffoldKey,
|
||||
// backgroundColor: Colors.black,
|
||||
appBar: removeSafeArea
|
||||
? null
|
||||
: PreferredSize(
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(0),
|
||||
child: Obx(
|
||||
() => Stack(
|
||||
child: Stack(
|
||||
children: [
|
||||
AppBar(
|
||||
backgroundColor: Colors.black,
|
||||
@@ -644,14 +632,12 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
backgroundColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.surface
|
||||
.withOpacity(
|
||||
videoDetailController.scrollRatio.value),
|
||||
.withOpacity(videoDetailController.scrollRatio.value),
|
||||
toolbarHeight: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
body: ExtendedNestedScrollView(
|
||||
key: videoDetailController.scrollKey,
|
||||
physics: const NeverScrollableScrollPhysics(
|
||||
@@ -660,8 +646,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
controller: videoDetailController.scrollCtr,
|
||||
onlyOneScrollInBody: true,
|
||||
pinnedHeaderSliverHeightBuilder: () {
|
||||
double height = isFullScreen ||
|
||||
context.orientation == Orientation.landscape
|
||||
double height =
|
||||
isFullScreen || context.orientation == Orientation.landscape
|
||||
? MediaQuery.sizeOf(context).height
|
||||
: videoDetailController.isExpanding ||
|
||||
videoDetailController.isCollapsing
|
||||
@@ -687,14 +673,13 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
}
|
||||
return height;
|
||||
},
|
||||
headerSliverBuilder:
|
||||
(BuildContext context, bool innerBoxIsScrolled) {
|
||||
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
|
||||
return [
|
||||
SliverAppBar(
|
||||
automaticallyImplyLeading: false,
|
||||
pinned: true,
|
||||
expandedHeight: isFullScreen ||
|
||||
context.orientation == Orientation.landscape
|
||||
expandedHeight:
|
||||
isFullScreen || context.orientation == Orientation.landscape
|
||||
? MediaQuery.sizeOf(context).height
|
||||
: videoDetailController.isExpanding ||
|
||||
videoDetailController.isCollapsing
|
||||
@@ -771,8 +756,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
Obx(
|
||||
() {
|
||||
Widget toolbar() => Opacity(
|
||||
opacity:
|
||||
videoDetailController.scrollRatio.value,
|
||||
opacity: videoDetailController.scrollRatio.value,
|
||||
child: Container(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
alignment: Alignment.topCenter,
|
||||
@@ -813,8 +797,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
.onSurface,
|
||||
),
|
||||
onPressed: () {
|
||||
Get.until((route) =>
|
||||
route.isFirst);
|
||||
Get.until(
|
||||
(route) => route.isFirst);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -849,7 +833,9 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
);
|
||||
return videoDetailController.scrollRatio.value == 0 ||
|
||||
videoDetailController.scrollCtr.offset == 0 ||
|
||||
context.orientation != Orientation.portrait
|
||||
context.orientation != Orientation.portrait ||
|
||||
plPlayerController?.playerStatus.status.value ==
|
||||
PlayerStatus.playing
|
||||
? const SizedBox.shrink()
|
||||
: Positioned.fill(
|
||||
bottom: -2,
|
||||
@@ -868,8 +854,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
videoDetailController.queryVideoUrl();
|
||||
return;
|
||||
}
|
||||
videoDetailController.scrollRatio.value =
|
||||
0;
|
||||
videoDetailController.scrollRatio.value = 0;
|
||||
if (plPlayerController == null ||
|
||||
videoDetailController.playedTime ==
|
||||
null) {
|
||||
@@ -931,7 +916,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Widget get childWhenDisabledAlmostSquareInner => Obx(
|
||||
@@ -1177,9 +1161,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
if (videoDetailController.videoType ==
|
||||
SearchType.video &&
|
||||
videoDetailController.showRelatedVideo)
|
||||
Material(
|
||||
color: Colors.transparent,
|
||||
child: CustomScrollView(
|
||||
CustomScrollView(
|
||||
controller: _introController,
|
||||
slivers: [
|
||||
RelatedVideoPanel(
|
||||
@@ -1187,7 +1169,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
heroTag: heroTag),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (videoDetailController.showReply)
|
||||
videoReplyPanel(),
|
||||
if (_shouldShowSeasonPanel) seasonPanel,
|
||||
|
||||
Reference in New Issue
Block a user