优化已阅界面

This commit is contained in:
DelLevin-Home
2026-08-09 22:14:52 +08:00
parent 4ffc167967
commit 9cc492782e

View File

@@ -228,7 +228,7 @@ class _ReviewedPageState extends State<ReviewedPage> {
: '--'; : '--';
return Container( return Container(
margin: const EdgeInsets.fromLTRB(16, 8, 16, 0), margin: const EdgeInsets.fromLTRB(20, 8, 20, 0),
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
decoration: BoxDecoration( decoration: BoxDecoration(
color: colors.surfaceContainerLow, color: colors.surfaceContainerLow,
@@ -237,19 +237,26 @@ class _ReviewedPageState extends State<ReviewedPage> {
child: Column( child: Column(
children: [ children: [
// 第一行:总数 + 评分 // 第一行:总数 + 评分
Row( _FadeEdgeScrollView(
children: [ colors: colors,
_buildStatItem('${filtered.length}', '已阅', colors.primary, Icons.done_all_rounded, colors), fadeColor: colors.surfaceContainerLow,
_buildStatDivider(colors), child: SingleChildScrollView(
_buildStatItem(avg, '均分', Colors.amber, Icons.star_rounded, colors), scrollDirection: Axis.horizontal,
_buildStatDivider(colors), child: Row(
// 分类计数 children: [
_buildMiniCategory('影视', movieCount, Colors.blue, _ItemType.movie, colors), _buildStatItem('${filtered.length}', '已阅', colors.primary, Icons.done_all_rounded, colors),
const SizedBox(width: 12), _buildStatDivider(colors),
_buildMiniCategory('书籍', bookCount, Colors.teal, _ItemType.book, colors), _buildStatItem(avg, '均分', Colors.amber, Icons.star_rounded, colors),
const SizedBox(width: 12), _buildStatDivider(colors),
_buildMiniCategory('游戏', gameCount, Colors.orange, _ItemType.game, colors), // 分类计数
], _buildMiniCategory('影视', movieCount, Colors.blue, _ItemType.movie, colors),
const SizedBox(width: 12),
_buildMiniCategory('书籍', bookCount, Colors.teal, _ItemType.book, colors),
const SizedBox(width: 12),
_buildMiniCategory('游戏', gameCount, Colors.orange, _ItemType.game, colors),
],
),
),
), ),
], ],
), ),
@@ -658,11 +665,12 @@ class _ReviewedPageState extends State<ReviewedPage> {
class _FadeEdgeScrollView extends StatelessWidget { class _FadeEdgeScrollView extends StatelessWidget {
final ColorScheme colors; final ColorScheme colors;
final Widget child; final Widget child;
const _FadeEdgeScrollView({required this.colors, required this.child}); final Color? fadeColor;
const _FadeEdgeScrollView({required this.colors, required this.child, this.fadeColor});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final fadeColor = colors.surface; final fade = fadeColor ?? colors.surface;
return Stack( return Stack(
children: [ children: [
child, child,
@@ -675,7 +683,7 @@ class _FadeEdgeScrollView extends StatelessWidget {
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.centerLeft, begin: Alignment.centerLeft,
end: Alignment.centerRight, end: Alignment.centerRight,
colors: [fadeColor, fadeColor.withValues(alpha: 0)], colors: [fade, fade.withValues(alpha: 0)],
), ),
), ),
), ),
@@ -690,7 +698,7 @@ class _FadeEdgeScrollView extends StatelessWidget {
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.centerRight, begin: Alignment.centerRight,
end: Alignment.centerLeft, end: Alignment.centerLeft,
colors: [fadeColor, fadeColor.withValues(alpha: 0)], colors: [fade, fade.withValues(alpha: 0)],
), ),
), ),
), ),