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

@@ -60,13 +60,15 @@ class VideoCardH extends StatelessWidget {
clipBehavior: Clip.none,
children: [
InkWell(
onLongPress: onLongPress ??
onLongPress:
onLongPress ??
() => imageSaveDialog(
bvid: videoItem.bvid,
title: videoItem.title,
cover: videoItem.cover,
),
onTap: onTap ??
bvid: videoItem.bvid,
title: videoItem.title,
cover: videoItem.cover,
),
onTap:
onTap ??
() async {
if (type == 'ketang') {
SmartDialog.showToast('课堂视频暂不支持播放');
@@ -79,7 +81,8 @@ class VideoCardH extends StatelessWidget {
}
} else {
SmartDialog.showToast(
'err: live_room : ${videoItem.runtimeType}');
'err: live_room : ${videoItem.runtimeType}',
);
}
return;
}
@@ -90,15 +93,18 @@ class VideoCardH extends StatelessWidget {
}
}
try {
final int? cid = videoItem.cid ??
final int? cid =
videoItem.cid ??
await SearchHttp.ab2c(
aid: videoItem.aid, bvid: videoItem.bvid);
aid: videoItem.aid,
bvid: videoItem.bvid,
);
if (cid != null) {
PageUtils.toVideoPage(
'bvid=${videoItem.bvid}&cid=$cid',
arguments: {
'videoItem': videoItem,
'heroTag': Utils.makeHeroTag(videoItem.aid)
'heroTag': Utils.makeHeroTag(videoItem.aid),
},
);
}
@@ -157,11 +163,12 @@ class VideoCardH extends StatelessWidget {
? 1
: progress / videoItem.duration,
),
)
),
] else if (videoItem.duration > 0)
PBadge(
text: DurationUtil.formatDuration(
videoItem.duration),
videoItem.duration,
),
right: 6.0,
bottom: 6.0,
type: PBadgeType.gray,
@@ -214,22 +221,24 @@ class VideoCardH extends StatelessWidget {
overflow: TextOverflow.ellipsis,
maxLines: 2,
TextSpan(
children: item.titleList!
.map((e) => TextSpan(
text: e.text,
style: TextStyle(
fontSize:
theme.textTheme.bodyMedium!.fontSize,
height: 1.42,
letterSpacing: 0.3,
color: e.isEm
? theme.colorScheme.primary
: theme.colorScheme.onSurface,
),
))
.toList()),
children: item.titleList!
.map(
(e) => TextSpan(
text: e.text,
style: TextStyle(
fontSize: theme.textTheme.bodyMedium!.fontSize,
height: 1.42,
letterSpacing: 0.3,
color: e.isEm
? theme.colorScheme.primary
: theme.colorScheme.onSurface,
),
),
)
.toList(),
),
),
)
),
] else
Expanded(
child: Text(

View File

@@ -37,7 +37,8 @@ class VideoCardV extends StatelessWidget {
break;
case 'av':
String bvid = videoItem.bvid ?? IdUtils.av2bv(videoItem.aid!);
int? cid = videoItem.cid ??
int? cid =
videoItem.cid ??
await SearchHttp.ab2c(aid: videoItem.aid, bvid: bvid);
if (cid != null) {
PageUtils.toVideoPage(
@@ -83,32 +84,35 @@ class VideoCardV extends StatelessWidget {
children: [
AspectRatio(
aspectRatio: StyleString.aspectRatio,
child: LayoutBuilder(builder: (context, boxConstraints) {
double maxWidth = boxConstraints.maxWidth;
double maxHeight = boxConstraints.maxHeight;
return Stack(
clipBehavior: Clip.none,
children: [
NetworkImgLayer(
src: videoItem.cover,
width: maxWidth,
height: maxHeight,
radius: 0,
),
if (videoItem.duration > 0)
PBadge(
bottom: 6,
right: 7,
size: PBadgeSize.small,
type: PBadgeType.gray,
text:
DurationUtil.formatDuration(videoItem.duration),
)
],
);
}),
child: LayoutBuilder(
builder: (context, boxConstraints) {
double maxWidth = boxConstraints.maxWidth;
double maxHeight = boxConstraints.maxHeight;
return Stack(
clipBehavior: Clip.none,
children: [
NetworkImgLayer(
src: videoItem.cover,
width: maxWidth,
height: maxHeight,
radius: 0,
),
if (videoItem.duration > 0)
PBadge(
bottom: 6,
right: 7,
size: PBadgeSize.small,
type: PBadgeType.gray,
text: DurationUtil.formatDuration(
videoItem.duration,
),
),
],
);
},
),
),
content(context)
content(context),
],
),
),
@@ -193,7 +197,7 @@ class VideoCardV extends StatelessWidget {
),
),
),
if (videoItem.goto == 'av') const SizedBox(width: 10)
if (videoItem.goto == 'av') const SizedBox(width: 10),
],
),
],
@@ -236,7 +240,7 @@ class VideoCardV extends StatelessWidget {
),
),
const SizedBox(width: 2),
]
],
// deprecated
// else if (videoItem is RecVideoItemAppModel &&
// videoItem.desc != null &&