mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-27 22:10:14 +08:00
opt view later
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -104,17 +104,20 @@ class DynamicPanel extends StatelessWidget {
|
||||
BuildContext context,
|
||||
Function(BuildContext) morePanel,
|
||||
) {
|
||||
late String? title;
|
||||
late String? cover;
|
||||
String? title;
|
||||
String? cover;
|
||||
String? bvid;
|
||||
late final major = item.modules.moduleDynamic?.major;
|
||||
switch (item.type) {
|
||||
case 'DYNAMIC_TYPE_AV':
|
||||
title = major?.archive?.title;
|
||||
cover = major?.archive?.cover;
|
||||
bvid = major?.archive?.bvid;
|
||||
break;
|
||||
case 'DYNAMIC_TYPE_UGC_SEASON':
|
||||
title = major?.ugcSeason?.title;
|
||||
cover = major?.ugcSeason?.cover;
|
||||
bvid = major?.ugcSeason?.bvid;
|
||||
break;
|
||||
case 'DYNAMIC_TYPE_PGC' || 'DYNAMIC_TYPE_PGC_UNION':
|
||||
title = major?.pgc?.title;
|
||||
@@ -135,6 +138,7 @@ class DynamicPanel extends StatelessWidget {
|
||||
imageSaveDialog(
|
||||
title: title,
|
||||
cover: cover,
|
||||
bvid: bvid,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,17 +54,19 @@ Widget module(
|
||||
onLongPress: isNoneMajor
|
||||
? null
|
||||
: () {
|
||||
late String? title, cover;
|
||||
String? title, cover, bvid;
|
||||
late var origMajor = orig.modules.moduleDynamic?.major;
|
||||
late var major = item.modules.moduleDynamic?.major;
|
||||
switch (orig.type) {
|
||||
case 'DYNAMIC_TYPE_AV':
|
||||
title = origMajor?.archive?.title;
|
||||
cover = origMajor?.archive?.cover;
|
||||
bvid = origMajor?.archive?.bvid;
|
||||
break;
|
||||
case 'DYNAMIC_TYPE_UGC_SEASON':
|
||||
title = origMajor?.ugcSeason?.title;
|
||||
cover = origMajor?.ugcSeason?.cover;
|
||||
bvid = origMajor?.ugcSeason?.bvid;
|
||||
break;
|
||||
case 'DYNAMIC_TYPE_PGC' || 'DYNAMIC_TYPE_PGC_UNION':
|
||||
title = origMajor?.pgc?.title;
|
||||
@@ -84,6 +86,7 @@ Widget module(
|
||||
imageSaveDialog(
|
||||
title: title,
|
||||
cover: cover,
|
||||
bvid: bvid,
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
|
||||
@@ -90,16 +90,24 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
||||
Widget _buildHeader(ThemeData theme) {
|
||||
return SliverAppBar.medium(
|
||||
leading: _favDetailController.enableMultiSelect.value
|
||||
? IconButton(
|
||||
tooltip: '取消',
|
||||
onPressed: _favDetailController.handleSelect,
|
||||
icon: const Icon(Icons.close_outlined),
|
||||
? Row(
|
||||
children: [
|
||||
IconButton(
|
||||
tooltip: '取消',
|
||||
onPressed: _favDetailController.handleSelect,
|
||||
icon: const Icon(Icons.close_outlined),
|
||||
),
|
||||
Text(
|
||||
'已选: ${_favDetailController.checkedCount.value}',
|
||||
style: const TextStyle(fontSize: 15),
|
||||
),
|
||||
],
|
||||
)
|
||||
: null,
|
||||
expandedHeight: kToolbarHeight + 130,
|
||||
pinned: true,
|
||||
title: _favDetailController.enableMultiSelect.value
|
||||
? Text('已选: ${_favDetailController.checkedCount.value}')
|
||||
? null
|
||||
: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -288,7 +296,6 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
||||
fontSize: 12.5,
|
||||
color: theme.colorScheme.outline,
|
||||
);
|
||||
final item = _favDetailController.item.value;
|
||||
return FlexibleSpaceBar(
|
||||
background: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
@@ -300,97 +307,103 @@ class _FavDetailPageState extends State<FavDetailPage> {
|
||||
child: SizedBox(
|
||||
height: 110,
|
||||
child: Obx(
|
||||
() => Row(
|
||||
spacing: 12,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Hero(
|
||||
tag: _favDetailController.heroTag,
|
||||
child: NetworkImgLayer(
|
||||
width: 176,
|
||||
height: 110,
|
||||
src: item.cover,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 6,
|
||||
top: 6,
|
||||
child: Obx(() {
|
||||
if (_favDetailController.isOwner.value != false) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
bool isFav =
|
||||
_favDetailController.item.value.favState == 1;
|
||||
return iconButton(
|
||||
context: context,
|
||||
size: 28,
|
||||
iconSize: 18,
|
||||
tooltip: '${isFav ? '取消' : ''}收藏',
|
||||
onPressed: () => _favDetailController.onFav(isFav),
|
||||
icon: isFav ? Icons.favorite : Icons.favorite_border,
|
||||
bgColor:
|
||||
isFav ? null : theme.colorScheme.onInverseSurface,
|
||||
iconColor:
|
||||
isFav ? null : theme.colorScheme.onSurfaceVariant,
|
||||
);
|
||||
}),
|
||||
)
|
||||
],
|
||||
),
|
||||
if (item.title != null)
|
||||
Expanded(
|
||||
child: Column(
|
||||
spacing: 4,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item.title!,
|
||||
style: TextStyle(
|
||||
fontSize: theme.textTheme.titleMedium!.fontSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
() {
|
||||
final item = _favDetailController.item.value;
|
||||
return Row(
|
||||
spacing: 12,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Hero(
|
||||
tag: _favDetailController.heroTag,
|
||||
child: NetworkImgLayer(
|
||||
width: 176,
|
||||
height: 110,
|
||||
src: item.cover,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () =>
|
||||
Get.toNamed('/member?mid=${item.upper!.mid}'),
|
||||
child: Text(
|
||||
item.upper!.name!,
|
||||
),
|
||||
Positioned(
|
||||
right: 6,
|
||||
top: 6,
|
||||
child: Obx(() {
|
||||
if (_favDetailController.isOwner.value != false) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
bool isFav =
|
||||
_favDetailController.item.value.favState == 1;
|
||||
return iconButton(
|
||||
context: context,
|
||||
size: 28,
|
||||
iconSize: 18,
|
||||
tooltip: '${isFav ? '取消' : ''}收藏',
|
||||
onPressed: () => _favDetailController.onFav(isFav),
|
||||
icon:
|
||||
isFav ? Icons.favorite : Icons.favorite_border,
|
||||
bgColor: isFav
|
||||
? null
|
||||
: theme.colorScheme.onInverseSurface,
|
||||
iconColor: isFav
|
||||
? null
|
||||
: theme.colorScheme.onSurfaceVariant,
|
||||
);
|
||||
}),
|
||||
)
|
||||
],
|
||||
),
|
||||
if (item.title != null)
|
||||
Expanded(
|
||||
child: Column(
|
||||
spacing: 4,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item.title!,
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.primary,
|
||||
fontSize: theme.textTheme.titleMedium!.fontSize,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (item.intro?.isNotEmpty == true)
|
||||
Text(
|
||||
item.intro!,
|
||||
style: style,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
if (item.attr != null) ...[
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: Text(
|
||||
'共${item.mediaCount}条视频 · ${Utils.isPublicFavText(item.attr)}',
|
||||
textAlign: TextAlign.end,
|
||||
style: style,
|
||||
GestureDetector(
|
||||
onTap: () =>
|
||||
Get.toNamed('/member?mid=${item.upper!.mid}'),
|
||||
child: Text(
|
||||
item.upper!.name!,
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (item.intro?.isNotEmpty == true)
|
||||
Text(
|
||||
item.intro!,
|
||||
style: style,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
if (item.attr != null) ...[
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: Text(
|
||||
'共${item.mediaCount}条视频 · ${Utils.isPublicFavText(item.attr)}',
|
||||
textAlign: TextAlign.end,
|
||||
style: style,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
],
|
||||
),
|
||||
)
|
||||
else
|
||||
SizedBox.shrink(
|
||||
key: ValueKey(_favDetailController.item.value),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
SizedBox.shrink(
|
||||
key: ValueKey(_favDetailController.item.value),
|
||||
)
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -60,6 +60,7 @@ class FavVideoCardH extends StatelessWidget {
|
||||
() => imageSaveDialog(
|
||||
title: item.title,
|
||||
cover: item.cover,
|
||||
bvid: item.bvid,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
|
||||
@@ -93,6 +93,7 @@ class HistoryItem extends StatelessWidget {
|
||||
imageSaveDialog(
|
||||
title: item.title,
|
||||
cover: item.cover,
|
||||
bvid: bvid,
|
||||
);
|
||||
},
|
||||
child: Stack(
|
||||
|
||||
@@ -44,6 +44,7 @@ class VideoCardHLater extends StatelessWidget {
|
||||
() => imageSaveDialog(
|
||||
title: videoItem.title,
|
||||
cover: videoItem.pic,
|
||||
bvid: videoItem.bvid,
|
||||
),
|
||||
onTap: onTap ??
|
||||
() async {
|
||||
|
||||
@@ -50,6 +50,7 @@ class MemberCoinLikeItem extends StatelessWidget {
|
||||
onLongPress: () => imageSaveDialog(
|
||||
title: item.title,
|
||||
cover: item.cover,
|
||||
aid: item.param,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
@@ -26,27 +26,32 @@ class VideoCardVMemberHome extends StatelessWidget {
|
||||
case 'bangumi':
|
||||
PageUtils.viewPgc(epId: videoItem.param);
|
||||
break;
|
||||
|
||||
case 'av':
|
||||
if (videoItem.isPgc == true && videoItem.uri?.isNotEmpty == true) {
|
||||
if (PageUtils.viewPgcFromUri(videoItem.uri!)) {
|
||||
return;
|
||||
if (videoItem.isPgc == true) {
|
||||
if (videoItem.uri?.isNotEmpty == true) {
|
||||
PageUtils.viewPgcFromUri(videoItem.uri!);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
String? aid = videoItem.param;
|
||||
String? bvid = videoItem.bvid;
|
||||
if (aid == null && bvid == null) {
|
||||
return;
|
||||
}
|
||||
int? cid = videoItem.cid;
|
||||
cid ??= await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
||||
|
||||
bvid ??= IdUtils.av2bv(int.parse(aid!));
|
||||
int? cid = videoItem.cid ?? await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
||||
PageUtils.toVideoPage(
|
||||
'bvid=${bvid ?? IdUtils.av2bv(int.parse(aid!))}&cid=$cid',
|
||||
'bvid=$bvid&cid=$cid',
|
||||
arguments: {
|
||||
'pic': videoItem.cover,
|
||||
'heroTag': heroTag,
|
||||
},
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (videoItem.uri?.isNotEmpty == true) {
|
||||
PiliScheme.routePushFromUrl(videoItem.uri!);
|
||||
@@ -64,6 +69,8 @@ class VideoCardVMemberHome extends StatelessWidget {
|
||||
onLongPress: () => imageSaveDialog(
|
||||
title: videoItem.title,
|
||||
cover: videoItem.cover,
|
||||
aid: videoItem.param,
|
||||
bvid: videoItem.bvid,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
@@ -37,6 +37,7 @@ class VideoCardHMemberVideo extends StatelessWidget {
|
||||
onLongPress: () => imageSaveDialog(
|
||||
title: videoItem.title,
|
||||
cover: videoItem.cover,
|
||||
bvid: videoItem.bvid,
|
||||
),
|
||||
onTap: onTap ??
|
||||
() async {
|
||||
|
||||
@@ -42,6 +42,7 @@ class SubVideoCardH extends StatelessWidget {
|
||||
onLongPress: () => imageSaveDialog(
|
||||
title: videoItem.title,
|
||||
cover: videoItem.cover,
|
||||
bvid: videoItem.bvid,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
|
||||
@@ -174,6 +174,8 @@ class _MediaListPanelState
|
||||
onLongPress: () => imageSaveDialog(
|
||||
title: item.title,
|
||||
cover: item.cover,
|
||||
aid: item.aid,
|
||||
bvid: item.bvid,
|
||||
),
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
|
||||
Reference in New Issue
Block a user