mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
fix: 补充更多的heroTag,直接传入避免问题
This commit is contained in:
@@ -26,7 +26,8 @@ import 'widgets/page.dart';
|
||||
import 'widgets/season.dart';
|
||||
|
||||
class VideoIntroPanel extends StatefulWidget {
|
||||
const VideoIntroPanel({super.key});
|
||||
const VideoIntroPanel({required this.heroTag, super.key});
|
||||
final String heroTag;
|
||||
|
||||
@override
|
||||
State<VideoIntroPanel> createState() => _VideoIntroPanelState();
|
||||
@@ -48,9 +49,10 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
||||
super.initState();
|
||||
|
||||
/// fix 全屏时参数丢失
|
||||
if (Get.arguments != null) {
|
||||
heroTag = Get.arguments['heroTag'];
|
||||
}
|
||||
// if (Get.arguments != null) {
|
||||
// heroTag = Get.arguments['heroTag'];
|
||||
// }
|
||||
heroTag = widget.heroTag;
|
||||
videoIntroController = Get.put(VideoIntroController(), tag: heroTag);
|
||||
_futureBuilderFuture = videoIntroController.queryVideoIntro();
|
||||
videoIntroController.videoDetail.listen((value) {
|
||||
@@ -482,6 +484,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
||||
widget.videoDetail!.ugcSeason != null) ...[
|
||||
Obx(
|
||||
() => SeasonPanel(
|
||||
heroTag: heroTag,
|
||||
ugcSeason: widget.videoDetail!.ugcSeason!,
|
||||
cid: videoIntroController.lastPlayCid.value != 0
|
||||
? videoIntroController.lastPlayCid.value
|
||||
@@ -494,6 +497,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
||||
widget.videoDetail!.pages != null &&
|
||||
widget.videoDetail!.pages!.length > 1) ...[
|
||||
Obx(() => PagesPanel(
|
||||
heroTag: heroTag,
|
||||
pages: widget.videoDetail!.pages!,
|
||||
cid: videoIntroController.lastPlayCid.value,
|
||||
bvid: videoIntroController.bvid,
|
||||
|
||||
@@ -15,11 +15,13 @@ class PagesPanel extends StatefulWidget {
|
||||
this.cid,
|
||||
required this.bvid,
|
||||
required this.changeFuc,
|
||||
required this.heroTag,
|
||||
});
|
||||
final List<Part> pages;
|
||||
final int? cid;
|
||||
final String bvid;
|
||||
final Function changeFuc;
|
||||
final String heroTag;
|
||||
|
||||
@override
|
||||
State<PagesPanel> createState() => _PagesPanelState();
|
||||
@@ -29,7 +31,8 @@ class _PagesPanelState extends State<PagesPanel> {
|
||||
late List<Part> episodes;
|
||||
late int cid;
|
||||
late int currentIndex;
|
||||
final String heroTag = Get.arguments['heroTag'];
|
||||
// final String heroTag = Get.arguments['heroTag'];
|
||||
late final String heroTag;
|
||||
late VideoDetailController _videoDetailController;
|
||||
final ScrollController _scrollController2 = ScrollController();
|
||||
|
||||
@@ -38,6 +41,7 @@ class _PagesPanelState extends State<PagesPanel> {
|
||||
super.initState();
|
||||
cid = widget.cid!;
|
||||
episodes = widget.pages;
|
||||
heroTag = widget.heroTag;
|
||||
_videoDetailController = Get.find<VideoDetailController>(tag: heroTag);
|
||||
currentIndex = episodes.indexWhere((Part e) => e.cid == cid);
|
||||
_videoDetailController.cid.listen((int p0) {
|
||||
|
||||
@@ -10,10 +10,12 @@ class SeasonPanel extends StatefulWidget {
|
||||
required this.ugcSeason,
|
||||
this.cid,
|
||||
required this.changeFuc,
|
||||
required this.heroTag,
|
||||
});
|
||||
final UgcSeason ugcSeason;
|
||||
final int? cid;
|
||||
final Function changeFuc;
|
||||
final String heroTag;
|
||||
|
||||
@override
|
||||
State<SeasonPanel> createState() => _SeasonPanelState();
|
||||
@@ -23,7 +25,8 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
||||
List<EpisodeItem>? episodes;
|
||||
late int cid;
|
||||
int currentIndex = 0;
|
||||
final String heroTag = Get.arguments['heroTag'];
|
||||
// final String heroTag = Get.arguments['heroTag'];
|
||||
late final String heroTag;
|
||||
late VideoDetailController _videoDetailController;
|
||||
final ScrollController _scrollController = ScrollController();
|
||||
|
||||
@@ -31,6 +34,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
cid = widget.cid!;
|
||||
heroTag = widget.heroTag;
|
||||
_videoDetailController = Get.find<VideoDetailController>(tag: heroTag);
|
||||
|
||||
/// 根据 cid 找到对应集,找到对应 episodes
|
||||
|
||||
Reference in New Issue
Block a user