mod: article: show linkcard

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-26 15:41:43 +08:00
parent ed99aee3fd
commit f4470c383e
2 changed files with 121 additions and 2 deletions

View File

@@ -174,11 +174,69 @@ Widget opusContent({
if (element.paraType == 3) {
return CachedNetworkImage(
imageUrl: Utils.thumbnailImgUrl(element.line!.pic!.url!),
width: maxWidth,
fit: BoxFit.contain,
height: element.line?.pic?.height,
imageUrl: Utils.thumbnailImgUrl(element.line!.pic!.url!),
);
}
if (element.paraType == 6) {
if (element.linkCard?.card?.ugc != null) {
return Card(
margin: EdgeInsets.zero,
shape: RoundedRectangleBorder(
borderRadius:
const BorderRadius.all(Radius.circular(8)),
),
color: Theme.of(context).colorScheme.onInverseSurface,
child: InkWell(
onTap: () {
try {
PiliScheme.videoPush(
int.parse(element.linkCard!.card!.oid!),
null,
);
} catch (_) {}
},
borderRadius:
const BorderRadius.all(Radius.circular(8)),
child: Padding(
padding: const EdgeInsets.all(8),
child: Row(
children: [
NetworkImgLayer(
radius: 6,
width: 65 * 16 / 10,
height: 65,
src: element.linkCard!.card!.ugc!.cover,
),
const SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(element.linkCard!.card!.ugc!.title!),
Text(
element.linkCard!.card!.ugc!.descSecond!,
style: TextStyle(
fontSize: 13,
color: Theme.of(context)
.colorScheme
.outline,
),
),
],
),
),
],
),
),
),
);
}
}
return const SizedBox.shrink();
},
separatorBuilder: (BuildContext context, int index) =>