mod: 首页样式修改

This commit is contained in:
guozhigq
2023-07-16 16:43:45 +08:00
parent a0427c672b
commit eb3017faf4
8 changed files with 126 additions and 75 deletions

View File

@ -2,7 +2,8 @@ import 'package:flutter/material.dart';
class StyleString {
static const double cardSpace = 8;
static BorderRadius mdRadius = BorderRadius.circular(6);
static const Radius imgRadius = Radius.circular(6);
static const double safeSpace = 14;
static BorderRadius mdRadius = BorderRadius.circular(16);
static const Radius imgRadius = Radius.circular(16);
static const double aspectRatio = 16 / 10;
}

View File

@ -57,7 +57,7 @@ class VideoCardH extends StatelessWidget {
child: LayoutBuilder(
builder: (context, boxConstraints) {
double width =
(boxConstraints.maxWidth - StyleString.cardSpace * 6) / 2;
(boxConstraints.maxWidth - StyleString.cardSpace * 9) / 2;
return SizedBox(
height: width / StyleString.aspectRatio,
child: Row(
@ -104,12 +104,12 @@ class VideoCardH extends StatelessWidget {
},
),
),
Divider(
height: 1,
indent: 8,
endIndent: 12,
color: Theme.of(context).dividerColor.withOpacity(0.08),
)
// Divider(
// height: 1,
// indent: 8,
// endIndent: 12,
// color: Theme.of(context).dividerColor.withOpacity(0.08),
// )
],
),
),
@ -134,8 +134,10 @@ class VideoContent extends StatelessWidget {
videoItem.title,
textAlign: TextAlign.start,
style: TextStyle(
fontSize: Theme.of(context).textTheme.titleSmall!.fontSize,
fontWeight: FontWeight.w500),
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
fontWeight: FontWeight.w600,
letterSpacing: 0.3,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),

View File

@ -25,11 +25,11 @@ class VideoCardV extends StatelessWidget {
Widget build(BuildContext context) {
String heroTag = Utils.makeHeroTag(videoItem.id);
return Card(
elevation: 0.8,
elevation: 0,
clipBehavior: Clip.hardEdge,
shape: RoundedRectangleBorder(
borderRadius: StyleString.mdRadius,
),
// shape: RoundedRectangleBorder(
// borderRadius: StyleString.mdRadius,
// ),
margin: EdgeInsets.zero,
child: GestureDetector(
onLongPress: () {
@ -51,10 +51,14 @@ class VideoCardV extends StatelessWidget {
},
child: Column(
children: [
ClipRRect(
borderRadius: const BorderRadius.only(
topLeft: StyleString.imgRadius,
topRight: StyleString.imgRadius,
Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: StyleString.imgRadius,
topRight: StyleString.imgRadius,
bottomLeft: StyleString.imgRadius,
bottomRight: StyleString.imgRadius,
),
),
child: AspectRatio(
aspectRatio: StyleString.aspectRatio,
@ -74,20 +78,20 @@ class VideoCardV extends StatelessWidget {
height: maxHeight,
),
),
Positioned(
left: 0,
right: 0,
bottom: 0,
child: AnimatedOpacity(
opacity: 1,
duration: const Duration(milliseconds: 200),
child: VideoStat(
view: videoItem.stat.view,
danmaku: videoItem.stat.danmaku,
duration: videoItem.duration,
),
),
),
// Positioned(
// left: 0,
// right: 0,
// bottom: 0,
// child: AnimatedOpacity(
// opacity: 1,
// duration: const Duration(milliseconds: 200),
// child: VideoStat(
// view: videoItem.stat.view,
// danmaku: videoItem.stat.danmaku,
// duration: videoItem.duration,
// ),
// ),
// ),
],
);
}),
@ -110,7 +114,7 @@ class VideoContent extends StatelessWidget {
return Expanded(
child: Padding(
// 多列
padding: const EdgeInsets.fromLTRB(8, 8, 6, 7),
padding: const EdgeInsets.fromLTRB(4, 6, 6, 7),
// 单列
// padding: const EdgeInsets.fromLTRB(14, 10, 4, 8),
child: Column(
@ -120,9 +124,10 @@ class VideoContent extends StatelessWidget {
Text(
videoItem.title,
textAlign: TextAlign.start,
style: const TextStyle(
// fontSize: Theme.of(context).textTheme.titleSmall!.fontSize,
fontSize: 13,
style: TextStyle(
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
fontWeight: FontWeight.w600,
letterSpacing: 0.3,
),
maxLines: Get.find<RcmdController>().crossAxisCount,
overflow: TextOverflow.ellipsis,