From 4c2384fea9252409afccaa84d3f0d6ca9530e582 Mon Sep 17 00:00:00 2001 From: Zhou Weidong <502333560@qq.com> Date: Mon, 19 Oct 2026 18:01:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(discover):=20=E5=B0=81=E9=9D=A2=E5=AE=8C?= =?UTF-8?q?=E6=95=B4=E6=98=BE=E7=A4=BA=E5=B9=B6=E7=A7=BB=E9=99=A4=E5=9B=BE?= =?UTF-8?q?=E4=B8=8A=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../discover/widgets/home_drama_grid.dart | 35 ++++--------------- test/discover/home_all_dramas_grid_test.dart | 20 +++++++++++ 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/lib/pages/discover/widgets/home_drama_grid.dart b/lib/pages/discover/widgets/home_drama_grid.dart index f2a1ee0..7197dd2 100644 --- a/lib/pages/discover/widgets/home_drama_grid.dart +++ b/lib/pages/discover/widgets/home_drama_grid.dart @@ -119,19 +119,12 @@ class _HomeDramaCard extends StatelessWidget { child: Stack( fit: StackFit.expand, children: [ - RemoteImage( - drama.posterUrl, - fit: BoxFit.cover, - showFallbackIcon: true, - ), - const DecoratedBox( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [Color(0x0D000000), Color(0xCC000000)], - stops: [0.45, 1], - ), + ColoredBox( + color: AppColors.card, + child: RemoteImage( + drama.posterUrl, + fit: BoxFit.contain, + showFallbackIcon: true, ), ), if (free) @@ -157,22 +150,6 @@ class _HomeDramaCard extends StatelessWidget { ), ), ), - Positioned( - left: 6, - right: 6, - bottom: 6, - child: Text( - drama.title, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: const TextStyle( - color: AppColors.onPrimary, - fontSize: 9, - fontWeight: FontWeight.w800, - shadows: [Shadow(blurRadius: 6, color: Colors.black)], - ), - ), - ), ], ), ), diff --git a/test/discover/home_all_dramas_grid_test.dart b/test/discover/home_all_dramas_grid_test.dart index 9408808..419b6b0 100644 --- a/test/discover/home_all_dramas_grid_test.dart +++ b/test/discover/home_all_dramas_grid_test.dart @@ -84,6 +84,26 @@ void main() { .height, 120, ); + final cover = find.byKey(const Key('home-drama-cover-city-lights-demo')); + expect( + tester + .widget( + find.descendant(of: cover, matching: find.byType(RemoteImage)), + ) + .fit, + BoxFit.contain, + ); + expect( + find.descendant( + of: cover, + matching: find.text('City Lights & Velvet Nights'), + ), + findsNothing, + ); + expect( + find.byKey(const Key('home-drama-title-city-lights-demo')), + findsOneWidget, + ); expect( tester .widget(