From 66ffc8c112a40650af7127d77eb5e302302124f8 Mon Sep 17 00:00:00 2001 From: PartyDonut Date: Sun, 12 Oct 2025 23:10:31 +0200 Subject: [PATCH] chore: Small adjustment to poster colors --- lib/screens/shared/media/chapter_row.dart | 64 ++++++++++--------- .../shared/media/components/poster_image.dart | 9 ++- lib/screens/shared/media/episode_posters.dart | 29 ++++++--- lib/screens/shared/media/people_row.dart | 6 +- lib/screens/shared/media/season_row.dart | 21 ++++-- lib/util/focus_provider.dart | 2 +- 6 files changed, 84 insertions(+), 47 deletions(-) diff --git a/lib/screens/shared/media/chapter_row.dart b/lib/screens/shared/media/chapter_row.dart index 39920dd..9fc6505 100644 --- a/lib/screens/shared/media/chapter_row.dart +++ b/lib/screens/shared/media/chapter_row.dart @@ -5,6 +5,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:iconsax_plus/iconsax_plus.dart'; import 'package:fladder/models/items/chapters_model.dart'; +import 'package:fladder/theme.dart'; import 'package:fladder/util/adaptive_layout/adaptive_layout.dart'; import 'package:fladder/util/focus_provider.dart'; import 'package:fladder/util/humanize_duration.dart'; @@ -59,42 +60,45 @@ class ChapterRow extends ConsumerWidget { }, ); }, - child: Card( + child: Container( + decoration: BoxDecoration( + borderRadius: FladderTheme.smallShape.borderRadius, + color: Theme.of(context).colorScheme.surfaceContainer, + ), + foregroundDecoration: BoxDecoration( + borderRadius: FladderTheme.smallShape.borderRadius, + border: Border.all(width: 2, color: Colors.white.withAlpha(25)), + ), child: AspectRatio( aspectRatio: 1.75, - child: Stack( - fit: StackFit.expand, - children: [ - CachedNetworkImage( - imageUrl: chapter.imageUrl, - fit: BoxFit.cover, - placeholder: (context, url) => const Icon(IconsaxPlusBold.image), - ), - Align( - alignment: Alignment.bottomLeft, - child: Padding( - padding: const EdgeInsets.all(5), - child: Card( - elevation: 0, - shadowColor: Colors.transparent, - color: Theme.of(context).cardColor.withValues(alpha: 0.4), - child: Padding( - padding: const EdgeInsets.all(5), - child: Text( - "${chapter.name} \n${chapter.startPosition.humanize ?? context.localized.start}", - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.bodyMedium?.copyWith(fontWeight: FontWeight.bold), - ), - ), - ), - ), - ), - ], + child: CachedNetworkImage( + imageUrl: chapter.imageUrl, + fit: BoxFit.cover, + placeholder: (context, url) => const Icon(IconsaxPlusBold.image), ), ), ), overlays: [ - if (AdaptiveLayout.of(context).isDesktop) + Align( + alignment: Alignment.bottomLeft, + child: Padding( + padding: const EdgeInsets.all(5), + child: Container( + color: Theme.of(context).colorScheme.surfaceContainer, + child: Padding( + padding: const EdgeInsets.all(5), + child: Text( + "${chapter.name} \n${chapter.startPosition.humanize ?? context.localized.start}", + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyMedium?.copyWith(fontWeight: FontWeight.bold), + ), + ), + ), + ), + ), + ], + focusedOverlays: [ + if (AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer) ExcludeFocus( child: Align( alignment: Alignment.bottomRight, diff --git a/lib/screens/shared/media/components/poster_image.dart b/lib/screens/shared/media/components/poster_image.dart index 16ee3e1..afa2316 100644 --- a/lib/screens/shared/media/components/poster_image.dart +++ b/lib/screens/shared/media/components/poster_image.dart @@ -78,7 +78,14 @@ class PosterImage extends ConsumerWidget { onLongPress: () => _showBottomSheet(context, ref), onSecondaryTapDown: (details) => _showContextMenu(context, ref, details.globalPosition), child: Container( - color: Theme.of(context).cardColor, + decoration: BoxDecoration( + borderRadius: radius, + color: Theme.of(context).colorScheme.surfaceContainer, + ), + foregroundDecoration: BoxDecoration( + borderRadius: radius, + border: Border.all(width: 2, color: Colors.white.withAlpha(25)), + ), child: FladderImage( image: primaryPosters ? poster.images?.primary diff --git a/lib/screens/shared/media/episode_posters.dart b/lib/screens/shared/media/episode_posters.dart index 45781d4..d61e40b 100644 --- a/lib/screens/shared/media/episode_posters.dart +++ b/lib/screens/shared/media/episode_posters.dart @@ -7,6 +7,7 @@ import 'package:fladder/models/syncing/sync_item.dart'; import 'package:fladder/providers/settings/client_settings_provider.dart'; import 'package:fladder/providers/sync/sync_provider_helpers.dart'; import 'package:fladder/screens/syncing/sync_button.dart'; +import 'package:fladder/theme.dart'; import 'package:fladder/util/adaptive_layout/adaptive_layout.dart'; import 'package:fladder/util/fladder_image.dart'; import 'package:fladder/util/focus_provider.dart'; @@ -174,15 +175,25 @@ class EpisodePoster extends ConsumerWidget { }, child: Hero( tag: heroTag ?? UniqueKey(), - child: FladderImage( - image: !episodeAvailable ? episode.parentImages?.primary : episode.images?.primary, - placeHolder: placeHolder, - blurOnly: !episodeAvailable - ? true - : ref.watch(clientSettingsProvider.select((value) => value.blurUpcomingEpisodes)) - ? blur - : false, - decodeHeight: 250, + child: Container( + decoration: BoxDecoration( + borderRadius: FladderTheme.smallShape.borderRadius, + color: Theme.of(context).colorScheme.surfaceContainer, + ), + foregroundDecoration: BoxDecoration( + borderRadius: FladderTheme.smallShape.borderRadius, + border: Border.all(width: 2, color: Colors.white.withAlpha(25)), + ), + child: FladderImage( + image: !episodeAvailable ? episode.parentImages?.primary : episode.images?.primary, + placeHolder: placeHolder, + blurOnly: !episodeAvailable + ? true + : ref.watch(clientSettingsProvider.select((value) => value.blurUpcomingEpisodes)) + ? blur + : false, + decodeHeight: 250, + ), ), ), overlays: [ diff --git a/lib/screens/shared/media/people_row.dart b/lib/screens/shared/media/people_row.dart index 4b2ec42..37459c0 100644 --- a/lib/screens/shared/media/people_row.dart +++ b/lib/screens/shared/media/people_row.dart @@ -59,7 +59,11 @@ class PeopleRow extends ConsumerWidget { child: Container( decoration: BoxDecoration( borderRadius: FladderTheme.smallShape.borderRadius, - color: Theme.of(context).cardTheme.color?.withValues(alpha: 0.1), + color: Theme.of(context).colorScheme.surfaceContainer, + ), + foregroundDecoration: BoxDecoration( + borderRadius: FladderTheme.smallShape.borderRadius, + border: Border.all(width: 2, color: Colors.white.withAlpha(25)), ), child: FocusButton( onTap: () => Navigator.of(context).push( diff --git a/lib/screens/shared/media/season_row.dart b/lib/screens/shared/media/season_row.dart index b48e407..64b1199 100644 --- a/lib/screens/shared/media/season_row.dart +++ b/lib/screens/shared/media/season_row.dart @@ -5,6 +5,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:fladder/models/items/season_model.dart'; import 'package:fladder/providers/sync/sync_provider_helpers.dart'; import 'package:fladder/screens/syncing/sync_button.dart'; +import 'package:fladder/theme.dart'; import 'package:fladder/util/adaptive_layout/adaptive_layout.dart'; import 'package:fladder/util/fladder_image.dart'; import 'package:fladder/util/focus_provider.dart'; @@ -83,11 +84,21 @@ class SeasonPoster extends ConsumerWidget { child: Hero( tag: myKey, child: FocusButton( - child: FladderImage( - image: season.getPosters?.primary ?? - season.parentImages?.backDrop?.firstOrNull ?? - season.parentImages?.primary, - placeHolder: placeHolder(season.name), + child: Container( + decoration: BoxDecoration( + borderRadius: FladderTheme.smallShape.borderRadius, + color: Theme.of(context).colorScheme.surfaceContainer, + ), + foregroundDecoration: BoxDecoration( + borderRadius: FladderTheme.smallShape.borderRadius, + border: Border.all(width: 2, color: Colors.white.withAlpha(25)), + ), + child: FladderImage( + image: season.getPosters?.primary ?? + season.parentImages?.backDrop?.firstOrNull ?? + season.parentImages?.primary, + placeHolder: placeHolder(season.name), + ), ), onSecondaryTapDown: (details) async { Offset localPosition = details.globalPosition; diff --git a/lib/util/focus_provider.dart b/lib/util/focus_provider.dart index 4e27ba4..17e6ef0 100644 --- a/lib/util/focus_provider.dart +++ b/lib/util/focus_provider.dart @@ -172,7 +172,7 @@ class FocusButtonState extends State { : null, border: Border.all( width: value ? 3.5 : 2, - color: value ? Theme.of(context).colorScheme.primary : Colors.white.withAlpha(15), + color: Theme.of(context).colorScheme.primary.withValues(alpha: value ? 1 : 0.0), ), ), child: FlatButton(