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