I add the image in image folder and enable assets from 'yaml' file in flutter. When i gave the path of assets image and debug the code it shows an Exception that 'Unable to load assets. Assets not found'. In Pubspec.yaml file there is no error at all by enable the assets.. Here is picture of code and output window.
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: gradientcolors, // reusable gradient colors argument
begin: startAlignment,
end: endAlignment,
),
),
child: Center(
child: Image.asset('images/blank-profile-picture-973460_640.png'),
),
);
}
I tried to make images directory in the lib directory as well as separately but it doesn't work for both type..
- images/blank-profile-picture-973460_640.png```
I made some changes in my code and now it also not showing the image.. changing in image is as following..
[Root Directory are as][1] [1]: https://i.stack.imgur.com/JffNo.png