Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-23 16:47:11 +08:00
parent 148e0872b4
commit 418a1e8d39
821 changed files with 29467 additions and 25520 deletions

View File

@@ -60,10 +60,11 @@ class ActionRowLineItem extends StatelessWidget {
child: Text(
text!,
style: TextStyle(
fontSize: 13,
color: selectStatus
? theme.colorScheme.onSecondaryContainer
: theme.colorScheme.outline),
fontSize: 13,
color: selectStatus
? theme.colorScheme.onSecondaryContainer
: theme.colorScheme.outline,
),
),
),
],

View File

@@ -44,8 +44,9 @@ class _PagesPanelState extends State<PagesPanel> {
@override
void initState() {
super.initState();
_videoDetailController =
Get.find<VideoDetailController>(tag: widget.heroTag);
_videoDetailController = Get.find<VideoDetailController>(
tag: widget.heroTag,
);
if (widget.list == null) {
cid = widget.videoIntroController.lastPlayCid.value;
pageIndex = pages.indexWhere((Part e) => e.cid == cid);
@@ -68,8 +69,9 @@ class _PagesPanelState extends State<PagesPanel> {
}
const double itemWidth = 150;
final double targetOffset = (pageIndex * itemWidth - itemWidth / 2).clamp(
_scrollController.position.minScrollExtent,
_scrollController.position.maxScrollExtent);
_scrollController.position.minScrollExtent,
_scrollController.position.maxScrollExtent,
);
_scrollController.animateTo(
targetOffset,
duration: const Duration(milliseconds: 300),
@@ -162,7 +164,10 @@ class _PagesPanelState extends State<PagesPanel> {
widget.cover,
);
if (widget.list != null &&
widget.videoIntroController.videoDetail.value
widget
.videoIntroController
.videoDetail
.value
.ugcSeason !=
null) {
_videoDetailController.seasonCid = pages.first.cid;
@@ -179,7 +184,7 @@ class _PagesPanelState extends State<PagesPanel> {
height: 12,
semanticLabel: "正在播放:",
),
const SizedBox(width: 6)
const SizedBox(width: 6),
],
Expanded(
child: Text(
@@ -202,7 +207,7 @@ class _PagesPanelState extends State<PagesPanel> {
);
},
),
)
),
],
);
}

View File

@@ -40,19 +40,20 @@ class _SeasonPanelState extends State<SeasonPanel> {
@override
void initState() {
super.initState();
_videoDetailController =
Get.find<VideoDetailController>(tag: widget.heroTag);
_videoDetailController = Get.find<VideoDetailController>(
tag: widget.heroTag,
);
_videoDetailController.seasonCid =
videoIntroController.lastPlayCid.value != 0
? (videoDetail.pages?.isNotEmpty == true
? videoDetail.isPageReversed
? (videoDetail.pages?.isNotEmpty == true
? videoDetail.isPageReversed
? videoDetail.pages!.last.cid
: videoDetail.pages!.first.cid
: videoIntroController.lastPlayCid.value)
: videoDetail.isPageReversed
? videoDetail.pages!.last.cid
: videoDetail.pages!.first.cid;
: videoIntroController.lastPlayCid.value)
: videoDetail.isPageReversed
? videoDetail.pages!.last.cid
: videoDetail.pages!.first.cid;
/// 根据 cid 找到对应集,找到对应 episodes
/// 有多个episodes时只显示其中一个
@@ -63,7 +64,8 @@ class _SeasonPanelState extends State<SeasonPanel> {
/// 取对应 season_id 的 episodes
currentIndex.value = episodes.indexWhere(
(EpisodeItem e) => e.cid == _videoDetailController.seasonCid);
(EpisodeItem e) => e.cid == _videoDetailController.seasonCid,
);
_listener = _videoDetailController.cid.listen((int cid) {
if (_videoDetailController.seasonCid != cid) {
bool isPart =
@@ -74,7 +76,8 @@ class _SeasonPanelState extends State<SeasonPanel> {
}
_findEpisode();
currentIndex.value = episodes.indexWhere(
(EpisodeItem e) => e.cid == _videoDetailController.seasonCid);
(EpisodeItem e) => e.cid == _videoDetailController.seasonCid,
);
});
}
@@ -104,13 +107,13 @@ class _SeasonPanelState extends State<SeasonPanel> {
onTap: widget.onTap == false
? null
: () => widget.showEpisodes(
_videoDetailController.seasonIndex.value,
videoDetail.ugcSeason,
null,
_videoDetailController.bvid,
null,
_videoDetailController.seasonCid,
),
_videoDetailController.seasonIndex.value,
videoDetail.ugcSeason,
null,
_videoDetailController.bvid,
null,
_videoDetailController.seasonCid,
),
child: Padding(
padding: const EdgeInsets.fromLTRB(8, 12, 8, 12),
child: Row(
@@ -143,7 +146,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
Icons.arrow_forward_ios_outlined,
size: 13,
semanticLabel: '查看',
)
),
],
),
),