I did to make a simple pokedex application for trying myself. I completed my project and I did not get any issue in android studio.Other hand, When I started my application, I cant see images to get in my project in emulator. Can anyone help me for this issue .
Can look at this extension.
https://github.com/AlejandroTaichu/Pokedex.git
I want to see images in my project when I was opened my project.I am new on programming so I cant fix that.
3
Answers
You have forgotten extension of image in your code
Change to below code
Or add image extension(.png) in names of pokeList
You need to change the image name(path) according to the assets image path include the image type.
Next you need to create a future and call
future
on Future Builder widget.Made a pr on git, you can merge it
I suggest you to use
flutter_gen
(https://pub.dev/packages/flutter_gen) for assets. I recently found this package & its really helpful when using multiple images from assets.With flutter_gen you can just setup few things one time & you can directly get image widgets from this package.
There are many options in this step. You can check their documentation.
Put your images in the path added
After doing these steps you just need to run
This file will generate an assets file name
assets.gen.dart
inside thelib/generated
folder as we setup in step 3.Note that you have to run this command whenever you change folder name or images to regerenated the
assets.gen.dart
Thats it.
When you are done with these steps, you can directly get the images from this
assets.gen.dart
file like thisThe plus benefit is that these assets provided widget support intellisense, so there is no chance for spelling mistake. Plus you directly get a widget from this with all the properties of default Image widget.
It also supports advance image types like svg, lottie, flare as well.