diff --git a/lib/core/widgets/remote_image.dart b/lib/core/widgets/remote_image.dart index fd3a490..60d10be 100644 --- a/lib/core/widgets/remote_image.dart +++ b/lib/core/widgets/remote_image.dart @@ -16,6 +16,7 @@ class RemoteImage extends StatelessWidget { this.showFallbackIcon = false, this.fallbackIconKey, this.fallbackAspectRatio, + this.fallbackColor = AppColors.bar, }); final String path; @@ -25,6 +26,7 @@ class RemoteImage extends StatelessWidget { final bool showFallbackIcon; final Key? fallbackIconKey; final double? fallbackAspectRatio; + final Color fallbackColor; @override Widget build(BuildContext context) { @@ -47,7 +49,7 @@ class RemoteImage extends StatelessWidget { final fallback = Container( width: width, height: height, - color: AppColors.bar, + color: fallbackColor, alignment: Alignment.center, child: showFallbackIcon ? Icon( diff --git a/lib/pages/player/player_view.dart b/lib/pages/player/player_view.dart index b03546d..186c370 100644 --- a/lib/pages/player/player_view.dart +++ b/lib/pages/player/player_view.dart @@ -300,6 +300,11 @@ class _PlayerPageState extends State with WidgetsBindingObserver { return Stack( fit: StackFit.expand, children: [ + if (widget.homeMode) + const ColoredBox( + key: Key('home-feed-black-background'), + color: Colors.black, + ), if (!ready) _PlayerFallbackBackground(posterUrl: drama.posterUrl), ?video, if (widget.homeMode && _chromeVisible && !logic.chromeHidden) @@ -580,10 +585,11 @@ class _PlayerFallbackBackground extends StatelessWidget { posterUrl, key: const Key('player-fallback-cover'), fit: BoxFit.cover, + fallbackColor: Colors.black, ), const ColoredBox( key: Key('player-fallback-scrim'), - color: Color(0x66000000), + color: Color(0x4D000000), ), ], ); diff --git a/test/home/k28_a_navigation_test.dart b/test/home/k28_a_navigation_test.dart index 89324f9..31a6fe0 100644 --- a/test/home/k28_a_navigation_test.dart +++ b/test/home/k28_a_navigation_test.dart @@ -59,6 +59,7 @@ void main() { expect(find.byKey(const Key('home-feed-title')), findsOneWidget); expect(find.byKey(const Key('home-feed-full-series')), findsOneWidget); + expect(find.byKey(const Key('home-feed-black-background')), findsOneWidget); expect(find.byType(PageView), findsOneWidget); expect(find.byKey(const Key('home-browse-page')), findsNothing); expect( diff --git a/test/player/player_fullscreen_test.dart b/test/player/player_fullscreen_test.dart index 2e17534..c01d548 100644 --- a/test/player/player_fullscreen_test.dart +++ b/test/player/player_fullscreen_test.dart @@ -13,6 +13,7 @@ import 'package:fruitshorts/core/data/repositories/favorite_repository.dart'; import 'package:fruitshorts/core/data/repositories/playback_repository.dart'; import 'package:fruitshorts/core/data/repositories/watch_history_repository.dart'; import 'package:fruitshorts/core/theme/app_colors.dart'; +import 'package:fruitshorts/core/widgets/remote_image.dart'; import 'package:fruitshorts/pages/player/widgets/player_center_toggle.dart'; import 'package:fruitshorts/pages/player/widgets/seek_progress_bar.dart'; @@ -333,11 +334,17 @@ void main() { final fallback = find.byKey(const Key('player-fallback-background')); expect(fallback, findsOneWidget); expect(find.byKey(const Key('player-fallback-cover')), findsOneWidget); + expect( + tester + .widget(find.byKey(const Key('player-fallback-cover'))) + .fallbackColor, + Colors.black, + ); expect( tester .widget(find.byKey(const Key('player-fallback-scrim'))) .color, - const Color(0x66000000), + const Color(0x4D000000), ); expect( tester