I'm trying to fetch images out of firebase storage with url and Image.network().
But somehow I stuck.
I use this example from firebase storage documentation:
Future downloadURLExample() async {
String downloadURL = await firebase_storage.FirebaseStorage.instance
.ref('users/123/avatar.jpg')
.getDownloadURL();
// Within your widgets:
// Image.network(downloadURL);
return downloadURL;
}
But I dont know how do I get this String downloadURL into my container and Image.network.
I try to do it like this:
Container(
width: 200,
height: 200,
child: Image.network(downloadURL),
),
But it doesnt work. What am I missing?