Card(
child: Container(
height: 250,
width: 180,
//color: Colors.pink,
child: Column(
children: <Widget>[
Container(
height: 190,
width: 160,
decoration: BoxDecoration(
// color:Colors.white,
image: DecorationImage(
image:AssetImage("assets/images/hamlogo.png"),),
),
),
Text("\AED 30.00",style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),),
],
),
),),
pubspec
flutter:
The following line ensures that the Material Icons font is
included with your application, so that you can use the icons in
the material Icons class.
uses-material-design: true
To add assets to your application, add an assets section, like this:
assets:
- assets/images/hamlogo.png
- assets/images/ring.png
- assets/images/dnek.jpeg
I think you are not setting asset correctly, follow this:
first you need create a asset folder in your project root folder, like this:
then in your
pubspec.yaml, underflutter:define it like this:then run
flutter pub getnow if you call image, you can see it:Note: if you still not getting image, please stop project and close ide, then open it again run flutter pub get then run then project.