feat: 更多横屏适配

This commit is contained in:
orz12
2024-03-01 04:27:24 +08:00
parent 55393935f3
commit 959396593a
19 changed files with 638 additions and 506 deletions

View File

@@ -76,80 +76,84 @@ Widget videoSeasonWidget(item, context, type, {floor = 1}) {
Text.rich(richNode(item, context)),
const SizedBox(height: 6),
],
LayoutBuilder(builder: (context, box) {
double width = box.maxWidth;
return Stack(
children: [
Hero(
tag: content.bvid,
child: NetworkImgLayer(
type: floor == 1 ? 'emote' : null,
width: width,
height: width / StyleString.aspectRatio,
src: content.cover,
semanticsLabel: content.title,
),
),
if (content.badge != null && type == 'pgc')
PBadge(
text: content.badge['text'],
top: 8.0,
right: 10.0,
bottom: null,
left: null,
),
Positioned(
left: 0,
right: 0,
bottom: 0,
child: Container(
height: 80,
padding: const EdgeInsets.fromLTRB(12, 0, 10, 10),
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
gradient: const LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: <Color>[
Colors.transparent,
Colors.black54,
Padding(
padding: EdgeInsets.symmetric(horizontal: StyleString.safeSpace),
child: LayoutBuilder(builder: (context, box) {
double width = box.maxWidth;
return Stack(
children: [
Hero(
tag: content.bvid,
child: NetworkImgLayer(
type: floor == 1 ? 'emote' : null,
width: width,
height: width / StyleString.aspectRatio,
src: content.cover,
semanticsLabel: content.title,
),
),
if (content.badge != null && type == 'pgc')
PBadge(
text: content.badge['text'],
top: 8.0,
right: 10.0,
bottom: null,
left: null,
),
Positioned(
left: 0,
right: 0,
bottom: 0,
child: Container(
height: 80,
padding: const EdgeInsets.fromLTRB(12, 0, 10, 10),
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
gradient: const LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: <Color>[
Colors.transparent,
Colors.black54,
],
),
borderRadius: floor == 1
? null
: const BorderRadius.all(Radius.circular(6))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
DefaultTextStyle.merge(
style: TextStyle(
fontSize: Theme.of(context)
.textTheme
.labelMedium!
.fontSize,
color: Colors.white),
child: Row(
children: [
Text(content.durationText ?? ''),
if (content.durationText != null)
const SizedBox(width: 10),
Text(content.stat.play + '次围观'),
const SizedBox(width: 10),
Text(content.stat.danmu + '条弹幕')
],
),
),
Image.asset(
'assets/images/play.png',
width: 60,
height: 60,
),
],
),
borderRadius: floor == 1
? null
: const BorderRadius.all(Radius.circular(6))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
DefaultTextStyle.merge(
style: TextStyle(
fontSize:
Theme.of(context).textTheme.labelMedium!.fontSize,
color: Colors.white),
child: Row(
children: [
Text(content.durationText ?? ''),
if (content.durationText != null)
const SizedBox(width: 10),
Text(content.stat.play + '次围观'),
const SizedBox(width: 10),
Text(content.stat.danmu + '条弹幕')
],
),
),
Image.asset(
'assets/images/play.png',
width: 60,
height: 60,
),
],
),
),
),
),
],
);
}),
],
);
})),
const SizedBox(height: 6),
Padding(
padding: floor == 1