File where I want to load image
class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
return Container(
height: 250,
child: Card(
child: Image.asset(
'../../assets/images/person.jpg',
fit: BoxFit.cover,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
elevation: 5,
margin: EdgeInsets.all(10),
),
);
}
}
pubspec.yaml
# To add assets to your application, add an assets section, like this:
assets:
- assets/images/person.jpg
- assets/images/burger.jpg
I have used flutter clean
command also, i get image for once then after adding more images my project stuck. Unable to solve this problem.
Suggestion would be appreciated?