userAvatarProvider top-level property
final
Provides the current user's avatar file.
Rebuilds when userProfileProvider emits a new avatarFilename,
so background profile refreshes automatically update the avatar.
Returns null if user has no avatar or not logged in.
Implementation
final userAvatarProvider = FutureProvider.autoDispose<File?>((ref) {
// Watch avatarFilename so this rebuilds when it changes.
ref.watch(
userProfileProvider.select((async) => async.asData?.value?.avatarFilename),
);
return ref.watch(authRepositoryProvider).getAvatar();
});