I found the two ways to fetch images from firebase storage.
- Using imagePath
When saving an image to storage, store that image path to firestore, and when fetching the image, use that image path from firestore and call FirebaseStorage instance.
// In this case, get & post imagePath info String through firebase firestore
FirebaseStorage.instance.storage.ref().child('imagePath').getData()
- Using image url
When saving an image to storage, store that image url to firestore, and when fetching the image, use that image url from firestore as network image (no need to call FirebaseStorage instance).
// In this case, get & post imageUrl String through firebase firestore
Firestore.instance.collection('images').document('foo').get()
Which one would be the better way? Is there any performance difference?