while adding image asset to my flutter app, whatever the name i set the error still the same and refuse to add the image
my flutter doctor output
/home/ahmed/flutter/bin/flutter --no-color doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel beta, v0.5.1, on Linux, locale en_US.UTF-8) [✓] Android toolchain - develop for Android devices (Android SDK 27.0.3) [✓] Android Studio (version 3.1) [✓] Connected devices (1 available)
• No issues found! Process finished with exit code 0
These are the steps on how to add images in Flutter.
Add your image file to assets folder, you may have to create this folder if it is already not present. Create this folder in your /package root directory
Open pubspec.yaml file and add the following lines there (Keep a note to the spaces)
assets:
- assets/your_image.jpg
Run flutter packages get
in terminal.
You can now use your image in your code like this
AssetImage("assets/your_image.jpg")