Reputation: 41
im using flutter and i want to create a user profile with profile picture, i successfully store the image in the firebase storage and save the url link to the firestore in the collection with the field name of profileimage. now im facing a problem with the proper way of showing the profile picture from the firestore.
'Image.network("${loggedInUser.profileimage}",)' this code unfortunately now working for me.
heres my screenshot of firebase
i would like to show the user profile pic along side their full name and email.
Upvotes: 0
Views: 1918
Reputation: 937
Use cached_network_image for displaying images in a proper way.
use it in your code like this.
CachedNetworkImage(
height: 80,
width: 80,
fit: BoxFit.cover,
imageUrl: loggedInUser.profileimage,
errorWidget: (context, url, error) => Icon(Icons.error_outline),
),
Upvotes: 1