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

@@ -35,8 +35,8 @@ class PgcIntroController extends CommonIntroController {
late dynamic type =
Get.parameters['type'] == '1' || Get.parameters['type'] == '4'
? '追番'
: '追剧';
? '追番'
: '追剧';
final PgcInfoModel pgcItem = Get.arguments['pgcItem'];
@@ -190,65 +190,66 @@ class PgcIntroController extends CommonIntroController {
// 分享视频
void actionShareVideo(BuildContext context) {
showDialog(
context: context,
builder: (_) {
String videoUrl = '${HttpString.baseUrl}/bangumi/play/ep$epId';
return AlertDialog(
clipBehavior: Clip.hardEdge,
contentPadding: const EdgeInsets.symmetric(vertical: 12),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
dense: true,
title: const Text(
'复制链接',
style: TextStyle(fontSize: 14),
),
onTap: () {
Get.back();
Utils.copyText(videoUrl);
},
context: context,
builder: (_) {
String videoUrl = '${HttpString.baseUrl}/bangumi/play/ep$epId';
return AlertDialog(
clipBehavior: Clip.hardEdge,
contentPadding: const EdgeInsets.symmetric(vertical: 12),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
dense: true,
title: const Text(
'复制链接',
style: TextStyle(fontSize: 14),
),
ListTile(
dense: true,
title: const Text(
'其它app打开',
style: TextStyle(fontSize: 14),
),
onTap: () {
Get.back();
PageUtils.launchURL(videoUrl);
},
onTap: () {
Get.back();
Utils.copyText(videoUrl);
},
),
ListTile(
dense: true,
title: const Text(
'其它app打开',
style: TextStyle(fontSize: 14),
),
ListTile(
dense: true,
title: const Text(
'分享视频',
style: TextStyle(fontSize: 14),
),
onTap: () {
Get.back();
Utils.shareText(videoUrl);
},
onTap: () {
Get.back();
PageUtils.launchURL(videoUrl);
},
),
ListTile(
dense: true,
title: const Text(
'分享视频',
style: TextStyle(fontSize: 14),
),
ListTile(
dense: true,
title: const Text(
'分享至动态',
style: TextStyle(fontSize: 14),
),
onTap: () {
Get.back();
EpisodeItem? item = pgcItem.episodes
?.firstWhereOrNull((item) => item.epId == epId);
showModalBottomSheet(
context: context,
isScrollControlled: true,
useSafeArea: true,
builder: (context) => RepostPanel(
rid: epId,
/**
onTap: () {
Get.back();
Utils.shareText(videoUrl);
},
),
ListTile(
dense: true,
title: const Text(
'分享至动态',
style: TextStyle(fontSize: 14),
),
onTap: () {
Get.back();
EpisodeItem? item = pgcItem.episodes?.firstWhereOrNull(
(item) => item.epId == epId,
);
showModalBottomSheet(
context: context,
isScrollControlled: true,
useSafeArea: true,
builder: (context) => RepostPanel(
rid: epId,
/**
* 1番剧 // 4097
2电影 // 4098
3纪录片 // 4101
@@ -257,64 +258,66 @@ class PgcIntroController extends CommonIntroController {
6漫画
7综艺 // 4099
*/
dynType: switch (Get.parameters['type']) {
'1' => 4097,
'2' => 4098,
'3' => 4101,
'4' => 4100,
'5' || '7' => 4099,
_ => -1,
},
pic: pgcItem.cover,
title:
'${pgcItem.title}${item != null ? '\n${item.showTitle}' : ''}',
uname: '',
),
dynType: switch (Get.parameters['type']) {
'1' => 4097,
'2' => 4098,
'3' => 4101,
'4' => 4100,
'5' || '7' => 4099,
_ => -1,
},
pic: pgcItem.cover,
title:
'${pgcItem.title}${item != null ? '\n${item.showTitle}' : ''}',
uname: '',
),
);
},
),
ListTile(
dense: true,
title: const Text(
'分享至消息',
style: TextStyle(fontSize: 14),
),
onTap: () {
Get.back();
try {
EpisodeItem item = pgcItem.episodes!.firstWhere(
(item) => item.epId == epId,
);
},
),
ListTile(
dense: true,
title: const Text(
'分享至消息',
style: TextStyle(fontSize: 14),
),
onTap: () {
Get.back();
try {
EpisodeItem item = pgcItem.episodes!
.firstWhere((item) => item.epId == epId);
final title = '${item.title!} ${item.showTitle}';
PageUtils.pmShare(
context,
content: {
"id": epId!.toString(),
"title": title,
"url": item.shareUrl,
"headline": title,
"source": 16,
"thumb": item.cover,
"source_desc": switch (pgcItem.type) {
1 => '番剧',
2 => '电影',
3 => '纪录片',
4 => '国创',
5 => '电视剧',
6 => '漫画',
7 => '综艺',
_ => null,
}
final title = '${item.title!} ${item.showTitle}';
PageUtils.pmShare(
context,
content: {
"id": epId!.toString(),
"title": title,
"url": item.shareUrl,
"headline": title,
"source": 16,
"thumb": item.cover,
"source_desc": switch (pgcItem.type) {
1 => '番剧',
2 => '电影',
3 => '纪录片',
4 => '国创',
5 => '电视剧',
6 => '漫画',
7 => '综艺',
_ => null,
},
);
} catch (e) {
SmartDialog.showToast(e.toString());
}
},
),
],
),
);
});
},
);
} catch (e) {
SmartDialog.showToast(e.toString());
}
},
),
],
),
);
},
);
}
// 修改分P或番剧分集
@@ -409,10 +412,12 @@ class PgcIntroController extends CommonIntroController {
bool prevPlay() {
List episodes = pgcItem.episodes!;
VideoDetailController videoDetailCtr =
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
int currentIndex =
episodes.indexWhere((e) => e.cid == videoDetailCtr.cid.value);
VideoDetailController videoDetailCtr = Get.find<VideoDetailController>(
tag: Get.arguments['heroTag'],
);
int currentIndex = episodes.indexWhere(
(e) => e.cid == videoDetailCtr.cid.value,
);
int prevIndex = currentIndex - 1;
PlayRepeat playRepeat = videoDetailCtr.plPlayerController.playRepeat;
if (prevIndex < 0) {
@@ -435,12 +440,14 @@ class PgcIntroController extends CommonIntroController {
bool nextPlay() {
try {
List episodes = pgcItem.episodes!;
VideoDetailController videoDetailCtr =
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
VideoDetailController videoDetailCtr = Get.find<VideoDetailController>(
tag: Get.arguments['heroTag'],
);
PlayRepeat playRepeat = videoDetailCtr.plPlayerController.playRepeat;
int currentIndex =
episodes.indexWhere((e) => e.cid == videoDetailCtr.cid.value);
int currentIndex = episodes.indexWhere(
(e) => e.cid == videoDetailCtr.cid.value,
);
int nextIndex = currentIndex + 1;
// 列表循环
if (nextIndex >= episodes.length) {

View File

@@ -96,7 +96,7 @@ class _PgcIntroPageState extends State<PgcIntroPage>
imgList: [
SourceModel(
url: item.cover!,
)
),
],
onDismissed: videoDetailCtr.onDismissed,
);
@@ -124,7 +124,9 @@ class _PgcIntroPageState extends State<PgcIntroPage>
Expanded(
child: GestureDetector(
onTap: () => widget.showIntroDetail(
item, pgcIntroController.videoTags.value),
item,
pgcIntroController.videoTags.value,
),
behavior: HitTestBehavior.opaque,
child: SizedBox(
height: isLandscape ? 115 : 115 / 0.75,
@@ -182,7 +184,8 @@ class _PgcIntroPageState extends State<PgcIntroPage>
} else {
pgcIntroController
.pgcUpdate(
followStatus);
followStatus,
);
}
},
);
@@ -214,7 +217,7 @@ class _PgcIntroPageState extends State<PgcIntroPage>
if (isLandscape) ...[
areasAndPubTime(theme, item),
newEpDesc(theme, item),
]
],
],
),
SizedBox(height: isLandscape ? 2 : 6),
@@ -251,7 +254,7 @@ class _PgcIntroPageState extends State<PgcIntroPage>
changeFuc: pgcIntroController.changeSeasonOrbangu,
showEpisodes: widget.showEpisodes,
newEp: item.newEp,
)
),
],
],
),
@@ -259,8 +262,11 @@ class _PgcIntroPageState extends State<PgcIntroPage>
);
}
Widget actionGrid(ThemeData theme, PgcInfoModel item,
PgcIntroController pgcIntroController) {
Widget actionGrid(
ThemeData theme,
PgcInfoModel item,
PgcIntroController pgcIntroController,
) {
return SizedBox(
height: 48,
child: Row(
@@ -275,7 +281,8 @@ class _PgcIntroPageState extends State<PgcIntroPage>
semanticsLabel: '点赞',
text: NumUtil.numFormat(item.stat!.likes),
needAnim: true,
hasTriple: pgcIntroController.hasLike.value &&
hasTriple:
pgcIntroController.hasLike.value &&
pgcIntroController.hasCoin &&
pgcIntroController.hasFav.value,
callBack: (start) {
@@ -308,8 +315,10 @@ class _PgcIntroPageState extends State<PgcIntroPage>
icon: const Icon(FontAwesomeIcons.star),
selectIcon: const Icon(FontAwesomeIcons.solidStar),
onTap: () => pgcIntroController.showFavBottomSheet(context),
onLongPress: () => pgcIntroController.showFavBottomSheet(context,
type: 'longPress'),
onLongPress: () => pgcIntroController.showFavBottomSheet(
context,
type: 'longPress',
),
selectStatus: pgcIntroController.hasFav.value,
semanticsLabel: '收藏',
text: NumUtil.numFormat(item.stat!.favorite),

View File

@@ -55,7 +55,10 @@ class _IntroDetailState extends CommonCollapseSlidePageState<PgcIntroPanel> {
isScrollable: true,
tabAlignment: TabAlignment.start,
dividerColor: Colors.transparent,
tabs: const [Tab(text: '详情'), Tab(text: '点评')],
tabs: const [
Tab(text: '详情'),
Tab(text: '点评'),
],
onTap: (index) {
if (!_tabController.indexIsChanging) {
if (index == 0) {
@@ -176,7 +179,7 @@ class _IntroDetailState extends CommonCollapseSlidePageState<PgcIntroPanel> {
),
)
.toList(),
)
),
],
],
);

View File

@@ -72,8 +72,10 @@ class _PgcPanelState extends State<PgcPanel> {
void scrollToIndex() {
WidgetsBinding.instance.addPostFrameCallback((_) {
listViewScrollCtr.animateTo(
(currentIndex * 150.0).clamp(listViewScrollCtr.position.minScrollExtent,
listViewScrollCtr.position.maxScrollExtent),
(currentIndex * 150.0).clamp(
listViewScrollCtr.position.minScrollExtent,
listViewScrollCtr.position.maxScrollExtent,
),
duration: const Duration(milliseconds: 500),
curve: Curves.easeInOut,
);
@@ -162,7 +164,9 @@ class _PgcPanelState extends State<PgcPanel> {
},
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 8, horizontal: 10),
vertical: 8,
horizontal: 10,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
@@ -175,21 +179,24 @@ class _PgcPanelState extends State<PgcPanel> {
height: 12,
semanticLabel: "正在播放:",
),
const SizedBox(width: 6)
const SizedBox(width: 6),
],
Expanded(
child: Text(
item.title ?? '${index + 1}',
maxLines: (item.longTitle != null &&
item.longTitle != '')
? 1
: 2,
style: TextStyle(
child: Text(
item.title ?? '${index + 1}',
maxLines:
(item.longTitle != null &&
item.longTitle != '')
? 1
: 2,
style: TextStyle(
fontSize: 13,
color: index == currentIndex
? theme.colorScheme.primary
: theme.colorScheme.onSurface),
)),
: theme.colorScheme.onSurface,
),
),
),
const SizedBox(width: 2),
if (item.badge != null) ...[
const Spacer(),
@@ -207,7 +214,7 @@ class _PgcPanelState extends State<PgcPanel> {
color: theme.colorScheme.primary,
),
),
]
],
],
),
if (item.longTitle != null &&
@@ -217,13 +224,14 @@ class _PgcPanelState extends State<PgcPanel> {
item.longTitle!,
maxLines: 1,
style: TextStyle(
fontSize: 13,
color: index == currentIndex
? theme.colorScheme.primary
: theme.colorScheme.onSurface),
fontSize: 13,
color: index == currentIndex
? theme.colorScheme.primary
: theme.colorScheme.onSurface,
),
overflow: TextOverflow.ellipsis,
)
]
),
],
],
),
),