'Upload image to Firebase Storage and show as Profile Image after login again

My problem is that, if I select or capture an image then it update and store to firebase but when I login again then the defualt image shows. below is the code for get image.

Future takePhoto(ImageSource source) async { final pickedFile = await _picker.pickImage( source: source ); selectedImage = File(pickedFile!.path);

final _firebaseStorage = FirebaseStorage.instance;
var snapshot = await _firebaseStorage.ref()
    .child('images/imageName')
    .putFile(selectedImage!);
var downloadUrl = await snapshot.ref.getDownloadURL();

print("hi there is a print statement with url      "+downloadUrl);
setState(() {
  imageUrl = downloadUrl;
  _imageFile = pickedFile;
});

}



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source