skip to Main Content

enter image description hereMy flutter project is not displaying my image in the CircleAvatar and I followed the instructions of Angela Yu’s video. I created a new directory for the image, set my path in pubspec.yamal and then incorporated the path into my main.dart. The image is not showing and all other things are working. What can I do?

The code

2

Answers


    1. If you’r in android studio then right clcik on the file and then there’ll a option copy reference Path like this:
      enter image description here

    you can past this copied path into your AssetsImage(here) path

    1. add root folder (assets) in your pubspec.yaml file like this:enter image description here
    Login or Signup to reply.
  1. Add assets/images/ in pubspec.yamal

    Ex.

    flutter:
    uses-material-design: true

    assets:
    – assets/images/

    Useing.
    Image.asset(‘assets/images/name_img.jpg’),

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search