Home > front end >  Folder keeps getting deleted | flutter
Folder keeps getting deleted | flutter

Time:12-14

There is this problem that I am encountering, the folder that I keep creating inside the build/flutter_assets folder, images.

enter image description here

Whenever I stop running the application, the folder just disappears. This doesn't happen to my other projects though, and I have browsed the internet if there was a similar problem but none.

I also did not have any code that deletes a certain folder.

CodePudding user response:

Why are you trying to add folders in the build folder?

The build folder is updated every time you run your application. It is an automated process that is also affected by the flutter clean which deletes the content of the build folder and rebuilds everything from scratch to clear possible leftovers of previous builds. If you store anything in the build folder it will be deleted the moment you clean your previous build (which believe me, you would do at some point), do not add anything in there.

The folder flutter_assets is created automatically and you should not change it. If you want to have an assets folder you have to create it directly in the root folder your_project/assets

  • Related