feat(media): 图片占位改为纯色块并去掉扫光
This commit is contained in:
1 parent
613147c20c
commit
7f65fe4d48
20 files changed
+48
-291
No files matched your search
@@ -176,7 +176,7 @@ class _FeedBannerCarouselState extends State<FeedBannerCarousel> {
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
RemoteImage(banner.imageUrl, showFallbackIcon: true),
|
||||
RemoteImage(banner.imageUrl),
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
|
||||
@@ -37,7 +37,6 @@ class SearchResultCard extends StatelessWidget {
|
||||
RemoteImage(
|
||||
drama.posterUrl,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackColor: AppColors.contentSurface,
|
||||
),
|
||||
const Positioned(
|
||||
@@ -60,7 +59,9 @@ class SearchResultCard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: AppDimens.searchResultTitleGap),
|
||||
Text(
|
||||
drama.localizedTitle(Localizations.localeOf(context).languageCode),
|
||||
drama.localizedTitle(
|
||||
Localizations.localeOf(context).languageCode,
|
||||
),
|
||||
key: Key('search-result-title-${drama.id}'),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -93,7 +94,9 @@ class SearchResultCard extends StatelessWidget {
|
||||
}
|
||||
|
||||
List<String> _tags(BuildContext context) {
|
||||
final localized = drama.localizedTypeLabels(Localizations.localeOf(context).languageCode);
|
||||
final localized = drama.localizedTypeLabels(
|
||||
Localizations.localeOf(context).languageCode,
|
||||
);
|
||||
if (localized.isNotEmpty) return localized.take(3).toList(growable: false);
|
||||
final seen = <String>{};
|
||||
return [drama.genre, drama.category]
|
||||
|
||||
@@ -126,7 +126,6 @@ class DramaDetailHeader extends StatelessWidget {
|
||||
child: RemoteImage(
|
||||
drama.posterUrl,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackAspectRatio: 3 / 4,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -53,7 +53,6 @@ class FilterResultCard extends StatelessWidget {
|
||||
RemoteImage(
|
||||
drama.posterUrl,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackAspectRatio: 3 / 4,
|
||||
),
|
||||
if (drama.isHot)
|
||||
|
||||
@@ -64,7 +64,6 @@ class FollowingGridCard extends StatelessWidget {
|
||||
child: RemoteImage(
|
||||
posterUrl,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackColor: AppColors.contentSurface,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -75,7 +75,6 @@ class FollowingHistoryCard extends StatelessWidget {
|
||||
child: RemoteImage(
|
||||
posterUrl,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackColor: AppColors.contentSurface,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -40,7 +40,6 @@ class ContinueWatchingBanner extends StatelessWidget {
|
||||
RemoteImage(
|
||||
record.displayLandscapeCover,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackColor: AppColors.contentSurface,
|
||||
),
|
||||
const DecoratedBox(
|
||||
|
||||
@@ -122,7 +122,6 @@ class HomeDramaCard extends StatelessWidget {
|
||||
drama.posterUrl,
|
||||
width: double.infinity,
|
||||
fit: BoxFit.fitWidth,
|
||||
showFallbackIcon: true,
|
||||
fallbackAspectRatio: _coverAspectRatio,
|
||||
),
|
||||
Positioned(top: 8, left: 8, child: _tagBadge()),
|
||||
@@ -226,7 +225,9 @@ class HomeDramaCard extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _genre(BuildContext context) {
|
||||
final labels = drama.localizedTypeLabels(Localizations.localeOf(context).languageCode);
|
||||
final labels = drama.localizedTypeLabels(
|
||||
Localizations.localeOf(context).languageCode,
|
||||
);
|
||||
final genre = labels.isEmpty
|
||||
? (drama.genre.isEmpty ? drama.category : drama.genre)
|
||||
: labels.join(' / ');
|
||||
|
||||
@@ -12,11 +12,7 @@ import '../../../core/widgets/remote_image.dart';
|
||||
final RegExp _tagSplitter = RegExp(r'[,/、·]');
|
||||
|
||||
class HomeFeedCard extends StatelessWidget {
|
||||
const HomeFeedCard({
|
||||
super.key,
|
||||
required this.drama,
|
||||
required this.onTap,
|
||||
});
|
||||
const HomeFeedCard({super.key, required this.drama, required this.onTap});
|
||||
|
||||
final Drama drama;
|
||||
final VoidCallback onTap;
|
||||
@@ -44,7 +40,9 @@ class HomeFeedCard extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
drama.localizedTitle(Localizations.localeOf(context).languageCode),
|
||||
drama.localizedTitle(
|
||||
Localizations.localeOf(context).languageCode,
|
||||
),
|
||||
key: Key('home-feed-title-${drama.id}'),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -69,7 +67,9 @@ class HomeFeedCard extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _cover(BuildContext context) {
|
||||
final label = drama.localizedTag(Localizations.localeOf(context).languageCode);
|
||||
final label = drama.localizedTag(
|
||||
Localizations.localeOf(context).languageCode,
|
||||
);
|
||||
return ClipRRect(
|
||||
key: Key('home-feed-cover-clip-${drama.id}'),
|
||||
borderRadius: BorderRadius.circular(AppDimens.cardCoverRadius),
|
||||
@@ -82,7 +82,6 @@ class HomeFeedCard extends StatelessWidget {
|
||||
drama.posterUrl,
|
||||
key: Key('home-feed-cover-${drama.id}'),
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackColor: AppColors.contentSurface,
|
||||
),
|
||||
if (label.isNotEmpty)
|
||||
@@ -133,7 +132,9 @@ class HomeFeedCard extends StatelessWidget {
|
||||
}
|
||||
|
||||
List<String> _cardTags(BuildContext context) {
|
||||
final localized = drama.localizedTypeLabels(Localizations.localeOf(context).languageCode);
|
||||
final localized = drama.localizedTypeLabels(
|
||||
Localizations.localeOf(context).languageCode,
|
||||
);
|
||||
if (localized.isNotEmpty) return localized.take(3).toList(growable: false);
|
||||
final seen = <String>{};
|
||||
return [drama.genre, drama.category]
|
||||
|
||||
@@ -128,7 +128,6 @@ class MineContinueWatching extends StatelessWidget {
|
||||
child: RemoteImage(
|
||||
record.dramaCover ?? '',
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackColor: AppColors.contentSurface,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -276,7 +276,6 @@ class _NewReleasesPageState extends State<NewReleasesPage> {
|
||||
RemoteImage(
|
||||
drama.posterUrl,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackAspectRatio: 16 / 9,
|
||||
),
|
||||
const DecoratedBox(
|
||||
@@ -448,7 +447,6 @@ class _NewReleasesPageState extends State<NewReleasesPage> {
|
||||
RemoteImage(
|
||||
drama.posterUrl,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackAspectRatio: 3 / 4,
|
||||
),
|
||||
Positioned(
|
||||
|
||||
@@ -255,11 +255,7 @@ class _DramaInfoSheetState extends State<DramaInfoSheet> {
|
||||
width: _posterWidth,
|
||||
child: AspectRatio(
|
||||
aspectRatio: 3 / 4,
|
||||
child: RemoteImage(
|
||||
drama.posterUrl,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
),
|
||||
child: RemoteImage(drama.posterUrl, fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -466,11 +462,7 @@ class _DramaInfoSheetState extends State<DramaInfoSheet> {
|
||||
width: _relatedWidth,
|
||||
child: AspectRatio(
|
||||
aspectRatio: 3 / 4,
|
||||
child: RemoteImage(
|
||||
drama.posterUrl,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
),
|
||||
child: RemoteImage(drama.posterUrl, fit: BoxFit.cover),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -187,7 +187,6 @@ class _HomeHeroCarouselState extends State<HomeHeroCarousel> {
|
||||
RemoteImage(
|
||||
banner.imageUrl,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackColor: AppColors.contentSurface,
|
||||
),
|
||||
const DecoratedBox(
|
||||
@@ -210,10 +209,7 @@ class _HomeHeroCarouselState extends State<HomeHeroCarousel> {
|
||||
left: 28,
|
||||
right: 28,
|
||||
bottom: _copyBottomInset,
|
||||
child: _HeroCopy(
|
||||
key: Key('home-hero-copy-$index'),
|
||||
drama: drama,
|
||||
),
|
||||
child: _HeroCopy(key: Key('home-hero-copy-$index'), drama: drama),
|
||||
),
|
||||
if (drama != null)
|
||||
Positioned.fill(
|
||||
|
||||
@@ -97,7 +97,6 @@ class HomePosterCard extends StatelessWidget {
|
||||
RemoteImage(
|
||||
drama.posterUrl,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackColor: AppColors.contentSurface,
|
||||
),
|
||||
if (tagLabel.isNotEmpty)
|
||||
@@ -189,7 +188,6 @@ class HomeEditorPickBanner extends StatelessWidget {
|
||||
RemoteImage(
|
||||
drama.posterUrl,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackColor: AppColors.contentSurface,
|
||||
),
|
||||
const DecoratedBox(
|
||||
|
||||
@@ -310,7 +310,6 @@ class _PlaylistCollage extends StatelessWidget {
|
||||
child: RemoteImage(
|
||||
drama.posterUrl,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackColor: _filmBody,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -25,7 +25,9 @@ class RecommendSectionCard extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final tagLabel = drama.localizedTag(Localizations.localeOf(context).languageCode);
|
||||
final tagLabel = drama.localizedTag(
|
||||
Localizations.localeOf(context).languageCode,
|
||||
);
|
||||
return SizedBox(
|
||||
width: AppDimens.recommendCardWidth,
|
||||
child: InkWell(
|
||||
@@ -47,7 +49,6 @@ class RecommendSectionCard extends StatelessWidget {
|
||||
RemoteImage(
|
||||
drama.posterUrl,
|
||||
fit: BoxFit.cover,
|
||||
showFallbackIcon: true,
|
||||
fallbackColor: AppColors.contentSurface,
|
||||
),
|
||||
if (tagLabel.isNotEmpty)
|
||||
@@ -80,7 +81,9 @@ class RecommendSectionCard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: AppDimens.cardCoverTitleGap),
|
||||
Text(
|
||||
drama.localizedTitle(Localizations.localeOf(context).languageCode),
|
||||
drama.localizedTitle(
|
||||
Localizations.localeOf(context).languageCode,
|
||||
),
|
||||
key: Key('recommend-title-$sectionKey-${drama.id}'),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -116,7 +119,9 @@ class RecommendSectionCard extends StatelessWidget {
|
||||
}
|
||||
|
||||
List<String> _cardTags(BuildContext context) {
|
||||
final localized = drama.localizedTypeLabels(Localizations.localeOf(context).languageCode);
|
||||
final localized = drama.localizedTypeLabels(
|
||||
Localizations.localeOf(context).languageCode,
|
||||
);
|
||||
if (localized.isNotEmpty) return localized.take(3).toList(growable: false);
|
||||
final seen = <String>{};
|
||||
return [drama.genre, drama.category]
|
||||
|
||||
@@ -70,9 +70,11 @@ class WatchRecordCard extends StatelessWidget {
|
||||
key: ValueKey('watch-record-cover-${record.dramaId}'),
|
||||
width: _coverWidth,
|
||||
height: _coverHeight,
|
||||
showFallbackIcon: true,
|
||||
fallbackIconKey: ValueKey(
|
||||
'watch-record-cover-placeholder-${record.dramaId}',
|
||||
fallbackWidget: ColoredBox(
|
||||
key: ValueKey(
|
||||
'watch-record-cover-placeholder-${record.dramaId}',
|
||||
),
|
||||
color: AppColors.raised,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user