You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But this get very tedious when many assets are present and somewhat removes the point of FlutterGen except compilte-time safety.
PS:
Each asset (even when it is present in multiple flavors) has flavors field which always contains a single flavor at best. What is even the point of this field?
Describe the solution
I understand that FlutterGen doesn't want to impose its own folder structure requirements while flutter provides full customizability but without it such cases might not be possible to solve in a reasonable way.
What I suggest is to add additional layer of code generation. So it will generate all assets as it currently does (eg. basically mirroring tree structure of original folders) but also (can be configurable):
Is there an existing issue for this?
Describe the problem
Common pattern for whitelabel solutions is to have different flavors folders per customer:
And after that you just get resource as:
"assets/${appFlavor}/logo.png"
Sadly, this is basically not possible to do with flutterGen. There is no way to "inject" flavor:
You cannot switch-case root flavor directory because types are different
$AssetsCustomer1Gen
vs$AssetsCustomer2Gen
:Basically the only solution I can see at this moment is to switch case for each "flavored" resource:
But this get very tedious when many assets are present and somewhat removes the point of FlutterGen except compilte-time safety.
PS:
Each asset (even when it is present in multiple flavors) has
flavors
field which always contains a single flavor at best. What is even the point of this field?Describe the solution
I understand that
FlutterGen
doesn't want to impose its own folder structure requirements while flutter provides full customizability but without it such cases might not be possible to solve in a reasonable way.What I suggest is to add additional layer of code generation. So it will generate all assets as it currently does (eg. basically mirroring tree structure of original folders) but also (can be configurable):
/assets/{flavor}/**
formatLets say we have following assets:
FlutterGen
can generate something like:Personally, I don't see any point in
flavors
field but in case there are any - this solution fits it.Additional context
It would also be greate if flavors can override common resources but it is no a part of current task.
Code of Conduct
The text was updated successfully, but these errors were encountered: