Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why is flutter unable to load asset image?

No errors in the code and as far as I can see the pubspec.yaml file is functional, as it worked before.

@override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SafeArea(
          child: Column(
            children: [
              Card(
                child: Image.asset('anyaparent.jpeg'),
              ),
            ],
          ),
        ),
      ),
    );

Error text "Unable to load asset"

[1]: https://i.stack.imgur.com/GeTW2.png
The pubspec.yaml file

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

try doing like this

Image.asset('images/anyaparent.jpeg'),
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading