From 5698c232d127b162899f1c49c09c1a41c628698f Mon Sep 17 00:00:00 2001 From: DelLevin-Home Date: Mon, 10 Aug 2026 20:22:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BE=A7=E8=BE=B9=E6=A0=8F?= =?UTF-8?q?=E5=92=8C=E6=88=91=E7=9A=84=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/profile/profile_page.dart | 86 ++++++++++++++--------------- lib/utils/theme/app_theme.dart | 3 +- lib/widgets/custom_drawer.dart | 33 ++++++++--- pubspec.yaml | 2 +- 4 files changed, 70 insertions(+), 54 deletions(-) diff --git a/lib/pages/profile/profile_page.dart b/lib/pages/profile/profile_page.dart index 3a7c20d..06a3dbd 100644 --- a/lib/pages/profile/profile_page.dart +++ b/lib/pages/profile/profile_page.dart @@ -669,6 +669,16 @@ class _ProfilePageState extends State with RouteAware { Widget _buildWatchlist(List movies, List books, List games) { final colors = Theme.of(context).colorScheme; + final movieWantTo = _userPrefs.showMovieTab + ? movies.where((m) => m.status == 'want_to_watch').length + : 0; + final bookWantTo = _userPrefs.showBookTab + ? books.where((b) => b.status == 'want_to_read').length + : 0; + final gameWantTo = _userPrefs.showGameTab + ? games.where((g) => g.status == 'want_to_play').length + : 0; + final items = <_WatchlistItem>[]; if (_userPrefs.showMovieTab) { for (final m in movies.where((m) => m.status == 'want_to_watch')) { @@ -705,17 +715,6 @@ class _ProfilePageState extends State with RouteAware { } items.sort((a, b) => b.createdAt.compareTo(a.createdAt)); - final typeIcon = { - 'movie': Icons.movie_outlined, - 'book': Icons.menu_book_outlined, - 'game': Icons.sports_esports_outlined, - }; - final typeColor = { - 'movie': const Color(0xFF2563EB), - 'book': const Color(0xFF16A34A), - 'game': const Color(0xFFEA580C), - }; - return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -750,6 +749,22 @@ class _ProfilePageState extends State with RouteAware { ], ), ), + const SizedBox(height: 10), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Row(children: [ + if (_userPrefs.showMovieTab) ...[ + _buildStatusTag('影视', movieWantTo, true, colors), + const SizedBox(width: 10), + ], + if (_userPrefs.showBookTab) ...[ + _buildStatusTag('书籍', bookWantTo, false, colors), + const SizedBox(width: 10), + ], + if (_userPrefs.showGameTab) + _buildStatusTag('游戏', gameWantTo, false, colors), + ]), + ), const SizedBox(height: 12), if (items.isEmpty) Padding( @@ -778,40 +793,23 @@ class _ProfilePageState extends State with RouteAware { crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( - child: Stack( - children: [ - Container( - width: 78, - decoration: BoxDecoration( - color: colors.surfaceContainerHighest, - borderRadius: BorderRadius.circular(8), - ), - clipBehavior: Clip.antiAlias, - child: item.imagePath != null && item.imagePath!.isNotEmpty - ? FadeInLocalImage( - path: item.imagePath, - fit: BoxFit.cover, - errorWidget: Icon(Icons.image_outlined, - size: 20, - color: colors.onSurface.withValues(alpha: 0.2))) - : Icon(Icons.image_outlined, + child: Container( + width: 78, + decoration: BoxDecoration( + color: colors.surfaceContainerHighest, + borderRadius: BorderRadius.circular(8), + ), + clipBehavior: Clip.antiAlias, + child: item.imagePath != null && item.imagePath!.isNotEmpty + ? FadeInLocalImage( + path: item.imagePath, + fit: BoxFit.cover, + errorWidget: Icon(Icons.image_outlined, size: 20, - color: colors.onSurface.withValues(alpha: 0.2)), - ), - Positioned( - top: 4, - left: 4, - child: Container( - padding: const EdgeInsets.all(3), - decoration: BoxDecoration( - color: typeColor[item.type]!, - borderRadius: BorderRadius.circular(4), - ), - child: Icon(typeIcon[item.type], - size: 10, color: Colors.white), - ), - ), - ], + color: colors.onSurface.withValues(alpha: 0.2))) + : Icon(Icons.image_outlined, + size: 20, + color: colors.onSurface.withValues(alpha: 0.2)), ), ), const SizedBox(height: 4), diff --git a/lib/utils/theme/app_theme.dart b/lib/utils/theme/app_theme.dart index 433c3ab..634ac07 100644 --- a/lib/utils/theme/app_theme.dart +++ b/lib/utils/theme/app_theme.dart @@ -42,9 +42,10 @@ class AppTheme { Color(0xFFFF8F00), // 琥珀 Color(0xFFE91E63), // 玫瑰 Color(0xFF673AB7), // 紫罗兰 + Color(0xFF8B6F47), // 米黄 ]; - static const List colorSchemeNames = ['经典', '靛蓝', '薄荷', '琥珀', '玫瑰', '紫罗兰']; + static const List colorSchemeNames = ['经典', '靛蓝', '薄荷', '琥珀', '玫瑰', '紫罗兰', '米黄']; // 莫奈动态取色 static Color? _monetColor; diff --git a/lib/widgets/custom_drawer.dart b/lib/widgets/custom_drawer.dart index 1e9d9ed..bbc61c0 100644 --- a/lib/widgets/custom_drawer.dart +++ b/lib/widgets/custom_drawer.dart @@ -263,7 +263,7 @@ class _CustomDrawerState extends State { final actions = <(IconData, String, Color, VoidCallback)>[]; if (userPrefs.showMovieTab) actions.add(( - Icons.add_photo_alternate_outlined, '影视', const Color(0xFF2563EB), + Icons.movie_outlined, '影视', const Color(0xFF2563EB), () { if (!widget.embedded) { Navigator.pop(context); } Navigator.push(context, MaterialPageRoute(builder: (_) => const MovieFormPage())); }, )); if (userPrefs.showBookTab) actions.add(( @@ -297,13 +297,30 @@ class _CustomDrawerState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ - Container( - width: 36, height: 36, - decoration: BoxDecoration( - color: color.withValues(alpha: 0.1), - borderRadius: BorderRadius.circular(10), - ), - child: Icon(icon, size: 18, color: color), + Stack( + clipBehavior: Clip.none, + children: [ + Container( + width: 36, height: 36, + decoration: BoxDecoration( + color: color.withValues(alpha: 0.1), + borderRadius: BorderRadius.circular(10), + ), + child: Icon(icon, size: 18, color: color), + ), + Positioned( + top: -4, + right: -4, + child: Container( + width: 14, height: 14, + decoration: BoxDecoration( + color: colors.surface, + shape: BoxShape.circle, + ), + child: Icon(Icons.add, size: 10, color: color), + ), + ), + ], ), const SizedBox(height: 4), Text(label, style: TextStyle(fontSize: 11, fontWeight: FontWeight.w500, color: colors.onSurface.withValues(alpha: 0.6))), diff --git a/pubspec.yaml b/pubspec.yaml index d358431..2615f9b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: mooknote description: "app for tracking movies, books, and notes" publish_to: 'none' -version: 0.3.0 +version: 0.3.1 environment: sdk: ^3.5.0