user14001097
user14001097

Reputation:

asset images not showing in release version of app in flutter?

I have made a list of images and using ListView.builder to display the images and its working perfectly fine while debugging and even in debug apk of the app but when i use release apk its not showing the images.

List<Activity> act = [
    Activity('assets/sports.png', 'Sports', false),
    Activity('assets/sleeping.png', 'Sleep', false),
    Activity('assets/shop.png', 'Shop', false),
    Activity('assets/relax.png', 'Relax', false),]

I am using ListView.builder to show images like this:

ListView.builder(
              scrollDirection: Axis.horizontal,
              itemCount: act.length,
              itemBuilder: (context, index) {
                return Row(children: <Widget>[
                  SizedBox(
                    width: 15,
                  ),
                  GestureDetector(
                      child: ActivityIcon(act[index].image)));

Upvotes: 3

Views: 2851

Answers (2)

Sahil R
Sahil R

Reputation: 61

Make sure that you've "use-material-design: true" line above assets

enter image description here

Upvotes: 1

Omatt
Omatt

Reputation: 10539

There doesn't seem to be an issue from the code you've provided. It'll greatly help if you're able to provide any errors received from the app when the issue occurred. Another way that you can try is by switching to different Flutter channels and see if the app performs better.

Upvotes: 0

Related Questions