0

I have a ListView for load a list of images using advanced network image plugin like this:

@override
  Widget build(BuildContext context) {
    super.build(context);

    return CachedNetworkImage(
      imageUrl: parseURLImageFromService(productImageURL),
      height: screen.width * ratio,
      placeholder: Container(
        alignment: AlignmentDirectional.center,
        child: CircularProgressIndicator(
          valueColor: AlwaysStoppedAnimation(
            CompanyColors.green[500],
          ),
        ),
      ),
      errorWidget: defaultLogoImage(screen, ratio),
      width: screen.width * (ratio * 0.75),
    );
  }
}

But when i render the app, all image try to load at the same time, i would like to load the images ony by one waiting the previous.

Cortes K.
  • 1
  • 2
  • 1

1 Answers1

0

I found a way to solve this, but the solution isn't related with Flutter. The main problem is the size of the images and the network speed of download, I solve this adding a function on the backend, that function resize the image when it's uploaded. So when I display the list of image I use the miniature image and when the user open the details I load the original size image.

Cortes K.
  • 1
  • 2
  • 1