Assets do not load but when I hot reload


I am new to flutter. I am getting image from backend and displaying those images on the screen using Hero and FadeInImage.
I ave added the hyperlinks in the images and generating the list of images after hitting the API.

child: Hero(
                tag: tag,
                child: FadeInImage(
                  width: 130.0,
                  height: 186.0,
                  placeholder: AssetImage('assets/images/splash1.png'),
                  fit: BoxFit.cover,

                  // onTap: _launchUrl(),

                  image: NetworkImage(
                  // fit: BoxFit.cover,

when I run my app, the images are not loaded; the screen is empty. But when I hot reload it shows.

            (index) {

              return MerchantCard(merchant: merchantsList[index]);


The problem was actually widget was built before values are populated in the list. I used setState on my listPopulated function and it worked perfectly ok.

Answered By – doc

Answer Checked By – Timothy Miller (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *