Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude files from compilation in flutter?

I have a project that builds several similar apps, different apps require different resources. I have folder assets/images_project1 and images/project2. How can I exclude e.g. images/project2 from the compilation? I don't want to manually replace the folders every time. If files still, they increase the app size

like image 495
Bohdan Ilkiv Avatar asked Sep 03 '25 17:09

Bohdan Ilkiv


1 Answers

According to this there is no built-in solution as of right now.

But the easiest thing to do is just manually comment folder in pubspec.yaml under the assets section.

Optionally you can use script from the mentioned question.

like image 144
Hexagonale Avatar answered Sep 07 '25 08:09

Hexagonale