mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: video theme, view later
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -652,6 +652,7 @@ class VideoIntroController extends GetxController
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
hasLater.value = false;
|
||||
this.bvid = bvid;
|
||||
lastPlayCid.value = cid;
|
||||
queryVideoIntro();
|
||||
|
||||
@@ -21,6 +21,7 @@ class VideoReplyReplyController extends ReplyController
|
||||
required this.dialog,
|
||||
required this.replyType,
|
||||
required this.isDialogue,
|
||||
required this.getThemeData,
|
||||
});
|
||||
final int? dialog;
|
||||
final bool isDialogue;
|
||||
@@ -60,6 +61,8 @@ class VideoReplyReplyController extends ReplyController
|
||||
return super.onRefresh();
|
||||
}
|
||||
|
||||
final ThemeData Function() getThemeData;
|
||||
|
||||
@override
|
||||
bool customHandleResponse(Success response) {
|
||||
if (GlobalData().grpcReply) {
|
||||
@@ -81,8 +84,8 @@ class VideoReplyReplyController extends ReplyController
|
||||
vsync: this,
|
||||
);
|
||||
colorAnimation = ColorTween(
|
||||
begin: Theme.of(Get.context!).colorScheme.onInverseSurface,
|
||||
end: Theme.of(Get.context!).colorScheme.surface,
|
||||
begin: getThemeData().colorScheme.onInverseSurface,
|
||||
end: getThemeData().colorScheme.surface,
|
||||
).animate(controller!);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
if (index != null) {
|
||||
|
||||
@@ -80,6 +80,7 @@ class _VideoReplyReplyPanelState
|
||||
dialog: widget.dialog,
|
||||
replyType: widget.replyType,
|
||||
isDialogue: widget.isDialogue,
|
||||
getThemeData: () => Theme.of(context),
|
||||
),
|
||||
tag: '${widget.rpid}${widget.dialog}${widget.isDialogue}',
|
||||
);
|
||||
@@ -473,9 +474,9 @@ class _VideoReplyReplyPanelState
|
||||
animation: _videoReplyReplyController.colorAnimation!,
|
||||
builder: (context, child) {
|
||||
return ColoredBox(
|
||||
color: _videoReplyReplyController
|
||||
.colorAnimation?.value ??
|
||||
Theme.of(Get.context!).colorScheme.onInverseSurface,
|
||||
color:
|
||||
_videoReplyReplyController.colorAnimation?.value ??
|
||||
Theme.of(context).colorScheme.onInverseSurface,
|
||||
child: _replyItem(loadingState.response[index], index),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -590,14 +590,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
: MediaQuery.of(context).padding.top)
|
||||
: videoHeight,
|
||||
width: context.width,
|
||||
child: PopScope(
|
||||
canPop: !isFullScreen &&
|
||||
(horizontalScreen ||
|
||||
MediaQuery.of(context).orientation ==
|
||||
Orientation.portrait),
|
||||
onPopInvokedWithResult: _onPopInvokedWithResult,
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -648,11 +641,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
SizedBox(
|
||||
height: videoHeight,
|
||||
width: isFullScreen ? context.width : videoWidth,
|
||||
child: PopScope(
|
||||
canPop: !isFullScreen,
|
||||
onPopInvokedWithResult: _onPopInvokedWithResult,
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
Expanded(
|
||||
child: Scaffold(
|
||||
@@ -693,11 +682,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
: (MediaQuery.of(context).padding.top +
|
||||
MediaQuery.of(context).padding.bottom))
|
||||
: videoHeight,
|
||||
child: PopScope(
|
||||
canPop: !isFullScreen,
|
||||
onPopInvokedWithResult: _onPopInvokedWithResult,
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
Expanded(
|
||||
child: Scaffold(
|
||||
@@ -745,11 +730,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
SizedBox(
|
||||
height: videoHeight,
|
||||
width: isFullScreen ? context.width : videoWidth,
|
||||
child: PopScope(
|
||||
canPop: !isFullScreen,
|
||||
onPopInvokedWithResult: _onPopInvokedWithResult,
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
Expanded(
|
||||
child: Expanded(
|
||||
@@ -829,11 +810,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
SizedBox(
|
||||
width: isFullScreen ? context.width : videoWidth,
|
||||
height: isFullScreen ? context.height : videoHeight,
|
||||
child: PopScope(
|
||||
canPop: !isFullScreen,
|
||||
onPopInvokedWithResult: _onPopInvokedWithResult,
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
Offstage(
|
||||
offstage: isFullScreen,
|
||||
@@ -1367,152 +1344,158 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
);
|
||||
}
|
||||
|
||||
Widget videoPlayer(double videoWidth, double videoHeight) => Stack(
|
||||
children: [
|
||||
Positioned.fill(child: ColoredBox(color: Colors.black)),
|
||||
Widget videoPlayer(double videoWidth, double videoHeight) => PopScope(
|
||||
canPop: !isFullScreen,
|
||||
onPopInvokedWithResult: _onPopInvokedWithResult,
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned.fill(child: ColoredBox(color: Colors.black)),
|
||||
|
||||
if (isShowing) plPlayer,
|
||||
if (isShowing) plPlayer,
|
||||
|
||||
/// 关闭自动播放时 手动播放
|
||||
if (!videoDetailController.autoPlay.value) ...[
|
||||
Obx(
|
||||
() => Visibility(
|
||||
visible: videoDetailController.isShowCover.value,
|
||||
child: Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: GestureDetector(
|
||||
onTap: handlePlay,
|
||||
child: Obx(
|
||||
() => NetworkImgLayer(
|
||||
type: 'emote',
|
||||
src: videoDetailController.videoItem['pic'],
|
||||
width: videoWidth,
|
||||
height: videoHeight,
|
||||
/// 关闭自动播放时 手动播放
|
||||
if (!videoDetailController.autoPlay.value) ...[
|
||||
Obx(
|
||||
() => Visibility(
|
||||
visible: videoDetailController.isShowCover.value,
|
||||
child: Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: GestureDetector(
|
||||
onTap: handlePlay,
|
||||
child: Obx(
|
||||
() => NetworkImgLayer(
|
||||
type: 'emote',
|
||||
src: videoDetailController.videoItem['pic'],
|
||||
width: videoWidth,
|
||||
height: videoHeight,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
manualPlayerWidget,
|
||||
],
|
||||
manualPlayerWidget,
|
||||
],
|
||||
|
||||
if (videoDetailController.enableSponsorBlock ||
|
||||
videoDetailController.continuePlayingPart)
|
||||
Positioned(
|
||||
left: 16,
|
||||
bottom: isFullScreen ? max(75, Get.height * 0.25) : 75,
|
||||
child: SizedBox(
|
||||
width: MediaQuery.textScalerOf(context).scale(120),
|
||||
child: AnimatedList(
|
||||
padding: EdgeInsets.zero,
|
||||
key: videoDetailController.listKey,
|
||||
reverse: true,
|
||||
shrinkWrap: true,
|
||||
initialItemCount: videoDetailController.listData.length,
|
||||
itemBuilder: (context, index, animation) {
|
||||
return videoDetailController.buildItem(
|
||||
videoDetailController.listData[index],
|
||||
animation,
|
||||
);
|
||||
},
|
||||
if (videoDetailController.enableSponsorBlock ||
|
||||
videoDetailController.continuePlayingPart)
|
||||
Positioned(
|
||||
left: 16,
|
||||
bottom: isFullScreen ? max(75, Get.height * 0.25) : 75,
|
||||
child: SizedBox(
|
||||
width: MediaQuery.textScalerOf(context).scale(120),
|
||||
child: AnimatedList(
|
||||
padding: EdgeInsets.zero,
|
||||
key: videoDetailController.listKey,
|
||||
reverse: true,
|
||||
shrinkWrap: true,
|
||||
initialItemCount: videoDetailController.listData.length,
|
||||
itemBuilder: (context, index, animation) {
|
||||
return videoDetailController.buildItem(
|
||||
videoDetailController.listData[index],
|
||||
animation,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// for debug
|
||||
// Positioned(
|
||||
// right: 16,
|
||||
// bottom: 75,
|
||||
// child: FilledButton.tonal(
|
||||
// onPressed: () {
|
||||
// videoDetailController.onAddItem(
|
||||
// SegmentModel(
|
||||
// UUID: '',
|
||||
// segmentType: SegmentType.sponsor,
|
||||
// segment: Pair(first: 0, second: 0),
|
||||
// skipType: SkipType.alwaysSkip,
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// child: Text('skip'),
|
||||
// ),
|
||||
// ),
|
||||
// Positioned(
|
||||
// right: 16,
|
||||
// bottom: 120,
|
||||
// child: FilledButton.tonal(
|
||||
// onPressed: () {
|
||||
// videoDetailController.onAddItem(2);
|
||||
// },
|
||||
// child: Text('index'),
|
||||
// ),
|
||||
// ),
|
||||
// for debug
|
||||
// Positioned(
|
||||
// right: 16,
|
||||
// bottom: 75,
|
||||
// child: FilledButton.tonal(
|
||||
// onPressed: () {
|
||||
// videoDetailController.onAddItem(
|
||||
// SegmentModel(
|
||||
// UUID: '',
|
||||
// segmentType: SegmentType.sponsor,
|
||||
// segment: Pair(first: 0, second: 0),
|
||||
// skipType: SkipType.alwaysSkip,
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// child: Text('skip'),
|
||||
// ),
|
||||
// ),
|
||||
// Positioned(
|
||||
// right: 16,
|
||||
// bottom: 120,
|
||||
// child: FilledButton.tonal(
|
||||
// onPressed: () {
|
||||
// videoDetailController.onAddItem(2);
|
||||
// },
|
||||
// child: Text('index'),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
Obx(
|
||||
() {
|
||||
if (videoDetailController.showSteinEdgeInfo.value) {
|
||||
try {
|
||||
return Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: plPlayerController?.showControls.value == true
|
||||
? 75
|
||||
: 16,
|
||||
),
|
||||
child: Wrap(
|
||||
spacing: 25,
|
||||
runSpacing: 10,
|
||||
children: (videoDetailController.steinEdgeInfo!['edges']
|
||||
['questions'][0]['choices'] as List)
|
||||
.map((item) {
|
||||
return FilledButton.tonal(
|
||||
style: FilledButton.styleFrom(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
Obx(
|
||||
() {
|
||||
if (videoDetailController.showSteinEdgeInfo.value) {
|
||||
try {
|
||||
return Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical:
|
||||
plPlayerController?.showControls.value == true
|
||||
? 75
|
||||
: 16,
|
||||
),
|
||||
child: Wrap(
|
||||
spacing: 25,
|
||||
runSpacing: 10,
|
||||
children:
|
||||
(videoDetailController.steinEdgeInfo!['edges']
|
||||
['questions'][0]['choices'] as List)
|
||||
.map((item) {
|
||||
return FilledButton.tonal(
|
||||
style: FilledButton.styleFrom(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
backgroundColor: themeData
|
||||
.colorScheme.secondaryContainer
|
||||
.withOpacity(0.8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 15,
|
||||
vertical: 10,
|
||||
),
|
||||
visualDensity:
|
||||
VisualDensity(horizontal: -2, vertical: -2),
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
),
|
||||
backgroundColor: themeData
|
||||
.colorScheme.secondaryContainer
|
||||
.withOpacity(0.8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 15,
|
||||
vertical: 10,
|
||||
),
|
||||
visualDensity:
|
||||
VisualDensity(horizontal: -2, vertical: -2),
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
),
|
||||
onPressed: () {
|
||||
videoIntroController.changeSeasonOrbangu(
|
||||
null,
|
||||
videoDetailController.bvid,
|
||||
item['cid'],
|
||||
IdUtils.bv2av(videoDetailController.bvid),
|
||||
null,
|
||||
true,
|
||||
);
|
||||
videoDetailController
|
||||
.getSteinEdgeInfo(item['id']);
|
||||
},
|
||||
child: Text(item['option']),
|
||||
);
|
||||
}).toList(),
|
||||
onPressed: () {
|
||||
videoIntroController.changeSeasonOrbangu(
|
||||
null,
|
||||
videoDetailController.bvid,
|
||||
item['cid'],
|
||||
IdUtils.bv2av(videoDetailController.bvid),
|
||||
null,
|
||||
true,
|
||||
);
|
||||
videoDetailController
|
||||
.getSteinEdgeInfo(item['id']);
|
||||
},
|
||||
child: Text(item['option']),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
debugPrint('build stein edges: $e');
|
||||
return const SizedBox.shrink();
|
||||
);
|
||||
} catch (e) {
|
||||
debugPrint('build stein edges: $e');
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
},
|
||||
),
|
||||
],
|
||||
return const SizedBox.shrink();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Widget videoIntro([bool needRelated = true]) {
|
||||
|
||||
@@ -768,22 +768,15 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
? animHeight
|
||||
: videoDetailController.videoHeight,
|
||||
width: context.width,
|
||||
child: PopScope(
|
||||
canPop: !isFullScreen &&
|
||||
(horizontalScreen ||
|
||||
MediaQuery.of(context).orientation ==
|
||||
Orientation.portrait),
|
||||
onPopInvokedWithResult: _onPopInvokedWithResult,
|
||||
child: videoPlayer(
|
||||
videoWidth,
|
||||
context.orientation == Orientation.landscape ||
|
||||
isFullScreen
|
||||
? context.height
|
||||
: videoDetailController.isExpanding ||
|
||||
videoDetailController.isCollapsing
|
||||
? animHeight
|
||||
: videoDetailController.videoHeight,
|
||||
),
|
||||
child: videoPlayer(
|
||||
videoWidth,
|
||||
context.orientation == Orientation.landscape ||
|
||||
isFullScreen
|
||||
? context.height
|
||||
: videoDetailController.isExpanding ||
|
||||
videoDetailController.isCollapsing
|
||||
? animHeight
|
||||
: videoDetailController.videoHeight,
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -1026,11 +1019,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
SizedBox(
|
||||
height: videoHeight,
|
||||
width: isFullScreen ? context.width : videoWidth,
|
||||
child: PopScope(
|
||||
canPop: !isFullScreen,
|
||||
onPopInvokedWithResult: _onPopInvokedWithResult,
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
Expanded(
|
||||
child: Scaffold(
|
||||
@@ -1071,11 +1060,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
: (MediaQuery.of(context).padding.top +
|
||||
MediaQuery.of(context).padding.bottom))
|
||||
: videoHeight,
|
||||
child: PopScope(
|
||||
canPop: !isFullScreen,
|
||||
onPopInvokedWithResult: _onPopInvokedWithResult,
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
Expanded(
|
||||
child: Scaffold(
|
||||
@@ -1123,11 +1108,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
SizedBox(
|
||||
height: videoHeight,
|
||||
width: isFullScreen ? context.width : videoWidth,
|
||||
child: PopScope(
|
||||
canPop: !isFullScreen,
|
||||
onPopInvokedWithResult: _onPopInvokedWithResult,
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
Expanded(
|
||||
child: Expanded(
|
||||
@@ -1208,11 +1189,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
SizedBox(
|
||||
width: isFullScreen ? context.width : videoWidth,
|
||||
height: isFullScreen ? context.height : videoHeight,
|
||||
child: PopScope(
|
||||
canPop: !isFullScreen,
|
||||
onPopInvokedWithResult: _onPopInvokedWithResult,
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
child: videoPlayer(videoWidth, videoHeight),
|
||||
),
|
||||
Offstage(
|
||||
offstage: isFullScreen,
|
||||
@@ -1752,160 +1729,165 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
}
|
||||
|
||||
Widget videoPlayer(double videoWidth, double videoHeight) {
|
||||
return Stack(
|
||||
children: [
|
||||
Positioned.fill(child: ColoredBox(color: Colors.black)),
|
||||
return PopScope(
|
||||
canPop: !isFullScreen,
|
||||
onPopInvokedWithResult: _onPopInvokedWithResult,
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned.fill(child: ColoredBox(color: Colors.black)),
|
||||
|
||||
if (isShowing) plPlayer,
|
||||
if (isShowing) plPlayer,
|
||||
|
||||
if (!videoDetailController.autoPlay.value) ...[
|
||||
Obx(
|
||||
() => videoDetailController.isShowCover.value
|
||||
? Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: GestureDetector(
|
||||
onTap: handlePlay,
|
||||
child: Obx(
|
||||
() => CachedNetworkImage(
|
||||
imageUrl:
|
||||
videoDetailController.videoItem['pic'] != null
|
||||
? (videoDetailController.videoItem['pic']
|
||||
as String)
|
||||
.http2https
|
||||
: '',
|
||||
width: videoWidth,
|
||||
height: videoHeight,
|
||||
fit: BoxFit.cover,
|
||||
fadeOutDuration: const Duration(milliseconds: 120),
|
||||
fadeInDuration: const Duration(milliseconds: 120),
|
||||
memCacheWidth: videoWidth.cacheSize(context),
|
||||
placeholder: (context, url) => Center(
|
||||
child: Image.asset('assets/images/loading.png'),
|
||||
if (!videoDetailController.autoPlay.value) ...[
|
||||
Obx(
|
||||
() => videoDetailController.isShowCover.value
|
||||
? Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: GestureDetector(
|
||||
onTap: handlePlay,
|
||||
child: Obx(
|
||||
() => CachedNetworkImage(
|
||||
imageUrl:
|
||||
videoDetailController.videoItem['pic'] != null
|
||||
? (videoDetailController.videoItem['pic']
|
||||
as String)
|
||||
.http2https
|
||||
: '',
|
||||
width: videoWidth,
|
||||
height: videoHeight,
|
||||
fit: BoxFit.cover,
|
||||
fadeOutDuration: const Duration(milliseconds: 120),
|
||||
fadeInDuration: const Duration(milliseconds: 120),
|
||||
memCacheWidth: videoWidth.cacheSize(context),
|
||||
placeholder: (context, url) => Center(
|
||||
child: Image.asset('assets/images/loading.png'),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
manualPlayerWidget,
|
||||
],
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
manualPlayerWidget,
|
||||
],
|
||||
|
||||
if (videoDetailController.enableSponsorBlock ||
|
||||
videoDetailController.continuePlayingPart)
|
||||
Positioned(
|
||||
left: 16,
|
||||
bottom: isFullScreen ? max(75, Get.height * 0.25) : 75,
|
||||
child: SizedBox(
|
||||
width: MediaQuery.textScalerOf(context).scale(120),
|
||||
child: AnimatedList(
|
||||
padding: EdgeInsets.zero,
|
||||
key: videoDetailController.listKey,
|
||||
reverse: true,
|
||||
shrinkWrap: true,
|
||||
initialItemCount: videoDetailController.listData.length,
|
||||
itemBuilder: (context, index, animation) {
|
||||
return videoDetailController.buildItem(
|
||||
videoDetailController.listData[index],
|
||||
animation,
|
||||
);
|
||||
},
|
||||
if (videoDetailController.enableSponsorBlock ||
|
||||
videoDetailController.continuePlayingPart)
|
||||
Positioned(
|
||||
left: 16,
|
||||
bottom: isFullScreen ? max(75, Get.height * 0.25) : 75,
|
||||
child: SizedBox(
|
||||
width: MediaQuery.textScalerOf(context).scale(120),
|
||||
child: AnimatedList(
|
||||
padding: EdgeInsets.zero,
|
||||
key: videoDetailController.listKey,
|
||||
reverse: true,
|
||||
shrinkWrap: true,
|
||||
initialItemCount: videoDetailController.listData.length,
|
||||
itemBuilder: (context, index, animation) {
|
||||
return videoDetailController.buildItem(
|
||||
videoDetailController.listData[index],
|
||||
animation,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// for debug
|
||||
// Positioned(
|
||||
// right: 16,
|
||||
// bottom: 75,
|
||||
// child: FilledButton.tonal(
|
||||
// onPressed: () {
|
||||
// videoDetailController.onAddItem(
|
||||
// SegmentModel(
|
||||
// UUID: '',
|
||||
// segmentType: SegmentType.sponsor,
|
||||
// segment: Pair(first: 0, second: 0),
|
||||
// skipType: SkipType.alwaysSkip,
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// child: Text('skip'),
|
||||
// ),
|
||||
// ),
|
||||
// Positioned(
|
||||
// right: 16,
|
||||
// bottom: 120,
|
||||
// child: FilledButton.tonal(
|
||||
// onPressed: () {
|
||||
// videoDetailController.onAddItem(2);
|
||||
// },
|
||||
// child: Text('index'),
|
||||
// ),
|
||||
// ),
|
||||
// for debug
|
||||
// Positioned(
|
||||
// right: 16,
|
||||
// bottom: 75,
|
||||
// child: FilledButton.tonal(
|
||||
// onPressed: () {
|
||||
// videoDetailController.onAddItem(
|
||||
// SegmentModel(
|
||||
// UUID: '',
|
||||
// segmentType: SegmentType.sponsor,
|
||||
// segment: Pair(first: 0, second: 0),
|
||||
// skipType: SkipType.alwaysSkip,
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// child: Text('skip'),
|
||||
// ),
|
||||
// ),
|
||||
// Positioned(
|
||||
// right: 16,
|
||||
// bottom: 120,
|
||||
// child: FilledButton.tonal(
|
||||
// onPressed: () {
|
||||
// videoDetailController.onAddItem(2);
|
||||
// },
|
||||
// child: Text('index'),
|
||||
// ),
|
||||
// ),
|
||||
|
||||
Obx(
|
||||
() {
|
||||
if (videoDetailController.showSteinEdgeInfo.value) {
|
||||
try {
|
||||
return Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: plPlayerController?.showControls.value == true
|
||||
? 75
|
||||
: 16,
|
||||
),
|
||||
child: Wrap(
|
||||
spacing: 25,
|
||||
runSpacing: 10,
|
||||
children: (videoDetailController.steinEdgeInfo!['edges']
|
||||
['questions'][0]['choices'] as List)
|
||||
.map((item) {
|
||||
return FilledButton.tonal(
|
||||
style: FilledButton.styleFrom(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
Obx(
|
||||
() {
|
||||
if (videoDetailController.showSteinEdgeInfo.value) {
|
||||
try {
|
||||
return Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: plPlayerController?.showControls.value == true
|
||||
? 75
|
||||
: 16,
|
||||
),
|
||||
child: Wrap(
|
||||
spacing: 25,
|
||||
runSpacing: 10,
|
||||
children: (videoDetailController.steinEdgeInfo!['edges']
|
||||
['questions'][0]['choices'] as List)
|
||||
.map((item) {
|
||||
return FilledButton.tonal(
|
||||
style: FilledButton.styleFrom(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
backgroundColor: themeData
|
||||
.colorScheme.secondaryContainer
|
||||
.withOpacity(0.8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 15,
|
||||
vertical: 10,
|
||||
),
|
||||
visualDensity:
|
||||
VisualDensity(horizontal: -2, vertical: -2),
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
),
|
||||
backgroundColor: themeData
|
||||
.colorScheme.secondaryContainer
|
||||
.withOpacity(0.8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 15,
|
||||
vertical: 10,
|
||||
),
|
||||
visualDensity:
|
||||
VisualDensity(horizontal: -2, vertical: -2),
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
),
|
||||
onPressed: () {
|
||||
videoIntroController.changeSeasonOrbangu(
|
||||
null,
|
||||
videoDetailController.bvid,
|
||||
item['cid'],
|
||||
IdUtils.bv2av(videoDetailController.bvid),
|
||||
null,
|
||||
true,
|
||||
);
|
||||
videoDetailController.getSteinEdgeInfo(item['id']);
|
||||
},
|
||||
child: Text(item['option']),
|
||||
);
|
||||
}).toList(),
|
||||
onPressed: () {
|
||||
videoIntroController.changeSeasonOrbangu(
|
||||
null,
|
||||
videoDetailController.bvid,
|
||||
item['cid'],
|
||||
IdUtils.bv2av(videoDetailController.bvid),
|
||||
null,
|
||||
true,
|
||||
);
|
||||
videoDetailController
|
||||
.getSteinEdgeInfo(item['id']);
|
||||
},
|
||||
child: Text(item['option']),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
} catch (e) {
|
||||
debugPrint('build stein edges: $e');
|
||||
return const SizedBox.shrink();
|
||||
);
|
||||
} catch (e) {
|
||||
debugPrint('build stein edges: $e');
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
}
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
},
|
||||
),
|
||||
],
|
||||
return const SizedBox.shrink();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||
import 'package:media_kit/media_kit.dart';
|
||||
import 'package:PiliPlus/http/user.dart';
|
||||
import 'package:PiliPlus/models/video/play/quality.dart';
|
||||
import 'package:PiliPlus/models/video/play/url.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/index.dart';
|
||||
@@ -147,9 +146,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
dense: true,
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
final res =
|
||||
await UserHttp.toViewLater(bvid: videoDetailCtr.bvid);
|
||||
SmartDialog.showToast(res['msg']);
|
||||
videoIntroController.viewLater();
|
||||
},
|
||||
leading: const Icon(Icons.watch_later_outlined, size: 20),
|
||||
title: const Text('添加至「稍后再看」', style: titleStyle),
|
||||
|
||||
Reference in New Issue
Block a user