Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-15 12:18:36 +08:00
parent 52151765f8
commit 831a3052fa
12 changed files with 47 additions and 39 deletions

View File

@@ -6,6 +6,7 @@ import 'package:PiliPlus/models_new/pgc/pgc_info_model/new_ep.dart';
import 'package:PiliPlus/models_new/video/video_detail/episode.dart'
hide EpisodeItem;
import 'package:PiliPlus/pages/video/controller.dart';
import 'package:PiliPlus/utils/extension.dart';
import 'package:PiliPlus/utils/storage_pref.dart';
import 'package:PiliPlus/utils/utils.dart';
import 'package:flutter/material.dart';
@@ -86,7 +87,7 @@ class _PgcPanelState extends State<PgcPanel> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final theme = Theme.of(context).colorScheme;
final currEpisode = widget.pages[currentIndex];
final isPugv = currEpisode.from == 'pugv';
return Column(
@@ -101,10 +102,7 @@ class _PgcPanelState extends State<PgcPanel> {
child: Text(
' 正在播放:${currEpisode.longTitle ?? currEpisode.title}',
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 12,
color: theme.colorScheme.outline,
),
style: TextStyle(fontSize: 12, color: theme.outline),
),
),
const SizedBox(width: 10),
@@ -149,12 +147,10 @@ class _PgcPanelState extends State<PgcPanel> {
);
}
Widget _buildItem(ThemeData theme, bool isPugv, int index) {
Widget _buildItem(ColorScheme theme, bool isPugv, int index) {
final item = widget.pages[index];
final hasLongTitle = item.longTitle?.isNotEmpty == true;
final color = index == currentIndex
? theme.colorScheme.primary
: theme.colorScheme.onSurface;
final color = index == currentIndex ? theme.primary : theme.onSurface;
return Container(
width: 150,
height: 60,
@@ -162,7 +158,7 @@ class _PgcPanelState extends State<PgcPanel> {
? const EdgeInsets.only(right: 10)
: null,
child: Material(
color: theme.colorScheme.onInverseSurface,
color: theme.onInverseSurface,
borderRadius: const BorderRadius.all(Radius.circular(6)),
child: InkWell(
borderRadius: const BorderRadius.all(Radius.circular(6)),
@@ -192,7 +188,7 @@ class _PgcPanelState extends State<PgcPanel> {
padding: const EdgeInsets.only(right: 6),
child: Image.asset(
'assets/images/live.png',
color: theme.colorScheme.primary,
color: theme.primary,
height: 12,
semanticLabel: "正在播放:",
),
@@ -222,7 +218,11 @@ class _PgcPanelState extends State<PgcPanel> {
item.badge!,
style: TextStyle(
fontSize: 11,
color: theme.colorScheme.primary,
color: switch (item.badge) {
'限免' => theme.freeColor,
'预告' => theme.onSurfaceVariant,
_ => theme.primary,
},
),
),
],