Home > other >  CachedNetworkImage is not displaying image though image is not null
CachedNetworkImage is not displaying image though image is not null

Time:12-25

I am facing this weird error, though imageUrl is not null, placeholder is getting triggered instead of image build.

 Container(
          height: specialOfferTileHeight,
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(20),
          ),
          child: CachedNetworkImage(
              fit: BoxFit.cover,
              imageUrl: homeSpecialModel.image.url,
              placeholder: (context, url) => Text(url),
              errorWidget: (context, url, error) => Text(error)),
        )

Output:

enter image description here

imageUrl is url

CodePudding user response:

It took me about 25s to load the image for the first time. And for flutter, it may take more than 25s, you can try with a lighter image to try

CodePudding user response:

I doubt that you are specifying correct url. Try to debug with print(homeSpecialModel.image.url);. Check that it is exact url that you provided. Or you can directly put String value of url like

imageUrl: "https://res.cloudinary.com/dpurb6xes/image/upload/v1668425797/vivans/ijynvhpdy7hms8z2vuhh.png",

If the url is correct, but still you are getting this error then provide with screenshots please.

CodePudding user response:

After restart it started working as expected !

  • Related