flutter/flutter

Support exclusion of flavors when conditonally defining assets

lucas-goldner opened this issue · 0 comments

Use case

Imagine I have an app with 20 flavors. I want that one file to be included in 19 flavors but not one specific one.
I would need to add all 19, except for 1 in that big list.

# pubspec.yaml
flutter:
  assets:
    - assets/normal-asset.png
    - path: assets/good-tasting.png
      flavors: 
        - vanilla
        - strawberry
        - chocolate
        - lemon
        - smurf
        - orange
        - ...more

Proposal

How about handling it like in a .gitignore with "!" so it will be included in all other flavors, excluding the ones marked with "!"

# pubspec.yaml
flutter:
  assets:
    - assets/normal-asset.png
    - path: assets/good-tasting.png
      flavors: 
        - !strawberry