I can't find anywhere teaches how to add a specified image within asset. Actually I don't know which pictures are included in the asset, or if I want to use an image from the Internet or my own photo gallery, I don't know how I can link the picture with the asset and apply it in my code. Similarly, I also don't know what are included in packages, like font_awesome flutter. How can I check what are included? Thank you! I think I have solved the above questions with the help of commenters, but I have more questions coming up: Why I was unable to load the asset? Please see the pictures below. enter image description here enter image description here
you can place your assets in a directory in your project folder.
For example assets\drawables\
and assets\icons\
Then in your pubspec.yaml
you should declare that folder. In this example:
# To add assets to your application, add an assets section, like this:
assets:
- assets/drawables/
- assets/icons/
Than in your code you can use them as follow:
Image.asset(
'assets/drawables/image.png',
width: 200,
),
For your second question, I think you only have two options: either look for the library documentation / website, such as www.fontawesome.com (the free icons are the one in the library). Or look in the code/package yourself