skip to Main Content

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

3

Answers


  1. Chosen as BEST ANSWER

    After restart it started working as expected !


  2. 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

    Login or Signup to reply.
  3. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search