FLUTTER How to fix Image file not found in pubspec yaml
HTML-код
- Опубликовано: 11 сен 2024
- flutter could not find image file in pubspec.yaml
Issue :
image file not found in flutter in pubspec.yaml
To fix it:
1. Make sure your image folder in on the root folder of your application.
2. To know the root folder is the folder that is above the lib folder of your application. Or the same folder as your pubsec.yml
Make sure the indentation is correct.
In pubspec.yaml
You see an horizontal line :
3. For the assets section : Put two spaces before the horizontal line
4. For the images section : Put 3 spaces before your line
Add a dash - then a space before your filename path.
5. Save and restart your project.