Flutter error while adding images(assets)

530 Views Asked by At
2

There are 2 best solutions below

0
On

First of all create a folder in your project named assets, not in your lib folder. After that in pubspace.yaml define your folder like this assets/images/

enter image description here

enter image description here

0
On

You are doing wrong thing in pubspace.yaml. Maintain whitespaces as shown in below

flutter:
  assets:
    - assets/