fix(flutter): 修复首页冷启动灰屏

This commit is contained in:
Zhou Weidong committed 2026-10-20 16:39:48 +08:00
1 parent 37802b24bf
commit 0d2680e6c1
4 files changed
+19 -3

No files matched your search

+3 -1
View File
@@ -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(
+7 -1
View File
@@ -300,6 +300,11 @@ class _PlayerPageState extends State<PlayerPage> 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),
),
],
);