opt pages

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-05 14:57:54 +08:00
parent b960359a39
commit 707d2f4b07
66 changed files with 1165 additions and 481 deletions

View File

@@ -6,19 +6,19 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class AiDetail extends CommonCollapseSlidePage {
final AiConclusionResult modelResult;
class AiConclusionPanel extends CommonCollapseSlidePage {
final AiConclusionResult item;
const AiDetail({
const AiConclusionPanel({
super.key,
required this.modelResult,
required this.item,
});
@override
State<AiDetail> createState() => _AiDetailState();
State<AiConclusionPanel> createState() => _AiDetailState();
}
class _AiDetailState extends CommonCollapseSlidePageState<AiDetail> {
class _AiDetailState extends CommonCollapseSlidePageState<AiConclusionPanel> {
@override
Widget buildPage(ThemeData theme) {
return Material(
@@ -56,12 +56,12 @@ class _AiDetailState extends CommonCollapseSlidePageState<AiDetail> {
controller: ScrollController(),
physics: const AlwaysScrollableScrollPhysics(),
slivers: [
if (widget.modelResult.summary?.isNotEmpty == true) ...[
if (widget.item.summary?.isNotEmpty == true) ...[
SliverToBoxAdapter(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 14),
child: SelectableText(
widget.modelResult.summary!,
widget.item.summary!,
style: const TextStyle(
fontSize: 15,
height: 1.5,
@@ -69,7 +69,7 @@ class _AiDetailState extends CommonCollapseSlidePageState<AiDetail> {
),
),
),
if (widget.modelResult.outline?.isNotEmpty == true)
if (widget.item.outline?.isNotEmpty == true)
SliverToBoxAdapter(
child: Divider(
height: 20,
@@ -78,7 +78,7 @@ class _AiDetailState extends CommonCollapseSlidePageState<AiDetail> {
),
),
],
if (widget.modelResult.outline?.isNotEmpty == true)
if (widget.item.outline?.isNotEmpty == true)
SliverPadding(
padding: EdgeInsets.only(
left: 14,
@@ -86,14 +86,14 @@ class _AiDetailState extends CommonCollapseSlidePageState<AiDetail> {
bottom: MediaQuery.paddingOf(context).bottom + 80,
),
sliver: SliverList.builder(
itemCount: widget.modelResult.outline!.length,
itemCount: widget.item.outline!.length,
itemBuilder: (context, index) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (index != 0) const SizedBox(height: 10),
SelectableText(
widget.modelResult.outline![index].title!,
widget.item.outline![index].title!,
style: const TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
@@ -101,10 +101,9 @@ class _AiDetailState extends CommonCollapseSlidePageState<AiDetail> {
),
),
const SizedBox(height: 6),
if (widget.modelResult.outline![index].partOutline
?.isNotEmpty ==
if (widget.item.outline![index].partOutline?.isNotEmpty ==
true)
...widget.modelResult.outline![index].partOutline!.map(
...widget.item.outline![index].partOutline!.map(
(item) => Wrap(
children: [
SelectableText.rich(
@@ -122,7 +121,6 @@ class _AiDetailState extends CommonCollapseSlidePageState<AiDetail> {
),
recognizer: TapGestureRecognizer()
..onTap = () {
// 跳转到指定位置
try {
Get.find<VideoDetailController>(
tag: Get.arguments['heroTag'])

View File

@@ -220,7 +220,7 @@ class PgcIntroController extends GetxController {
}
// 分享视频
void actionShareVideo(context) {
void actionShareVideo(BuildContext context) {
showDialog(
context: context,
builder: (_) {
@@ -360,7 +360,7 @@ class PgcIntroController extends GetxController {
}
// 修改分P或番剧分集
void changeSeasonOrbangu(epId, bvid, cid, aid, cover) {
void changeSeasonOrbangu(dynamic epId, bvid, cid, aid, cover) {
// 重新获取视频资源
this.epId = epId;
this.bvid = bvid;
@@ -420,7 +420,7 @@ class PgcIntroController extends GetxController {
SmartDialog.showToast(result['msg']);
}
Future<void> pgcUpdate(status) async {
Future<void> pgcUpdate(int status) async {
var result = await VideoHttp.pgcUpdate(
seasonId: [pgcItem.seasonId],
status: status,

View File

@@ -19,13 +19,13 @@ import 'package:flutter/services.dart' show HapticFeedback;
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:get/get.dart';
class PgcIntroPanel extends StatefulWidget {
class PgcIntroPage extends StatefulWidget {
final int? cid;
final String heroTag;
final Function showEpisodes;
final Function showIntroDetail;
const PgcIntroPanel({
const PgcIntroPage({
super.key,
this.cid,
required this.heroTag,
@@ -34,10 +34,10 @@ class PgcIntroPanel extends StatefulWidget {
});
@override
State<PgcIntroPanel> createState() => _PgcIntroPanelState();
State<PgcIntroPage> createState() => _PgcIntroPageState();
}
class _PgcIntroPanelState extends State<PgcIntroPanel>
class _PgcIntroPageState extends State<PgcIntroPage>
with AutomaticKeepAliveClientMixin {
late PgcIntroController pgcIntroController;
late VideoDetailController videoDetailCtr;

View File

@@ -13,11 +13,11 @@ import 'package:PiliPlus/utils/utils.dart';
import 'package:flutter/material.dart' hide TabBarView;
import 'package:get/get.dart';
class IntroDetail extends CommonCollapseSlidePage {
class PgcIntroPanel extends CommonCollapseSlidePage {
final PgcInfoModel item;
final List<VideoTagItem>? videoTags;
const IntroDetail({
const PgcIntroPanel({
super.key,
required this.item,
super.enableSlide = false,
@@ -25,10 +25,10 @@ class IntroDetail extends CommonCollapseSlidePage {
});
@override
State<IntroDetail> createState() => _IntroDetailState();
State<PgcIntroPanel> createState() => _IntroDetailState();
}
class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
class _IntroDetailState extends CommonCollapseSlidePageState<PgcIntroPanel> {
late final _tabController = TabController(length: 2, vsync: this);
final _controller = ScrollController();
@@ -106,13 +106,13 @@ class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
),
const SizedBox(height: 4),
Row(
spacing: 6,
children: [
StatView(
context: context,
theme: 'gray',
value: Utils.numFormat(widget.item.stat!.views),
),
const SizedBox(width: 6),
StatDanMu(
context: context,
theme: 'gray',

View File

@@ -551,6 +551,7 @@ class _VideoInfoState extends State<VideoInfo> {
clipBehavior: Clip.none,
children: [
Row(
spacing: 10,
children: [
StatView(
context: context,
@@ -560,7 +561,6 @@ class _VideoInfoState extends State<VideoInfo> {
: videoItem['stat']?.view ?? '-'),
textColor: theme.colorScheme.outline,
),
const SizedBox(width: 10),
StatDanMu(
context: context,
theme: 'gray',
@@ -569,7 +569,6 @@ class _VideoInfoState extends State<VideoInfo> {
: videoItem['stat']?.danmu ?? '-'),
textColor: theme.colorScheme.outline,
),
const SizedBox(width: 10),
Text(
Utils.dateFormat(
!widget.isLoading
@@ -581,16 +580,13 @@ class _VideoInfoState extends State<VideoInfo> {
color: theme.colorScheme.outline,
),
),
if (MineController.anonymity.value) ...<Widget>[
const SizedBox(width: 10),
if (MineController.anonymity.value)
Icon(
MdiIcons.incognito,
size: 15,
color: theme.colorScheme.outline,
semanticLabel: '无痕',
),
],
const SizedBox(width: 10),
if (videoIntroController.isShowOnlineTotal)
Obx(
() => Text(

View File

@@ -198,6 +198,16 @@ class _MediaListPanelState
width: boxConstraints.maxWidth,
height: boxConstraints.maxHeight,
),
if (item.badge?.text?.isNotEmpty == true)
PBadge(
text: item.badge?.text,
right: 6.0,
top: 6.0,
type: switch (item.badge?.text) {
'充电专属' => PBadgeType.error,
_ => PBadgeType.primary,
},
),
PBadge(
text: Utils.timeFormat(item.duration!),
right: 6.0,
@@ -216,7 +226,6 @@ class _MediaListPanelState
children: [
Text(
item.title!,
textAlign: TextAlign.start,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
@@ -227,6 +236,19 @@ class _MediaListPanelState
: null,
),
),
if (item.type == 24 &&
item.intro?.isNotEmpty == true) ...[
const SizedBox(height: 3),
Text(
item.intro!,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 13,
color: theme.colorScheme.outline,
),
),
],
const Spacer(),
Text(
item.upper!.name!,
@@ -237,24 +259,26 @@ class _MediaListPanelState
color: theme.colorScheme.outline,
),
),
const SizedBox(height: 3),
Row(
children: [
StatView(
context: context,
theme: 'gray',
value: Utils.numFormat(
item.cntInfo!.play!),
),
const SizedBox(width: 8),
StatDanMu(
context: context,
theme: 'gray',
value: Utils.numFormat(
item.cntInfo!.danmaku!),
),
],
),
if (item.type == 2) ...[
const SizedBox(height: 3),
Row(
spacing: 8,
children: [
StatView(
context: context,
theme: 'gray',
value: Utils.numFormat(
item.cntInfo!.play!),
),
StatDanMu(
context: context,
theme: 'gray',
value: Utils.numFormat(
item.cntInfo!.danmaku!),
),
],
),
],
],
),
),

View File

@@ -218,7 +218,7 @@ class _PayCoinsPageState extends State<PayCoinsPage>
});
}
Widget _buildBody(isV) => Stack(
Widget _buildBody(bool isV) => Stack(
key: _key,
clipBehavior: Clip.none,
alignment: Alignment.center,

View File

@@ -25,7 +25,7 @@ class VideoReplyReplyPanel extends CommonSlidePage {
required this.rpid,
this.dialog,
this.firstFloor,
this.source,
required this.isVideoDetail,
required this.replyType,
this.isDialogue = false,
this.onViewImage,
@@ -37,7 +37,7 @@ class VideoReplyReplyPanel extends CommonSlidePage {
final int rpid;
final int? dialog;
final ReplyInfo? firstFloor;
final String? source;
final bool isVideoDetail;
final int replyType;
final bool isDialogue;
final VoidCallback? onViewImage;
@@ -118,7 +118,7 @@ class _VideoReplyReplyPanelState
resizeToAvoidBottomInset: false,
body: Column(
children: [
widget.source == 'videoDetail'
widget.isVideoDetail
? Container(
height: 45,
decoration: BoxDecoration(
@@ -439,7 +439,7 @@ class _VideoReplyReplyPanelState
rpid: replyItem.root.toInt(),
dialog: replyItem.dialog.toInt(),
replyType: widget.replyType,
source: 'videoDetail',
isVideoDetail: true,
isDialogue: true,
),
),

View File

@@ -1799,7 +1799,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
] else if (videoDetailController.videoType ==
SearchType.media_bangumi)
Obx(
() => PgcIntroPanel(
() => PgcIntroPage(
key: pgcPanelKey,
heroTag: heroTag,
cid: videoDetailController.cid.value,
@@ -2027,7 +2027,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
rpid: rpid,
firstFloor: replyItem,
replyType: 1,
source: 'videoDetail',
isVideoDetail: true,
onViewImage: videoDetailController.onViewImage,
onDismissed: videoDetailController.onDismissed,
),
@@ -2040,7 +2040,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
videoDetailController.childKey.currentState?.showBottomSheet(
backgroundColor: Colors.transparent,
(context) =>
AiDetail(modelResult: videoIntroController.aiConclusionResult!),
AiConclusionPanel(item: videoIntroController.aiConclusionResult!),
);
}
@@ -2048,7 +2048,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
PgcInfoModel videoDetail, List<VideoTagItem>? videoTags) {
videoDetailController.childKey.currentState?.showBottomSheet(
backgroundColor: Colors.transparent,
(context) => IntroDetail(
(context) => PgcIntroPanel(
item: videoDetail,
videoTags: videoTags,
),