flutter_flavorizr
flutter_flavorizr copied to clipboard
How to use flutter:targets
Hi,
I have the follow scenario: I have a code base that needs to ship with 7 different Titles and Icons
-> Can be solved with flavors, works fine.
But each flavor needs to have different target builds, e.G. test, staging, production etc... Each target has own URLs for server endpoints (custom variables?) So you would have a 2D array of flavor/targets, if you want. 7 Flavors (doc, grumpy, bashful, etc..), with each flavor has 3 Targets (test, production, etc..), resulting in a combination of 21 different builds.
How to solve that?
The docu says about targets:
| flutter:targets | Flutter | Creates a set of targets for each flavor instance |
|---|
But how to use it? So far I tried this. If targets dont work, what can I use for my problem?
flavorizr:
app:
android:
flavorDimensions: "flavor-type"
ios:
flavors:
doc:
app:
name: "Doc"
grumpy:
app:
name: "Grumpy"
bashful:
app:
name: "Bashful"
...
targets:
test:
staging:
production:
hey,
So... basically, in a pure android project you could use a set of dimensions (Android).
this repo only allow to use one dimension in android project....
but....
you could create something like:
flavors:
doc-test:
app:
name: "Doc Test"
doc-dev:
app:
name: "Doc Dev"
doc-production:
app:
name: "Doc Prod"
You need to define three times seven different flavors, each one for your particular destination at this time.
Thanks so much for the help guys. We ended up using -dart--define in combination with flavorizr. Not perfect but its fine for now
You need to define three times seven different flavors, each one for your particular destination at this time.
@AngeloAvv Is this still the recommended way of doing it with flavorizr? I have the same requirement, that I have multiple product flavors like "Corporate A", "Corporate B" and "Corporate C" and now I want to add my api flavors "production", "staging" and "development" for each product flavor.
I think for android it's possible to combine multiple dimensions of flavor, right? But is iOS the problem here?
@sebastianbuechler unfortunately yes