Skip to content

Commit 1a37418

Browse files
avatar: Show placeholder on image load error.
Previously, if an avatar image failed to load from its URL, the space for the avatar would simply be empty. This could be confusing for the user. This change adds an errorBuilder to the RealmContentNetworkImage widget. Now, in case of a network error or an invalid URL, a standard placeholder with a person icon is displayed. This provides a better and more consistent user experience. Fixes #1558.
1 parent de03f4b commit 1a37418

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/widgets/user.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ class AvatarImage extends StatelessWidget {
9090
avatarUrl.get(physicalSize),
9191
filterQuality: FilterQuality.medium,
9292
fit: BoxFit.cover,
93+
errorBuilder: (context, error, stackTrace) {
94+
return _AvatarPlaceholder(size: size);
95+
},
9396
);
9497
}
9598
}

0 commit comments

Comments
 (0)