Home > other >  Image not showing web despite correct folder structure and working on local machine - Flutter
Image not showing web despite correct folder structure and working on local machine - Flutter

Time:07-31

folder structure

browser error

I deployed the build/web folder with Firebase hosting. The exact same process, code and folder structure work on another project of mine.

pubspec

I have double-checked my pubspec.yaml as well.

enter image description here

CodePudding user response:

The Container has no height and width to display the decoration.. Also add assets to the path.

Container(
  height: 100,
 width: 100,
 decoration: BoxDecoration(
   Image: DecorationImage(
      ...
   )
 )
)

CodePudding user response:

For some reason, in development mode Flutter recognizes the assets without specifying the full path but I have to write it in full for the build to make sense of it.

  • Related