diff --git a/lib/pages/home/widgets/home_drama_grid.dart b/lib/pages/home/widgets/home_drama_grid.dart index 677d848..a5b82ce 100644 --- a/lib/pages/home/widgets/home_drama_grid.dart +++ b/lib/pages/home/widgets/home_drama_grid.dart @@ -126,8 +126,6 @@ class HomeDramaCard extends StatelessWidget { fallbackAspectRatio: _coverAspectRatio, ), Positioned(top: 8, left: 8, child: _tagBadge()), - if (_lockedCount > 0) - Positioned(top: 8, right: 8, child: _lockedBadge()), Positioned(left: 8, bottom: 8, child: _viewsBadge()), Positioned(right: 8, bottom: 8, child: _episodeBadge()), ], @@ -140,13 +138,6 @@ class HomeDramaCard extends StatelessWidget { drama.episodes.any((episode) => episode.isFree); } - int get _lockedCount { - final explicit = drama.episodes.where((episode) => episode.locked).length; - if (explicit > 0) return explicit; - final inferred = drama.episodeCount - drama.freeEpisodes; - return inferred > 0 ? inferred : 0; - } - Widget _tagBadge() { final label = _isFree ? l10n.free : l10n.originalTag; return Container( @@ -170,32 +161,6 @@ class HomeDramaCard extends StatelessWidget { ); } - Widget _lockedBadge() { - return Container( - key: Key('home-drama-locked-${drama.id}'), - padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 3), - decoration: BoxDecoration( - color: AppColors.overlayDark, - borderRadius: BorderRadius.circular(AppDimens.pillRadius), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - const Icon(Icons.lock_rounded, color: AppColors.onPrimary, size: 11), - const SizedBox(width: 2), - Text( - l10n.lockedEpisodeCount(_lockedCount), - style: const TextStyle( - color: AppColors.onPrimary, - fontSize: 9, - fontWeight: FontWeight.w700, - ), - ), - ], - ), - ); - } - Widget _episodeBadge() { return Container( key: Key('home-drama-episodes-badge-${drama.id}'), diff --git a/test/home/home_card_style_test.dart b/test/home/home_card_style_test.dart index 04f0495..c205ebd 100644 --- a/test/home/home_card_style_test.dart +++ b/test/home/home_card_style_test.dart @@ -54,8 +54,11 @@ void main() { ); expect((tag.decoration! as BoxDecoration).color, AppColors.badgePink); expect(find.text('Free'), findsOneWidget); - expect(find.text('18 locked'), findsOneWidget); expect(find.text('All 24'), findsOneWidget); + expect( + find.byKey(const Key('home-drama-locked-style-drama')), + findsNothing, + ); expect(find.byKey(const Key('home-drama-add-style-drama')), findsNothing); // 播放次数角标落在封面内,并按万位格式化。