mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-21 17:46:24 +08:00
@@ -12,7 +12,9 @@ Widget livePanelSub(
|
||||
DynamicItemModel item,
|
||||
BuildContext context, {
|
||||
int floor = 1,
|
||||
required double maxWidth,
|
||||
}) {
|
||||
maxWidth -= StyleString.safeSpace * 2;
|
||||
SubscriptionNew? subItem = item.modules.moduleDynamic!.major?.subscriptionNew;
|
||||
LivePlayInfo? content = subItem?.liveRcmd?.content?.livePlayInfo;
|
||||
if (subItem == null || content == null) {
|
||||
@@ -25,84 +27,76 @@ Widget livePanelSub(
|
||||
padding: const EdgeInsets.symmetric(horizontal: StyleString.safeSpace),
|
||||
child: GestureDetector(
|
||||
onTap: () => PageUtils.toLiveRoom(content.roomId),
|
||||
child: LayoutBuilder(
|
||||
builder: (context, box) {
|
||||
double width = box.maxWidth;
|
||||
return Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Hero(
|
||||
tag: content.roomId.toString(),
|
||||
child: NetworkImgLayer(
|
||||
width: width,
|
||||
height: width / StyleString.aspectRatio,
|
||||
src: content.cover,
|
||||
quality: 40,
|
||||
),
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
width: maxWidth,
|
||||
height: maxWidth / StyleString.aspectRatio,
|
||||
src: content.cover,
|
||||
quality: 40,
|
||||
),
|
||||
PBadge(
|
||||
text: content.watchedShow?.textLarge,
|
||||
top: 6,
|
||||
right: 65,
|
||||
fontSize: 10.5,
|
||||
type: PBadgeType.gray,
|
||||
),
|
||||
if (content.liveStatus == 1)
|
||||
Positioned(
|
||||
right: 6,
|
||||
top: 6,
|
||||
child: Image.asset(
|
||||
height: 16,
|
||||
'assets/images/live/live.gif',
|
||||
filterQuality: FilterQuality.low,
|
||||
),
|
||||
PBadge(
|
||||
text: content.watchedShow?.textLarge,
|
||||
top: 6,
|
||||
right: 65,
|
||||
fontSize: 10.5,
|
||||
type: PBadgeType.gray,
|
||||
),
|
||||
if (content.liveStatus == 1)
|
||||
Positioned(
|
||||
right: 6,
|
||||
top: 6,
|
||||
child: Image.asset(
|
||||
height: 16,
|
||||
'assets/images/live/live.gif',
|
||||
filterQuality: FilterQuality.low,
|
||||
)
|
||||
else
|
||||
const PBadge(
|
||||
text: '直播结束',
|
||||
top: 6,
|
||||
right: 6,
|
||||
),
|
||||
if (content.areaName != null)
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
height: 80,
|
||||
alignment: Alignment.bottomLeft,
|
||||
padding: const EdgeInsets.fromLTRB(12, 0, 10, 10),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: <Color>[
|
||||
Colors.transparent,
|
||||
Colors.black45,
|
||||
],
|
||||
),
|
||||
)
|
||||
else
|
||||
const PBadge(
|
||||
text: '直播结束',
|
||||
top: 6,
|
||||
right: 6,
|
||||
borderRadius: floor == 1
|
||||
? const BorderRadius.only(
|
||||
bottomLeft: StyleString.imgRadius,
|
||||
bottomRight: StyleString.imgRadius,
|
||||
)
|
||||
: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(6),
|
||||
bottomRight: Radius.circular(6),
|
||||
),
|
||||
),
|
||||
if (content.areaName != null)
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
height: 80,
|
||||
alignment: Alignment.bottomLeft,
|
||||
padding: const EdgeInsets.fromLTRB(12, 0, 10, 10),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: <Color>[
|
||||
Colors.transparent,
|
||||
Colors.black45,
|
||||
],
|
||||
),
|
||||
borderRadius: floor == 1
|
||||
? const BorderRadius.only(
|
||||
bottomLeft: StyleString.imgRadius,
|
||||
bottomRight: StyleString.imgRadius,
|
||||
)
|
||||
: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(6),
|
||||
bottomRight: Radius.circular(6),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
content.areaName!,
|
||||
style: TextStyle(
|
||||
fontSize: theme.textTheme.labelMedium!.fontSize,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
content.areaName!,
|
||||
style: TextStyle(
|
||||
fontSize: theme.textTheme.labelMedium!.fontSize,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user