diff --git a/docs/plans/PROGRESS.md b/docs/plans/PROGRESS.md index 4b7e0c4..e95abe9 100644 --- a/docs/plans/PROGRESS.md +++ b/docs/plans/PROGRESS.md @@ -1270,3 +1270,8 @@ $ flutter test - 继续观看全部入口可切到追剧页播放历史 tab;`flutter analyze`:No issues found。 - 用户区昵称与 UID 收紧为 4 间距,昵称列相对头像垂直居中;UID 12、复制图标 14。 - UID 行改用 GestureDetector 并锁定 16 高,昵称与 UID 间距 2、昵称行高 1.15,避免 Material 热区撑高;`flutter analyze`:No issues found。 + +## 2026-10-22 推荐剧单渐变背景 + +- 仅为推荐页「剧单」子页增加暖黑三段渐变和品牌橙径向光晕,推荐视频与全部短剧背景不变。 +- 渐变复用「我的」页色值,光晕使用 `#26FF6B2C`;分区与卡片样式保持原样;`flutter analyze`:No issues found。 diff --git a/lib/core/theme/app_colors.dart b/lib/core/theme/app_colors.dart index ae58709..87d9b92 100644 --- a/lib/core/theme/app_colors.dart +++ b/lib/core/theme/app_colors.dart @@ -101,6 +101,7 @@ abstract final class AppColors { static const mineIconSupport = Color(0xFFA78BFA); static const mineIconLanguage = Color(0xFF22D3EE); static const mineIconSettings = Color(0xFFA1A1AA); + static const recommendPlaylistGlow = Color(0x26FF6B2C); /// 次级文字与列表 chevron。 static const textPrimary = Color(0xFFFFFFFF); diff --git a/lib/pages/recommend/recommend_page.dart b/lib/pages/recommend/recommend_page.dart index 3734263..81527fc 100644 --- a/lib/pages/recommend/recommend_page.dart +++ b/lib/pages/recommend/recommend_page.dart @@ -68,14 +68,7 @@ class _RecommendPageState extends State { ), _KeepAliveTab( key: const PageStorageKey('recommend-tab-playlists'), - child: _withTopNavSpace( - RecommendSectionsView( - feedController: widget.feedController, - categories: categories, - onOpenDrama: _openDrama, - onMore: _handleMore, - ), - ), + child: _recommendPlaylists(categories), ), _KeepAliveTab( key: const PageStorageKey('recommend-tab-all'), @@ -173,6 +166,50 @@ class _RecommendPageState extends State { ); } + Widget _recommendPlaylists(CategoryController categories) { + return DecoratedBox( + key: const Key('recommend-playlist-surface'), + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + AppColors.mineGradientTop, + AppColors.mineGradientMiddle, + AppColors.mineGradientBottom, + ], + stops: [0, 0.4, 0.75], + ), + ), + child: Stack( + fit: StackFit.expand, + children: [ + const DecoratedBox( + key: Key('recommend-playlist-glow'), + decoration: BoxDecoration( + gradient: RadialGradient( + center: Alignment(0, -0.95), + radius: 0.9, + colors: [ + AppColors.recommendPlaylistGlow, + AppColors.transparent, + ], + ), + ), + ), + _withTopNavSpace( + RecommendSectionsView( + feedController: widget.feedController, + categories: categories, + onOpenDrama: _openDrama, + onMore: _handleMore, + ), + ), + ], + ), + ); + } + void _selectTab(RecommendInnerTab tab) { setState(() { _tab = tab; diff --git a/test/recommend/recommend_sections_test.dart b/test/recommend/recommend_sections_test.dart index 8acd660..54b4997 100644 --- a/test/recommend/recommend_sections_test.dart +++ b/test/recommend/recommend_sections_test.dart @@ -143,6 +143,31 @@ void main() { expect(find.text('New This Week'), findsOneWidget); expect(find.text('Costume Drama Awards'), findsOneWidget); expect(find.byType(AppBottomNav), findsOneWidget); + final playlistSurface = tester.widget( + find.byKey(const Key('recommend-playlist-surface')), + ); + final playlistGradient = + (playlistSurface.decoration as BoxDecoration).gradient! + as LinearGradient; + expect(playlistGradient.begin, Alignment.topCenter); + expect(playlistGradient.end, Alignment.bottomCenter); + expect(playlistGradient.colors, const [ + AppColors.mineGradientTop, + AppColors.mineGradientMiddle, + AppColors.mineGradientBottom, + ]); + expect(playlistGradient.stops, const [0, 0.4, 0.75]); + final playlistGlow = tester.widget( + find.byKey(const Key('recommend-playlist-glow')), + ); + final glowGradient = + (playlistGlow.decoration as BoxDecoration).gradient! as RadialGradient; + expect(glowGradient.center, const Alignment(0, -0.95)); + expect(glowGradient.radius, 0.9); + expect(glowGradient.colors, const [ + AppColors.recommendPlaylistGlow, + AppColors.transparent, + ]); final sectionTitle = tester.widget(find.text("This Week's Hits")); expect(sectionTitle.style?.fontSize, AppDimens.recommendSectionTitle); expect(sectionTitle.style?.fontWeight, FontWeight.w700);