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.
3. Open your Flutter project folder and locate 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.
description: A new Flutter project.
sdk: ">=2.1.0 <3.0.0"
# The following section is specific to Flutter.