* mod: pgc episode title

* opt: ColorScheme.of

* mod: mpv api version

* opt: log handler

* opt: ext
This commit is contained in:
My-Responsitories
2026-05-15 01:59:54 +00:00
committed by GitHub
parent 24769e144f
commit b33fdf14af
30 changed files with 99 additions and 191 deletions

View File

@@ -185,7 +185,7 @@ class _LocalIntroPanelState extends State<LocalIntroPanel>
),
Align(
alignment: Alignment.bottomRight,
child: entry.moreBtn(theme),
child: entry.moreBtn(theme.colorScheme),
),
],
),

View File

@@ -20,7 +20,6 @@ import 'package:PiliPlus/pages/video/pay_coins/view.dart';
import 'package:PiliPlus/pages/video/reply/controller.dart';
import 'package:PiliPlus/plugin/pl_player/models/play_repeat.dart';
import 'package:PiliPlus/services/service_locator.dart';
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
import 'package:PiliPlus/utils/feed_back.dart';
import 'package:PiliPlus/utils/global_data.dart';
import 'package:PiliPlus/utils/id_utils.dart';
@@ -28,6 +27,7 @@ import 'package:PiliPlus/utils/page_utils.dart';
import 'package:PiliPlus/utils/platform_utils.dart';
import 'package:PiliPlus/utils/share_utils.dart';
import 'package:PiliPlus/utils/utils.dart';
import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart' show kDebugMode;
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
@@ -181,8 +181,14 @@ class PgcIntroController extends CommonIntroController {
style: TextStyle(fontSize: 14),
),
onTap: () {
final item = pgcItem.episodes?.firstWhereOrNull(
(item) => item.epId == epId,
);
Get.back();
ShareUtils.shareText(videoUrl);
ShareUtils.shareText(
'${pgcItem.title}${item != null ? ' ${item.showTitle}' : ''}'
' - $videoUrl',
);
},
),
ListTile(
@@ -193,7 +199,7 @@ class PgcIntroController extends CommonIntroController {
),
onTap: () {
Get.back();
EpisodeItem? item = pgcItem.episodes?.firstWhereOrNull(
final item = pgcItem.episodes?.firstWhereOrNull(
(item) => item.epId == epId,
);
showModalBottomSheet(

View File

@@ -9,7 +9,6 @@ import 'package:PiliPlus/common/widgets/image_viewer/hero.dart';
import 'package:PiliPlus/common/widgets/stat/stat.dart';
import 'package:PiliPlus/models/common/image_preview_type.dart';
import 'package:PiliPlus/models/common/image_type.dart';
import 'package:PiliPlus/models/common/stat_type.dart';
import 'package:PiliPlus/models_new/pgc/pgc_info_model/result.dart';
import 'package:PiliPlus/pages/video/controller.dart';
import 'package:PiliPlus/pages/video/introduction/pgc/controller.dart';
@@ -60,7 +59,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
@override
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
final colorScheme = ColorScheme.of(context);
final item = introController.pgcItem;
final isLandscape = widget.isLandscape;
Widget sliver = SliverToBoxAdapter(
@@ -71,13 +70,13 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 10,
children: [
_buildCover(theme, isLandscape, item),
Expanded(child: _buildInfoPanel(isLandscape, theme, item)),
_buildCover(colorScheme, isLandscape, item),
Expanded(child: _buildInfoPanel(isLandscape, colorScheme, item)),
],
),
const SizedBox(height: 6),
// 点赞收藏转发 布局样式2
if (introController.isPgc) actionGrid(theme, item, introController),
if (introController.isPgc) actionGrid(item, introController),
// 番剧分集
if (item.episodes?.isNotEmpty == true)
PgcPanel(
@@ -94,18 +93,16 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
if (!introController.isPgc) {
final brief = _buildBrief(item);
if (brief != null) {
sliver = SliverMainAxisGroup(
slivers: [
sliver,
brief,
],
);
sliver = SliverMainAxisGroup(slivers: [sliver, brief]);
}
}
return SliverPadding(
padding:
const EdgeInsets.all(Style.safeSpace) +
const EdgeInsets.only(bottom: 50),
padding: const .fromLTRB(
Style.safeSpace,
Style.safeSpace,
Style.safeSpace,
Style.safeSpace + 50,
),
sliver: sliver,
);
}
@@ -118,11 +115,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
final imgWidth = maxWidth - padding;
padding = padding / 2;
return SliverPadding(
padding: EdgeInsetsGeometry.only(
top: 10,
left: padding,
right: padding,
),
padding: .only(top: 10, left: padding, right: padding),
sliver: SliverMainAxisGroup(
slivers: img.map((e) {
return SliverToBoxAdapter(
@@ -140,7 +133,11 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
return null;
}
Widget _buildCover(ThemeData theme, bool isLandscape, PgcInfoModel item) {
Widget _buildCover(
ColorScheme colorScheme,
bool isLandscape,
PgcInfoModel item,
) {
return Stack(
clipBehavior: Clip.none,
children: [
@@ -180,11 +177,11 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
? const Icon(Icons.star_rounded)
: const Icon(Icons.star_border_rounded),
bgColor: isFav
? theme.colorScheme.secondaryContainer
: theme.colorScheme.onInverseSurface,
? colorScheme.secondaryContainer
: colorScheme.onInverseSurface,
iconColor: isFav
? theme.colorScheme.onSecondaryContainer
: theme.colorScheme.onSurfaceVariant,
? colorScheme.onSecondaryContainer
: colorScheme.onSurfaceVariant,
);
}),
),
@@ -192,7 +189,11 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
);
}
Widget _buildInfoPanel(bool isLandscape, ThemeData theme, PgcInfoModel item) {
Widget _buildInfoPanel(
bool isLandscape,
ColorScheme colorScheme,
PgcInfoModel item,
) {
if (introController.isPgc) {
Widget subBtn() => Obx(
() {
@@ -206,10 +207,8 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
vertical: 10,
),
visualDensity: VisualDensity.compact,
foregroundColor: isFollowed ? theme.colorScheme.outline : null,
backgroundColor: isFollowed
? theme.colorScheme.onInverseSurface
: null,
foregroundColor: isFollowed ? colorScheme.outline : null,
backgroundColor: isFollowed ? colorScheme.onInverseSurface : null,
),
onPressed: followStatus == -1
? null
@@ -259,10 +258,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
List<Widget> desc() => [
Text(
item.newEp!.desc!,
style: TextStyle(
fontSize: 12,
color: theme.colorScheme.outline,
),
style: TextStyle(fontSize: 12, color: colorScheme.outline),
),
Text.rich(
TextSpan(
@@ -274,24 +270,15 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
),
],
),
style: TextStyle(
fontSize: 12,
color: theme.colorScheme.outline,
),
style: TextStyle(fontSize: 12, color: colorScheme.outline),
),
];
Widget stat() => Wrap(
spacing: 6,
runSpacing: 2,
children: [
StatWidget(
type: StatType.play,
value: item.stat!.view,
),
StatWidget(
type: StatType.danmaku,
value: item.stat!.danmaku,
),
StatWidget(type: .play, value: item.stat!.view),
StatWidget(type: .danmaku, value: item.stat!.danmaku),
if (isLandscape) ...desc(),
],
);
@@ -314,10 +301,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
Expanded(
child: Text(
'简介:${item.evaluate}',
style: TextStyle(
fontSize: 13,
color: theme.colorScheme.outline,
),
style: TextStyle(fontSize: 13, color: colorScheme.outline),
),
),
],
@@ -351,7 +335,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
role,
style: TextStyle(
fontSize: 12,
color: theme.colorScheme.outline,
color: colorScheme.outline,
),
),
],
@@ -391,7 +375,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
item.subtitle!,
style: TextStyle(
fontSize: 13,
color: theme.colorScheme.onSurfaceVariant,
color: colorScheme.onSurfaceVariant,
),
),
],
@@ -400,7 +384,6 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
}
Widget actionGrid(
ThemeData theme,
PgcInfoModel item,
PgcIntroController introController,
) {