mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -110,6 +110,13 @@ class AudioController extends GetxController
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _updateCurrItem(DetailItem item) {
|
||||||
|
audioItem.value = item;
|
||||||
|
hasLike.value = item.stat.hasLike_7;
|
||||||
|
coinNum.value = item.stat.hasCoin_8 ? 2 : 0;
|
||||||
|
hasFav.value = item.stat.hasFav;
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> _queryPlayList({
|
Future<void> _queryPlayList({
|
||||||
bool isInit = false,
|
bool isInit = false,
|
||||||
bool isLoadPrev = false,
|
bool isLoadPrev = false,
|
||||||
@@ -136,11 +143,7 @@ class AudioController extends GetxController
|
|||||||
final index = data.list.indexWhere((e) => e.item.oid == oid);
|
final index = data.list.indexWhere((e) => e.item.oid == oid);
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
this.index = index;
|
this.index = index;
|
||||||
final item = data.list[index];
|
_updateCurrItem(data.list[index]);
|
||||||
audioItem.value = item;
|
|
||||||
hasLike.value = item.stat.hasLike_7;
|
|
||||||
coinNum.value = item.stat.hasCoin_8 ? 2 : 0;
|
|
||||||
hasFav.value = item.stat.hasFav;
|
|
||||||
playlist = data.list;
|
playlist = data.list;
|
||||||
}
|
}
|
||||||
} else if (isLoadPrev) {
|
} else if (isLoadPrev) {
|
||||||
@@ -356,6 +359,7 @@ class AudioController extends GetxController
|
|||||||
hasLike.value = true;
|
hasLike.value = true;
|
||||||
}
|
}
|
||||||
coinNum.value += coin;
|
coinNum.value += coin;
|
||||||
|
GlobalData().afterCoin(coin);
|
||||||
} else {
|
} else {
|
||||||
res.toast();
|
res.toast();
|
||||||
}
|
}
|
||||||
@@ -540,7 +544,7 @@ class AudioController extends GetxController
|
|||||||
itemType = item.itemType;
|
itemType = item.itemType;
|
||||||
_queryPlayUrl().then((res) {
|
_queryPlayUrl().then((res) {
|
||||||
if (res) {
|
if (res) {
|
||||||
this.audioItem.value = audioItem;
|
_updateCurrItem(audioItem);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -456,6 +456,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
ModalRoute.of(context)! as PageRoute,
|
ModalRoute.of(context)! as PageRoute,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
padding = MediaQuery.viewPaddingOf(context);
|
||||||
|
|
||||||
final size = MediaQuery.sizeOf(context);
|
final size = MediaQuery.sizeOf(context);
|
||||||
maxWidth = size.width;
|
maxWidth = size.width;
|
||||||
maxHeight = size.height;
|
maxHeight = size.height;
|
||||||
@@ -548,325 +550,330 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
return Obx(
|
return Obx(
|
||||||
() {
|
() {
|
||||||
final isFullScreen = this.isFullScreen;
|
final isFullScreen = this.isFullScreen;
|
||||||
return Scaffold(
|
return Padding(
|
||||||
resizeToAvoidBottomInset: false,
|
padding: EdgeInsets.only(
|
||||||
appBar: isFullScreen
|
top: isFullScreen && isPortrait ? padding.top : 0,
|
||||||
? null
|
),
|
||||||
: PreferredSize(
|
child: Scaffold(
|
||||||
preferredSize: const Size.fromHeight(0),
|
resizeToAvoidBottomInset: false,
|
||||||
child: Obx(
|
appBar: isFullScreen
|
||||||
() {
|
? null
|
||||||
final scrollRatio =
|
: PreferredSize(
|
||||||
videoDetailController.scrollRatio.value;
|
preferredSize: const Size.fromHeight(0),
|
||||||
bool shouldShow =
|
child: Obx(
|
||||||
scrollRatio != 0 &&
|
() {
|
||||||
videoDetailController.scrollCtr.offset != 0 &&
|
final scrollRatio =
|
||||||
isPortrait;
|
videoDetailController.scrollRatio.value;
|
||||||
return Stack(
|
bool shouldShow =
|
||||||
clipBehavior: Clip.none,
|
scrollRatio != 0 &&
|
||||||
children: [
|
videoDetailController.scrollCtr.offset != 0 &&
|
||||||
AppBar(
|
isPortrait;
|
||||||
backgroundColor: Colors.black,
|
return Stack(
|
||||||
toolbarHeight: 0,
|
clipBehavior: Clip.none,
|
||||||
systemOverlayStyle: Platform.isAndroid
|
children: [
|
||||||
? shouldShow
|
|
||||||
? null
|
|
||||||
: SystemUiOverlayStyle(
|
|
||||||
statusBarIconBrightness:
|
|
||||||
Brightness.light,
|
|
||||||
systemNavigationBarIconBrightness:
|
|
||||||
themeData.brightness.reverse,
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
),
|
|
||||||
if (shouldShow)
|
|
||||||
AppBar(
|
AppBar(
|
||||||
backgroundColor: themeData.colorScheme.surface
|
backgroundColor: Colors.black,
|
||||||
.withValues(alpha: scrollRatio),
|
|
||||||
toolbarHeight: 0,
|
toolbarHeight: 0,
|
||||||
systemOverlayStyle: Platform.isAndroid
|
systemOverlayStyle: Platform.isAndroid
|
||||||
? SystemUiOverlayStyle(
|
? shouldShow
|
||||||
statusBarIconBrightness:
|
? null
|
||||||
themeData.brightness.reverse,
|
: SystemUiOverlayStyle(
|
||||||
systemNavigationBarIconBrightness:
|
statusBarIconBrightness:
|
||||||
themeData.brightness.reverse,
|
Brightness.light,
|
||||||
)
|
systemNavigationBarIconBrightness:
|
||||||
|
themeData.brightness.reverse,
|
||||||
|
)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
],
|
if (shouldShow)
|
||||||
);
|
AppBar(
|
||||||
},
|
backgroundColor: themeData.colorScheme.surface
|
||||||
|
.withValues(alpha: scrollRatio),
|
||||||
|
toolbarHeight: 0,
|
||||||
|
systemOverlayStyle: Platform.isAndroid
|
||||||
|
? SystemUiOverlayStyle(
|
||||||
|
statusBarIconBrightness:
|
||||||
|
themeData.brightness.reverse,
|
||||||
|
systemNavigationBarIconBrightness:
|
||||||
|
themeData.brightness.reverse,
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
body: ExtendedNestedScrollView(
|
||||||
body: ExtendedNestedScrollView(
|
key: videoDetailController.scrollKey,
|
||||||
key: videoDetailController.scrollKey,
|
controller: videoDetailController.scrollCtr,
|
||||||
controller: videoDetailController.scrollCtr,
|
onlyOneScrollInBody: true,
|
||||||
onlyOneScrollInBody: true,
|
pinnedHeaderSliverHeightBuilder: () {
|
||||||
pinnedHeaderSliverHeightBuilder: () {
|
double pinnedHeight = this.isFullScreen || !isPortrait
|
||||||
double pinnedHeight = this.isFullScreen || !isPortrait
|
? maxHeight - (isPortrait ? padding.top : 0)
|
||||||
? maxHeight
|
: videoDetailController.isExpanding ||
|
||||||
: videoDetailController.isExpanding ||
|
videoDetailController.isCollapsing
|
||||||
videoDetailController.isCollapsing
|
? animHeight
|
||||||
? animHeight
|
: videoDetailController.isCollapsing ||
|
||||||
: videoDetailController.isCollapsing ||
|
plPlayerController?.playerStatus.status.value ==
|
||||||
plPlayerController?.playerStatus.status.value ==
|
PlayerStatus.playing
|
||||||
PlayerStatus.playing
|
? videoDetailController.minVideoHeight
|
||||||
? videoDetailController.minVideoHeight
|
: kToolbarHeight;
|
||||||
: kToolbarHeight;
|
if (videoDetailController.isExpanding &&
|
||||||
if (videoDetailController.isExpanding &&
|
videoDetailController.animationController.value == 1) {
|
||||||
videoDetailController.animationController.value == 1) {
|
videoDetailController.isExpanding = false;
|
||||||
videoDetailController.isExpanding = false;
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
videoDetailController.scrollRatio.value = 0;
|
||||||
videoDetailController.scrollRatio.value = 0;
|
refreshPage();
|
||||||
refreshPage();
|
});
|
||||||
});
|
} else if (videoDetailController.isCollapsing &&
|
||||||
} else if (videoDetailController.isCollapsing &&
|
videoDetailController.animationController.value == 1) {
|
||||||
videoDetailController.animationController.value == 1) {
|
videoDetailController.isCollapsing = false;
|
||||||
videoDetailController.isCollapsing = false;
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
refreshPage();
|
||||||
refreshPage();
|
});
|
||||||
});
|
}
|
||||||
}
|
return pinnedHeight;
|
||||||
return pinnedHeight;
|
},
|
||||||
},
|
headerSliverBuilder: (context, innerBoxIsScrolled) {
|
||||||
headerSliverBuilder: (context, innerBoxIsScrolled) {
|
final isFullScreen = this.isFullScreen;
|
||||||
final isFullScreen = this.isFullScreen;
|
final height = isFullScreen || !isPortrait
|
||||||
final height = !isPortrait || isFullScreen
|
? maxHeight - (isPortrait ? padding.top : 0)
|
||||||
? maxHeight
|
: videoDetailController.isExpanding ||
|
||||||
: videoDetailController.isExpanding ||
|
videoDetailController.isCollapsing
|
||||||
videoDetailController.isCollapsing
|
? animHeight
|
||||||
? animHeight
|
: videoDetailController.videoHeight;
|
||||||
: videoDetailController.videoHeight;
|
return [
|
||||||
return [
|
SliverAppBar(
|
||||||
SliverAppBar(
|
elevation: 0,
|
||||||
elevation: 0,
|
scrolledUnderElevation: 0,
|
||||||
scrolledUnderElevation: 0,
|
primary: false,
|
||||||
primary: false,
|
automaticallyImplyLeading: false,
|
||||||
automaticallyImplyLeading: false,
|
pinned: true,
|
||||||
pinned: true,
|
expandedHeight: height,
|
||||||
expandedHeight: isFullScreen || !isPortrait
|
flexibleSpace: Stack(
|
||||||
? maxHeight
|
clipBehavior: Clip.none,
|
||||||
: videoDetailController.isExpanding ||
|
children: [
|
||||||
videoDetailController.isCollapsing
|
SizedBox(
|
||||||
? animHeight
|
|
||||||
: videoDetailController.videoHeight,
|
|
||||||
flexibleSpace: Stack(
|
|
||||||
clipBehavior: Clip.none,
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
width: maxWidth,
|
|
||||||
height: height,
|
|
||||||
child: videoPlayer(
|
|
||||||
width: maxWidth,
|
width: maxWidth,
|
||||||
height: height,
|
height: height,
|
||||||
|
child: videoPlayer(
|
||||||
|
width: maxWidth,
|
||||||
|
height: height,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Obx(
|
||||||
Obx(
|
() {
|
||||||
() {
|
Widget toolbar() => Opacity(
|
||||||
Widget toolbar() => Opacity(
|
opacity: videoDetailController.scrollRatio.value,
|
||||||
opacity: videoDetailController.scrollRatio.value,
|
child: Container(
|
||||||
child: Container(
|
color: themeData.colorScheme.surface,
|
||||||
color: themeData.colorScheme.surface,
|
alignment: Alignment.topCenter,
|
||||||
alignment: Alignment.topCenter,
|
child: SizedBox(
|
||||||
child: SizedBox(
|
height: kToolbarHeight,
|
||||||
height: kToolbarHeight,
|
child: Stack(
|
||||||
child: Stack(
|
clipBehavior: Clip.none,
|
||||||
clipBehavior: Clip.none,
|
children: [
|
||||||
children: [
|
Align(
|
||||||
Align(
|
alignment: Alignment.centerLeft,
|
||||||
alignment: Alignment.centerLeft,
|
child: Row(
|
||||||
child: Row(
|
mainAxisSize: MainAxisSize.min,
|
||||||
mainAxisSize: MainAxisSize.min,
|
children: [
|
||||||
children: [
|
SizedBox(
|
||||||
SizedBox(
|
|
||||||
width: 42,
|
|
||||||
height: 34,
|
|
||||||
child: IconButton(
|
|
||||||
tooltip: '返回',
|
|
||||||
icon: Icon(
|
|
||||||
FontAwesomeIcons.arrowLeft,
|
|
||||||
size: 15,
|
|
||||||
color: themeData
|
|
||||||
.colorScheme
|
|
||||||
.onSurface,
|
|
||||||
),
|
|
||||||
onPressed: Get.back,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 42,
|
|
||||||
height: 34,
|
|
||||||
child: IconButton(
|
|
||||||
tooltip: '返回主页',
|
|
||||||
icon: Icon(
|
|
||||||
FontAwesomeIcons.house,
|
|
||||||
size: 15,
|
|
||||||
color: themeData
|
|
||||||
.colorScheme
|
|
||||||
.onSurface,
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
videoDetailController
|
|
||||||
.plPlayerController
|
|
||||||
..isCloseAll = true
|
|
||||||
..dispose();
|
|
||||||
Get.until(
|
|
||||||
(route) => route.isFirst,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Center(
|
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
Icons.play_arrow_rounded,
|
|
||||||
color:
|
|
||||||
themeData.colorScheme.primary,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'${videoDetailController.playedTime == null
|
|
||||||
? '立即'
|
|
||||||
: plPlayerController!.playerStatus.status.value == PlayerStatus.completed
|
|
||||||
? '重新'
|
|
||||||
: '继续'}播放',
|
|
||||||
style: TextStyle(
|
|
||||||
color:
|
|
||||||
themeData.colorScheme.primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.centerRight,
|
|
||||||
child:
|
|
||||||
videoDetailController.playedTime ==
|
|
||||||
null
|
|
||||||
? _moreBtn(
|
|
||||||
themeData.colorScheme.onSurface,
|
|
||||||
)
|
|
||||||
: SizedBox(
|
|
||||||
width: 42,
|
width: 42,
|
||||||
height: 34,
|
height: 34,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
tooltip: "更多设置",
|
tooltip: '返回',
|
||||||
style: const ButtonStyle(
|
|
||||||
padding:
|
|
||||||
WidgetStatePropertyAll(
|
|
||||||
EdgeInsets.zero,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: () =>
|
|
||||||
videoDetailController
|
|
||||||
.headerCtrKey
|
|
||||||
.currentState
|
|
||||||
?.showSettingSheet(),
|
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.more_vert_outlined,
|
FontAwesomeIcons.arrowLeft,
|
||||||
size: 19,
|
size: 15,
|
||||||
color: themeData
|
color: themeData
|
||||||
.colorScheme
|
.colorScheme
|
||||||
.onSurface,
|
.onSurface,
|
||||||
),
|
),
|
||||||
|
onPressed: Get.back,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
SizedBox(
|
||||||
],
|
width: 42,
|
||||||
|
height: 34,
|
||||||
|
child: IconButton(
|
||||||
|
tooltip: '返回主页',
|
||||||
|
icon: Icon(
|
||||||
|
FontAwesomeIcons.house,
|
||||||
|
size: 15,
|
||||||
|
color: themeData
|
||||||
|
.colorScheme
|
||||||
|
.onSurface,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
videoDetailController
|
||||||
|
.plPlayerController
|
||||||
|
..isCloseAll = true
|
||||||
|
..dispose();
|
||||||
|
Get.until(
|
||||||
|
(route) => route.isFirst,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Center(
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.play_arrow_rounded,
|
||||||
|
color:
|
||||||
|
themeData.colorScheme.primary,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${videoDetailController.playedTime == null
|
||||||
|
? '立即'
|
||||||
|
: plPlayerController!.playerStatus.status.value == PlayerStatus.completed
|
||||||
|
? '重新'
|
||||||
|
: '继续'}播放',
|
||||||
|
style: TextStyle(
|
||||||
|
color: themeData
|
||||||
|
.colorScheme
|
||||||
|
.primary,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
child:
|
||||||
|
videoDetailController.playedTime ==
|
||||||
|
null
|
||||||
|
? _moreBtn(
|
||||||
|
themeData.colorScheme.onSurface,
|
||||||
|
)
|
||||||
|
: SizedBox(
|
||||||
|
width: 42,
|
||||||
|
height: 34,
|
||||||
|
child: IconButton(
|
||||||
|
tooltip: "更多设置",
|
||||||
|
style: const ButtonStyle(
|
||||||
|
padding:
|
||||||
|
WidgetStatePropertyAll(
|
||||||
|
EdgeInsets.zero,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: () =>
|
||||||
|
videoDetailController
|
||||||
|
.headerCtrKey
|
||||||
|
.currentState
|
||||||
|
?.showSettingSheet(),
|
||||||
|
icon: Icon(
|
||||||
|
Icons.more_vert_outlined,
|
||||||
|
size: 19,
|
||||||
|
color: themeData
|
||||||
|
.colorScheme
|
||||||
|
.onSurface,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
return videoDetailController.scrollRatio.value ==
|
||||||
return videoDetailController.scrollRatio.value == 0 ||
|
0 ||
|
||||||
videoDetailController.scrollCtr.offset == 0 ||
|
videoDetailController.scrollCtr.offset ==
|
||||||
!isPortrait
|
0 ||
|
||||||
? const SizedBox.shrink()
|
!isPortrait
|
||||||
: Positioned.fill(
|
? const SizedBox.shrink()
|
||||||
bottom: -2,
|
: Positioned.fill(
|
||||||
child: GestureDetector(
|
bottom: -2,
|
||||||
onTap: () async {
|
child: GestureDetector(
|
||||||
if (videoDetailController.isQuerying) {
|
onTap: () async {
|
||||||
if (kDebugMode) {
|
if (videoDetailController.isQuerying) {
|
||||||
debugPrint(
|
if (kDebugMode) {
|
||||||
'handlePlay: querying',
|
debugPrint(
|
||||||
);
|
'handlePlay: querying',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
return;
|
if (videoDetailController.videoUrl ==
|
||||||
}
|
null ||
|
||||||
if (videoDetailController.videoUrl ==
|
videoDetailController.audioUrl ==
|
||||||
null ||
|
null) {
|
||||||
videoDetailController.audioUrl ==
|
if (kDebugMode) {
|
||||||
null) {
|
debugPrint(
|
||||||
if (kDebugMode) {
|
'handlePlay: videoUrl/audioUrl not initialized',
|
||||||
debugPrint(
|
);
|
||||||
'handlePlay: videoUrl/audioUrl not initialized',
|
}
|
||||||
);
|
videoDetailController.queryVideoUrl();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
videoDetailController.queryVideoUrl();
|
videoDetailController
|
||||||
return;
|
.scrollRatio
|
||||||
}
|
.value =
|
||||||
videoDetailController.scrollRatio.value =
|
0;
|
||||||
0;
|
if (plPlayerController == null ||
|
||||||
if (plPlayerController == null ||
|
videoDetailController.playedTime ==
|
||||||
videoDetailController.playedTime ==
|
null) {
|
||||||
null) {
|
handlePlay();
|
||||||
handlePlay();
|
|
||||||
} else {
|
|
||||||
if (plPlayerController!
|
|
||||||
.videoPlayerController!
|
|
||||||
.state
|
|
||||||
.completed) {
|
|
||||||
await plPlayerController!
|
|
||||||
.videoPlayerController!
|
|
||||||
.seek(Duration.zero);
|
|
||||||
plPlayerController!
|
|
||||||
.videoPlayerController!
|
|
||||||
.play();
|
|
||||||
} else {
|
} else {
|
||||||
plPlayerController!
|
if (plPlayerController!
|
||||||
.videoPlayerController!
|
.videoPlayerController!
|
||||||
.playOrPause();
|
.state
|
||||||
|
.completed) {
|
||||||
|
await plPlayerController!
|
||||||
|
.videoPlayerController!
|
||||||
|
.seek(Duration.zero);
|
||||||
|
plPlayerController!
|
||||||
|
.videoPlayerController!
|
||||||
|
.play();
|
||||||
|
} else {
|
||||||
|
plPlayerController!
|
||||||
|
.videoPlayerController!
|
||||||
|
.playOrPause();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
behavior: HitTestBehavior.opaque,
|
||||||
behavior: HitTestBehavior.opaque,
|
child: toolbar(),
|
||||||
child: toolbar(),
|
),
|
||||||
),
|
);
|
||||||
);
|
},
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
];
|
|
||||||
},
|
|
||||||
body: Scaffold(
|
|
||||||
key: videoDetailController.childKey,
|
|
||||||
resizeToAvoidBottomInset: false,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
body: Column(
|
|
||||||
children: [
|
|
||||||
buildTabbar(onTap: videoDetailController.animToTop),
|
|
||||||
Expanded(
|
|
||||||
child: videoTabBarView(
|
|
||||||
controller: videoDetailController.tabCtr,
|
|
||||||
children: [
|
|
||||||
videoIntro(
|
|
||||||
isHorizontal: false,
|
|
||||||
needCtr: false,
|
|
||||||
isNested: true,
|
|
||||||
),
|
),
|
||||||
if (videoDetailController.showReply)
|
|
||||||
videoReplyPanel(isNested: true),
|
|
||||||
if (_shouldShowSeasonPanel) seasonPanel,
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
];
|
||||||
|
},
|
||||||
|
body: Scaffold(
|
||||||
|
key: videoDetailController.childKey,
|
||||||
|
resizeToAvoidBottomInset: false,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
buildTabbar(onTap: videoDetailController.animToTop),
|
||||||
|
Expanded(
|
||||||
|
child: videoTabBarView(
|
||||||
|
controller: videoDetailController.tabCtr,
|
||||||
|
children: [
|
||||||
|
videoIntro(
|
||||||
|
isHorizontal: false,
|
||||||
|
needCtr: false,
|
||||||
|
isNested: true,
|
||||||
|
),
|
||||||
|
if (videoDetailController.showReply)
|
||||||
|
videoReplyPanel(isNested: true),
|
||||||
|
if (_shouldShowSeasonPanel) seasonPanel,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -878,7 +885,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
Widget get childWhenDisabledLandscape => Obx(
|
Widget get childWhenDisabledLandscape => Obx(
|
||||||
() {
|
() {
|
||||||
final isFullScreen = this.isFullScreen;
|
final isFullScreen = this.isFullScreen;
|
||||||
final padding = MediaQuery.viewPaddingOf(context);
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
appBar: isFullScreen
|
appBar: isFullScreen
|
||||||
@@ -1052,7 +1058,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
|
|
||||||
Widget get childWhenDisabledAlmostSquare => Obx(() {
|
Widget get childWhenDisabledAlmostSquare => Obx(() {
|
||||||
final isFullScreen = this.isFullScreen;
|
final isFullScreen = this.isFullScreen;
|
||||||
final padding = MediaQuery.viewPaddingOf(context);
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
appBar: isFullScreen
|
appBar: isFullScreen
|
||||||
@@ -1368,6 +1373,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
late bool isPortrait;
|
late bool isPortrait;
|
||||||
late double maxWidth;
|
late double maxWidth;
|
||||||
late double maxHeight;
|
late double maxHeight;
|
||||||
|
late EdgeInsets padding;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@@ -1730,7 +1736,6 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
bool needCtr = true,
|
bool needCtr = true,
|
||||||
bool isNested = false,
|
bool isNested = false,
|
||||||
}) {
|
}) {
|
||||||
final bottom = MediaQuery.viewPaddingOf(context).bottom;
|
|
||||||
Widget introPanel() => KeepAliveWrapper(
|
Widget introPanel() => KeepAliveWrapper(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
final child = CustomScrollView(
|
final child = CustomScrollView(
|
||||||
@@ -1786,7 +1791,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
(videoDetailController.isPlayAll && !isPortrait
|
(videoDetailController.isPlayAll && !isPortrait
|
||||||
? 80
|
? 80
|
||||||
: StyleString.safeSpace) +
|
: StyleString.safeSpace) +
|
||||||
bottom,
|
padding.bottom,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -1808,7 +1813,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
Positioned(
|
Positioned(
|
||||||
left: 12,
|
left: 12,
|
||||||
right: 12,
|
right: 12,
|
||||||
bottom: 12 + bottom,
|
bottom: 12 + padding.bottom,
|
||||||
child: Material(
|
child: Material(
|
||||||
type: MaterialType.transparency,
|
type: MaterialType.transparency,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import 'package:PiliPlus/plugin/pl_player/widgets/forward_seek.dart';
|
|||||||
import 'package:PiliPlus/plugin/pl_player/widgets/mpv_convert_webp.dart';
|
import 'package:PiliPlus/plugin/pl_player/widgets/mpv_convert_webp.dart';
|
||||||
import 'package:PiliPlus/plugin/pl_player/widgets/play_pause_btn.dart';
|
import 'package:PiliPlus/plugin/pl_player/widgets/play_pause_btn.dart';
|
||||||
import 'package:PiliPlus/utils/duration_utils.dart';
|
import 'package:PiliPlus/utils/duration_utils.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/id_utils.dart';
|
import 'package:PiliPlus/utils/id_utils.dart';
|
||||||
import 'package:PiliPlus/utils/image_utils.dart';
|
import 'package:PiliPlus/utils/image_utils.dart';
|
||||||
import 'package:PiliPlus/utils/storage.dart';
|
import 'package:PiliPlus/utils/storage.dart';
|
||||||
@@ -793,10 +794,16 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
|
|
||||||
late final transformationController = TransformationController();
|
late final transformationController = TransformationController();
|
||||||
|
|
||||||
late ThemeData theme;
|
late ColorScheme colorScheme;
|
||||||
late double maxWidth;
|
late double maxWidth;
|
||||||
late double maxHeight;
|
late double maxHeight;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didChangeDependencies() {
|
||||||
|
super.didChangeDependencies();
|
||||||
|
colorScheme = ColorScheme.of(context);
|
||||||
|
}
|
||||||
|
|
||||||
void _onInteractionStart(ScaleStartDetails details) {
|
void _onInteractionStart(ScaleStartDetails details) {
|
||||||
if (plPlayerController.controlsLock.value) return;
|
if (plPlayerController.controlsLock.value) return;
|
||||||
// 如果起点太靠上则屏蔽
|
// 如果起点太靠上则屏蔽
|
||||||
@@ -911,12 +918,12 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
borderRadius: const BorderRadius.all(
|
borderRadius: const BorderRadius.all(
|
||||||
Radius.circular(6),
|
Radius.circular(6),
|
||||||
),
|
),
|
||||||
color: theme.colorScheme.secondaryContainer,
|
color: colorScheme.secondaryContainer,
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
'松开手指,取消进退',
|
'松开手指,取消进退',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: theme.colorScheme.onSecondaryContainer,
|
color: colorScheme.onSecondaryContainer,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -1172,10 +1179,11 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
theme = Theme.of(context);
|
|
||||||
maxWidth = widget.maxWidth;
|
maxWidth = widget.maxWidth;
|
||||||
maxHeight = widget.maxHeight;
|
maxHeight = widget.maxHeight;
|
||||||
final Color primary = theme.colorScheme.primary;
|
final primary = colorScheme.isLight
|
||||||
|
? colorScheme.inversePrimary
|
||||||
|
: colorScheme.primary;
|
||||||
late final thumbGlowColor = primary.withAlpha(80);
|
late final thumbGlowColor = primary.withAlpha(80);
|
||||||
late final bufferedBarColor = primary.withValues(alpha: 0.4);
|
late final bufferedBarColor = primary.withValues(alpha: 0.4);
|
||||||
const TextStyle textStyle = TextStyle(
|
const TextStyle textStyle = TextStyle(
|
||||||
@@ -1508,7 +1516,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
child: FilledButton.tonal(
|
child: FilledButton.tonal(
|
||||||
style: FilledButton.styleFrom(
|
style: FilledButton.styleFrom(
|
||||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||||
backgroundColor: theme.colorScheme.secondaryContainer
|
backgroundColor: colorScheme.secondaryContainer
|
||||||
.withValues(alpha: 0.8),
|
.withValues(alpha: 0.8),
|
||||||
visualDensity: VisualDensity.compact,
|
visualDensity: VisualDensity.compact,
|
||||||
padding: const EdgeInsets.all(15),
|
padding: const EdgeInsets.all(15),
|
||||||
@@ -1660,7 +1668,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
videoDetailController.showDmTreandChart.value)
|
videoDetailController.showDmTreandChart.value)
|
||||||
if (videoDetailController.dmTrend.value?.dataOrNull
|
if (videoDetailController.dmTrend.value?.dataOrNull
|
||||||
case final list?)
|
case final list?)
|
||||||
buildDmChart(theme, list, videoDetailController),
|
buildDmChart(primary, list, videoDetailController),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -2040,12 +2048,11 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget buildDmChart(
|
Widget buildDmChart(
|
||||||
ThemeData theme,
|
Color color,
|
||||||
List<double> dmTrend,
|
List<double> dmTrend,
|
||||||
VideoDetailController videoDetailController, [
|
VideoDetailController videoDetailController, [
|
||||||
double offset = 0,
|
double offset = 0,
|
||||||
]) {
|
]) {
|
||||||
final color = theme.colorScheme.primary;
|
|
||||||
return IgnorePointer(
|
return IgnorePointer(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 12,
|
height: 12,
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ class AppBarAni extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: ViewSafeArea(
|
child: ViewSafeArea(
|
||||||
top: isTop && isFullScreen,
|
|
||||||
left: isFullScreen,
|
left: isFullScreen,
|
||||||
right: isFullScreen,
|
right: isFullScreen,
|
||||||
child: child,
|
child: child,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'package:PiliPlus/common/widgets/progress_bar/segment_progress_bar.dart';
|
|||||||
import 'package:PiliPlus/pages/video/controller.dart';
|
import 'package:PiliPlus/pages/video/controller.dart';
|
||||||
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
||||||
import 'package:PiliPlus/plugin/pl_player/view.dart';
|
import 'package:PiliPlus/plugin/pl_player/view.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/feed_back.dart';
|
import 'package:PiliPlus/utils/feed_back.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -29,8 +30,10 @@ class BottomControl extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final colorScheme = ColorScheme.of(context);
|
||||||
Color primary = theme.colorScheme.primary;
|
final primary = colorScheme.isLight
|
||||||
|
? colorScheme.inversePrimary
|
||||||
|
: colorScheme.primary;
|
||||||
final thumbGlowColor = primary.withAlpha(80);
|
final thumbGlowColor = primary.withAlpha(80);
|
||||||
final bufferedBarColor = primary.withValues(alpha: 0.4);
|
final bufferedBarColor = primary.withValues(alpha: 0.4);
|
||||||
//阅读器限制
|
//阅读器限制
|
||||||
@@ -113,6 +116,7 @@ class BottomControl extends StatelessWidget {
|
|||||||
thumbGlowColor: thumbGlowColor,
|
thumbGlowColor: thumbGlowColor,
|
||||||
barHeight: 3.5,
|
barHeight: 3.5,
|
||||||
thumbRadius: 7,
|
thumbRadius: 7,
|
||||||
|
thumbGlowRadius: 25,
|
||||||
onDragStart: onDragStart,
|
onDragStart: onDragStart,
|
||||||
onDragUpdate: (e) => onDragUpdate(e, max),
|
onDragUpdate: (e) => onDragUpdate(e, max),
|
||||||
onSeek: (e) => onSeek(e, max),
|
onSeek: (e) => onSeek(e, max),
|
||||||
@@ -175,7 +179,7 @@ class BottomControl extends StatelessWidget {
|
|||||||
if (videoDetailController.showDmTreandChart.value)
|
if (videoDetailController.showDmTreandChart.value)
|
||||||
if (videoDetailController.dmTrend.value?.dataOrNull
|
if (videoDetailController.dmTrend.value?.dataOrNull
|
||||||
case final list?)
|
case final list?)
|
||||||
buildDmChart(theme, list, videoDetailController, 4.5),
|
buildDmChart(primary, list, videoDetailController, 4.5),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user