0

I have added my assets into my projects directory also did everything on pubspec.yaml but I am still getting the Unable to load asset.

I also tried giving a specific path (like - assets/image/x.png) in pubspec, but nothing changed.

What am I doing wrong?

I used it like this

I used it like this

pubspec.yaml

pubspec

assets folder

assets folder

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
vinternal
  • 1
  • 1
  • @Manishyadav Please stop suggesting edits that add `code formatting` to things that aren't actually code. Please read [Inline Code Spans should not be used for emphasis, right?](https://meta.stackexchange.com/q/135112/349538) – Donald Duck May 10 '22 at 16:15

3 Answers3

0

@vinternal just stop and run app again.

Gobi
  • 83
  • 7
0

Turns out i forgot to put a - before family: Roboto. Just fixed it

vinternal
  • 1
  • 1
0

You should carefully follow the structure:

  1. Hey put the assets folder in root folder, I think you have put it under lib folder.

  2. Intendation(space) before the -asset/images in pubspec.yaml should not be changed otherwise it may have issue

Avnish Nishad
  • 1,634
  • 1
  • 17
  • 18