I need to show image from asset programmatically using custom code: custom widget.
when I try to specify image from asset in my custom code like this: "Image.asset('assets/image/image_name.png')", console (in web publish) show image not found.
When I try to add another widget image that using Image Asset type and use the same image in my custom code the image is displayed, but when I change image in canvas and use different image in my custom code, the image don't show up.
When we use Flutter to program an app, we can specefy in pubspec.yaml file images that we want to use in the app. How can we achieve showing image from asset image in custom widget ?
The image below is a screenshot of screen UI. I need to use custom widget to display image randomly. I add an widget image below it to understand what going on.
This is a code I used to display image in custom widget. I use static image here to understand what happen in my code: Image.asset('assets/images/game_letter_B.png')
As you can see, image C doesn't showing up. B only display because I use an image widget "asset" type from canvas (The "B" below custom widget)
here, A and C must be displayed, but nothing is displayed. and console display image not found
Can you help me to see what happen and who can I resolve this please ?