Working with Assets in Your Flutter App

image from pexels

in the flutter application sometimes we need to call some file and displaying to image in your Flutter App

now I will share how to add and display images using assets in Flutter, let’s get started

here, I use Android Studio to create Flutter Project, let’s create a project named hello_image

select SDK PATH
Creating Project

then the project is successfully created, refer to the flutter official docs, we need to configure the assets in pubspec.yaml let’s do that in the next step

An asset is a file that is bundled and deployed with your app and is accessible at runtime

add this to your pubspec.yaml uncomment assets in `

assets:
- assets/

then create assets directory in root project

now after the complete configuration above let’s display to the app, for example, create a flutter basic application like this

app to display images

then build and run the flutter application, let’s see the result

result in our flutter application

that’s how to display images in the flutter application, thank you for reading, hopefully it’s useful and good luck

Interesting with Blockchain and Opensource Project my journal: https://www.perykun.xyz/