Thuta Learning
AdvancedMobile Developmentbeginner

Adding Assets (Images)

Relax. We'll talk through this in plain words — no textbook voice.

Assets are the static files your app uses. Images, icons, JSON files, fonts, and the like get placed in your project folder and declared in pubspec.yaml. Flutter reads that list in pubspec.yaml and bundles them into the build.

dart
# pubspec.yaml
flutter:
  uses-material-design: true
  assets:
    - assets/images/logo.png
    - assets/data/menu.json

# Dart widget
Image.asset('assets/images/logo.png')
You should see
You'll be able to display the logo.png image on the app screen.

Next Steps

After local assets, learn how to read network/API data using async techniques.

Easy traps

  • Wrong indentation in pubspec.yaml is the most common reason assets don't show up. YAML doesn't like tabs — use spaces.
Adding Assets (Images) | Thuta Learning