Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-14 12:35:52 +08:00
parent 34e9afd7ad
commit 6ff256637a
18 changed files with 583 additions and 436 deletions

View File

@@ -16,6 +16,7 @@ Widget videoSeasonWidget(
String type,
Function(List<String>, int)? callback, {
floor = 1,
required double maxWidth,
}) {
if (item.modules.moduleDynamic?.major?.type == 'MAJOR_TYPE_NONE') {
return item.modules.moduleDynamic?.major?.none?.tips != null
@@ -56,87 +57,82 @@ Widget videoSeasonWidget(
}
Widget buildCover() {
return LayoutBuilder(
builder: (context, box) {
double width = box.maxWidth;
return Stack(
clipBehavior: Clip.none,
children: [
NetworkImgLayer(
width: width,
height: width / StyleString.aspectRatio,
src: itemContent.cover,
quality: 40,
),
if (itemContent.badge?.text != null)
PBadge(
text: itemContent.badge!.text,
top: 8.0,
right: 10.0,
bottom: null,
left: null,
type: switch (itemContent.badge!.text) {
'充电专属' => PBadgeType.error,
_ => PBadgeType.primary,
},
return Stack(
clipBehavior: Clip.none,
children: [
NetworkImgLayer(
width: maxWidth,
height: maxWidth / StyleString.aspectRatio,
src: itemContent.cover,
quality: 40,
),
if (itemContent.badge?.text != null)
PBadge(
text: itemContent.badge!.text,
top: 8.0,
right: 10.0,
bottom: null,
left: null,
type: switch (itemContent.badge!.text) {
'充电专属' => PBadgeType.error,
_ => PBadgeType.primary,
},
),
Positioned(
left: 0,
right: 0,
bottom: 0,
child: Container(
height: 70,
alignment: Alignment.bottomLeft,
padding: const EdgeInsets.fromLTRB(10, 0, 8, 8),
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.transparent,
Colors.black54,
],
),
Positioned(
left: 0,
right: 0,
bottom: 0,
child: Container(
height: 70,
alignment: Alignment.bottomLeft,
padding: const EdgeInsets.fromLTRB(10, 0, 8, 8),
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.transparent,
Colors.black54,
],
),
borderRadius: BorderRadius.only(
bottomLeft: StyleString.imgRadius,
bottomRight: StyleString.imgRadius,
),
),
child: DefaultTextStyle.merge(
style: TextStyle(
fontSize: theme.textTheme.labelMedium!.fontSize,
color: Colors.white,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
if (itemContent.durationText != null) ...[
DecoratedBox(
decoration: const BoxDecoration(
color: Colors.black45,
borderRadius: BorderRadius.all(Radius.circular(4)),
),
child: Text(' ${itemContent.durationText} '),
),
const SizedBox(width: 6),
],
Text('${NumUtil.numFormat(itemContent.stat?.play)}次围观'),
const SizedBox(width: 6),
Text('${NumUtil.numFormat(itemContent.stat?.danmu)}条弹幕'),
const Spacer(),
Image.asset(
'assets/images/play.png',
width: 50,
height: 50,
borderRadius: BorderRadius.only(
bottomLeft: StyleString.imgRadius,
bottomRight: StyleString.imgRadius,
),
),
child: DefaultTextStyle.merge(
style: TextStyle(
fontSize: theme.textTheme.labelMedium!.fontSize,
color: Colors.white,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
if (itemContent.durationText != null) ...[
DecoratedBox(
decoration: const BoxDecoration(
color: Colors.black45,
borderRadius: BorderRadius.all(Radius.circular(4)),
),
],
child: Text(' ${itemContent.durationText} '),
),
const SizedBox(width: 6),
],
Text('${NumUtil.numFormat(itemContent.stat?.play)}次围观'),
const SizedBox(width: 6),
Text('${NumUtil.numFormat(itemContent.stat?.danmu)}条弹幕'),
const Spacer(),
Image.asset(
'assets/images/play.png',
width: 50,
height: 50,
),
),
],
),
),
],
);
},
),
),
],
);
}