diff --git a/lib/presentation/home/widgets/occasion_banner_widget.dart b/lib/presentation/home/widgets/occasion_banner_widget.dart index 646cb70c..1f19b826 100644 --- a/lib/presentation/home/widgets/occasion_banner_widget.dart +++ b/lib/presentation/home/widgets/occasion_banner_widget.dart @@ -56,8 +56,6 @@ class OccasionBackgroundWidget extends StatelessWidget { final backgroundImageUrl = occasionThemeVm.backgroundOpacityImage; final hasBackgroundImage = occasionThemeVm.isOccasionActive && (backgroundImageUrl?.isNotEmpty ?? false); - log("occasionThemeVm.backgroundImageOpacity: ${occasionThemeVm.backgroundImageOpacity}"); - if (!hasBackgroundImage) { return const SizedBox.shrink(); } @@ -65,7 +63,7 @@ class OccasionBackgroundWidget extends StatelessWidget { return Positioned.fill( child: Opacity( opacity: occasionThemeVm.backgroundImageOpacity.clamp(0.0, 1.0), - child: buildOccasionImage(backgroundImageUrl!), + child: buildOccasionImage(backgroundImageUrl!, isNeedPadding: true), ), ); }, @@ -77,24 +75,23 @@ class OccasionBackgroundWidget extends StatelessWidget { /// Day banner) or a raster image (PNG/JPG). [CachedNetworkImage] cannot /// decode SVG — it silently renders nothing — so SVG URLs are routed to /// [SvgPicture.network] instead, based on the URL's file extension. -Widget buildOccasionImage(String url) { +Widget buildOccasionImage(String url, {bool isNeedPadding = false}) { final isSvg = url.split('?').first.toLowerCase().endsWith('.svg'); if (isSvg) { return SvgPicture.network( url, width: double.infinity, - fit: BoxFit.cover, + fit: BoxFit.contain, placeholderBuilder: (_) => const SizedBox.shrink(), ); } return CachedNetworkImage( imageUrl: url, width: double.infinity, - fit: BoxFit.cover, + fit: BoxFit.contain, placeholder: (_, __) => const SizedBox.shrink(), errorWidget: (_, __, error) { - log('OccasionImage: failed to load $url -> $error'); return const SizedBox.shrink(); }, - ); + ).paddingSymmetrical(isNeedPadding ? 24.w : 0, 0); }