Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-07-24 21:07:26 +08:00
parent f1b79eeafc
commit 56ca0cade4
11 changed files with 137 additions and 117 deletions

View File

@@ -101,24 +101,21 @@ class _PagesPanelState extends State<PagesPanel> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final colorScheme = ColorScheme.of(context);
return Column(
children: <Widget>[
children: [
if (widget.showEpisodes != null)
Padding(
padding: const EdgeInsets.only(top: 8, bottom: 2),
padding: const .only(top: 8, bottom: 2),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: .spaceBetween,
children: [
const Text('视频选集 '),
Expanded(
child: Text(
' 正在播放:${pages[pageIndex].part}',
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12,
color: theme.colorScheme.outline,
),
overflow: .ellipsis,
style: TextStyle(fontSize: 12, color: colorScheme.outline),
),
),
const SizedBox(width: 10),
@@ -126,7 +123,7 @@ class _PagesPanelState extends State<PagesPanel> {
height: 34,
child: TextButton(
style: const ButtonStyle(
padding: WidgetStatePropertyAll(EdgeInsets.zero),
padding: WidgetStatePropertyAll(.zero),
),
onPressed: () => widget.showEpisodes!(
null,
@@ -146,27 +143,27 @@ class _PagesPanelState extends State<PagesPanel> {
),
),
SizedBox(
height: 35,
height: 45,
child: ListView.builder(
key: PageStorageKey(widget.bvid),
controller: _scrollController,
scrollDirection: Axis.horizontal,
scrollDirection: .horizontal,
itemCount: pages.length,
itemExtent: 150,
padding: EdgeInsets.zero,
itemBuilder: (BuildContext context, int i) {
bool isCurrentIndex = pageIndex == i;
final item = pages[i];
padding: .zero,
itemBuilder: (context, index) {
bool isCurrentIndex = pageIndex == index;
final item = pages[index];
return Container(
width: 150,
margin: i != pages.length - 1
? const EdgeInsets.only(right: 10)
margin: index != pages.length - 1
? const .only(right: 10)
: null,
child: Material(
color: theme.colorScheme.onInverseSurface,
borderRadius: const BorderRadius.all(Radius.circular(6)),
color: colorScheme.onInverseSurface,
borderRadius: const .all(.circular(6)),
child: InkWell(
borderRadius: const BorderRadius.all(Radius.circular(6)),
borderRadius: const .all(.circular(6)),
onTap: () {
if (widget.onDownload case final onDownload?) {
if (onDownload(item) && mounted) {
@@ -177,6 +174,7 @@ class _PagesPanelState extends State<PagesPanel> {
if (widget.showEpisodes == null) {
Get.back();
}
if (isCurrentIndex) return;
widget.ugcIntroController.onChangeEpisode(
item
..bvid ??= widget.bvid
@@ -193,41 +191,52 @@ class _PagesPanelState extends State<PagesPanel> {
}
},
child: Padding(
padding: const EdgeInsets.all(8),
child: Row(
children: <Widget>[
if (isCurrentIndex) ...<Widget>[
Image.asset(
Assets.livingStatic,
color: theme.colorScheme.primary,
height: 12,
cacheHeight: 12.cacheSize(context),
semanticLabel: "正在播放:",
),
const SizedBox(width: 6),
],
Expanded(
child: Text(
item.part!,
maxLines: 1,
style: TextStyle(
fontSize: 13,
color: isCurrentIndex
? theme.colorScheme.primary
: theme.colorScheme.onSurface,
),
overflow: TextOverflow.ellipsis,
),
padding: const .symmetric(horizontal: 8),
child: Align(
alignment: .centerLeft,
child: Text.rich(
maxLines: 2,
overflow: .ellipsis,
style: TextStyle(
height: 1.1,
fontSize: 13,
color: isCurrentIndex
? colorScheme.primary
: colorScheme.onSurface,
),
if (widget.cidSet?.contains(item.cid) ?? false)
Icon(
size: 13,
color: theme.colorScheme.secondary.withValues(
alpha: 0.8,
),
FontAwesomeIcons.circleDown,
),
],
strutStyle: const .new(height: 1.1, fontSize: 13),
TextSpan(
children: [
if (isCurrentIndex)
WidgetSpan(
alignment: .middle,
child: Padding(
padding: const .only(right: 6),
child: Image.asset(
Assets.livingStatic,
color: colorScheme.primary,
height: 12,
cacheHeight: 12.cacheSize(context),
semanticLabel: "正在播放:",
),
),
)
else if (widget.cidSet?.contains(item.cid) ??
false)
WidgetSpan(
alignment: .middle,
child: Icon(
size: 13,
color: colorScheme.secondary.withValues(
alpha: .8,
),
FontAwesomeIcons.circleDown,
),
),
TextSpan(text: item.part),
],
),
),
),
),
),