show co/charging label

fix special dm

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-11 12:35:41 +08:00
parent db682066ba
commit 5f5387b941
6 changed files with 37 additions and 4 deletions

View File

@@ -38,11 +38,21 @@ class VideoCardH extends StatelessWidget {
@override
Widget build(BuildContext context) {
String type = 'video';
String? badge;
if (videoItem case SearchVideoItemModel item) {
var typeOrNull = item.type;
if (typeOrNull?.isNotEmpty == true) {
type = typeOrNull!;
}
if (item.isUnionVideo == 1) {
badge = '合作';
}
} else if (videoItem case HotVideoItemModel item) {
if (item.isCooperation == 1) {
badge = '合作';
} else {
badge = item.pgcLabel;
}
}
return Material(
type: MaterialType.transparency,
@@ -123,9 +133,9 @@ class VideoCardH extends StatelessWidget {
width: maxWidth,
height: maxHeight,
),
if (videoItem case HotVideoItemModel item)
if (badge != null)
PBadge(
text: item.pgcLabel,
text: badge,
top: 6.0,
right: 6.0,
),