Advertisements
Good afternoon to everyone.
I am a very new developer on flutter, and I made a simple app, to show an image
void main() {
runApp(MaterialApp(
home: Scaffold(backgroundColor: Colors.blueGrey,
appBar: AppBar(
centerTitle: true,
backgroundColor: Colors.purpleAccent,
title: Text("I am Rich"),
) ,
body: Center(
child: Image(
image: AssetImage('Images/diamond.png'),
),
),
)
));
}
I followed the flutter documentation, to resolve this issue
https://docs.flutter.dev/ui/assets/assets-and-images
I specify in my yaml file
flutter:
uses-material-design: true
assets:
- Images/
in the console I get
======== Exception caught by image resource service ================================================
The following assertion was thrown resolving an image codec:
Unable to load asset: "Images/diamond.png".
and my folder is named Images
>Solution :
Use all lowercase letters for assets folder path.