Flutter Add Assets Images Folder Path in Pubspec.yaml File iOS Android

The Pub file represents package file in flutter project. Every Pubspec.yaml contains important information about flutter project meta data and dependencies. The Pubspec.yaml file written in YAML(Yaml Ain’t Markup Language). In flutter when we want to use images from local app directory then we should put the Assets/Images folder path in Pubspec.yaml file to notify the project that we have included some new folders in it. So in this tutorial we would Add Assets Images Folder Path in Pubspec.yaml File iOS Android Tutorial.

Contents in this project Add Assets Images Folder Path in Pubspec.yaml File iOS Android Tutorial:

1. Create a folder named as assets in your Flutter project like i did in below screenshot.

2. Inside the assets folder create another folder named as images. In the images folder we will put our all local images.

3. Open your Flutter project folder and locate Pubspec.yaml file.

Add Assets Images Folder Path in Pubspec.yaml File

4. Open Pubspec.yaml file in Visual Studio code editor or In android studio or Notepad editor.

5. Find the flutter: block and put assets: path below.

6. Source code of my Pubspec.yaml file after adding assets path.

 

Leave a Reply

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