Bohdan Ilkiv
Bohdan Ilkiv

Reputation: 143

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

Upvotes: 4

Views: 3188

Answers (2)

Tulleb
Tulleb

Reputation: 9206

This answer could also work out for you.

You would just have to use a debug flag instead of a production one.

Upvotes: 0

Hexagonale
Hexagonale

Reputation: 160

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.

Upvotes: 3

Related Questions