See how to display an image in your flutter app using a local image file included in your codebase. 👉 Complete Code: github.com/dav... #flutter #flutterwidgets
If the path is specified in the pubspec.yaml, why then must we specify the path in Image.asset? Seems unless going outside the established path in pubspec, one could just use Image.asset('rocket.jpg') ???
No, Image.asset('rocket.jpg') will not work. The line in pubspec.yaml will make flutter aware of the images in the folder so they can be compiled/used, but you still need to reference them by their full path.