Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conditional assets in Flutter

Tags:

flutter

I have an app with multiple flavours. Assets are flavour-specific, and I'm looking for a way to filter out the assets that don't apply for the current flavour. The current structure looks like

assets
  flavour1
    image.jpg
  flavour2
    image.jpg

In other words, how do I make sure that when I compile flavour1 the assets folder gets truncated down to

assets
  flavour1
    image.jpg
like image 388
vasily Avatar asked Jul 03 '26 21:07

vasily


1 Answers

This must work since flutter released this : https://docs.flutter.dev/deployment/flavors#conditionally-bundling-assets-based-on-flavor

like image 119
Eng Avatar answered Jul 06 '26 13:07

Eng



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!