1

I am selecting on image from gallery then uploading it on server, after that on successful upload i am hitting one API to retrieve same image from server and want to show that image in the same ImageView I am using Image.file To load clicked image and Image.network To show Network image but i want One single thing to load image

Sagar
  • 402
  • 2
  • 10

1 Answers1

2

Try this, just set an boolen isProfileImageIsURL, if it is true show NetworkImage widget else FileImage

isProfileImageIsURL ? NetworkImage(profileImageURL) : FileImage(_profilePictureFile);
Navin Kumar
  • 3,393
  • 3
  • 21
  • 46