From bfdc9dd8e1a89f0c59d1ed7d66b24f5ddd61f948 Mon Sep 17 00:00:00 2001 From: w8385 Date: Tue, 29 Aug 2023 16:17:24 +0900 Subject: [PATCH] fix: fallbackBackgroundImage bug --- my_solved/lib/widgets/user_widget.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/my_solved/lib/widgets/user_widget.dart b/my_solved/lib/widgets/user_widget.dart index 6e690a82..a04b7441 100644 --- a/my_solved/lib/widgets/user_widget.dart +++ b/my_solved/lib/widgets/user_widget.dart @@ -989,10 +989,13 @@ Widget backgroundImage(BuildContext context, Future future) { if (snapshot.hasData) { return Consumer(builder: (context, provider, child) { bool isIllustration = provider.isIllustration; + String backgroundImageUrl = snapshot.data?.backgroundImageUrl ?? + 'https://static.solved.ac/profile_bg/abstract_001/abstract_001_light.png'; + String fallbackBackgroundImageUrl = + snapshot.data?.fallbackBackgroundImageUrl ?? backgroundImageUrl; + return ExtendedImage.network( - isIllustration - ? snapshot.data?.backgroundImageUrl ?? '' - : snapshot.data?.fallbackBackgroundImageUrl ?? '', + isIllustration ? backgroundImageUrl : fallbackBackgroundImageUrl, cache: true, height: MediaQuery.of(context).size.height * 0.25, fit: BoxFit.fitHeight,