Skip to content

Commit

Permalink
fix: fallbackBackgroundImage bug
Browse files Browse the repository at this point in the history
  • Loading branch information
w8385 committed Aug 29, 2023
1 parent cad6ef5 commit bfdc9dd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions my_solved/lib/widgets/user_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -989,10 +989,13 @@ Widget backgroundImage(BuildContext context, Future<Background> future) {
if (snapshot.hasData) {
return Consumer<UserService>(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,
Expand Down

0 comments on commit bfdc9dd

Please sign in to comment.