Repository navigation
Conversation
|
Manifest files are loaded in following order
Assets file format is the same as pubspec.yaml. |
|
TODO
|
|
See sample project here: Feel free to comment. |
|
@sestegra thanks for the proposal! I think before we land a change to our project structure and manifest files, we need to think more about all the use cases we plan to support and come up with a comprehensive way to do so. For example, we're likely going to want to support asset resolution based on:
See also the discussion in #16015 Since you've obviously thought about this problem some, would you be willing to write up a proposal for how to tackle this more comprehensively (in prose, not in code) as an informal RFC? We're thinking about how to formalize a Flutter RFC process, but we don't have one yet 😄 |
|
This pull request was more a POC than an implementation (missing tests...) I'm quite busy right now, but I took some time to initiate the request. I guess the RFC process could be managed in a more collaborative way: I mean outside this thread. Basically, it's only a draft from scratch and it could be a starting point to other contributors to collaborate. Assets Management and flavoring RFCAssets Management and flavoring ReferencesIssues
Articles and projects
Localization Device screen size / pixel density / form-factor
Use casesAssets like images, text or raw data could be diversified regarding many use cases, some of these use cases are presented below. Debug / Staging / ProductionIn order to install debug, staging and/or production flavor of your application on the same device, they need to have different ApplicationId/BundleId. For instance, to avoid public leakage of production assets, it could be useful to have different assets per flavor. Debug/Staging assets could be only placeholders or mocked data. Free / Paid versionFree and paid version could differ in the assets they need. Localization / Text directionText and graphics containing references to objects, actions or ideas which, in a given culture, may be subject to misinterpretation or viewed as insensitive. Security / ComplianceFor security and/or compliance reasons, some assets could not be exposed before production, but should be tested with placeholders or mocked data. Device screen size / Pixel densityAssets density is already addressed by current Flutter assets management. Platform / LayoutFlutter is currently supporting android, iOS and Fuschia platform. Possible variablesRegarding previous use cases, the following variables should be taken into account to develop assets management and flavoring:
Possible solutions
|
|
#5813 is also an interesting related requirement |
|
This would be a great advantage for Flutter. Any updates? |
|
Working through our backlog: This is a good proposal, and I agree that it would be great to have both #8230 and #21682 supported. I don't think this PR is the way to go about doing so however. I see a lot of opportunities where we could accidentally end up caching the wrong assets, failing to delete older assets, or not copying them as needed. It may work incidentally as we disabled most build caching, but as I work to re-enabled this in the next few months it will become another issue. The second concern is that with the current build system this will lead to more build invalidations than necessary. For example, switching flavors would cause Finally, this PR has no tests. We simply cannot accept major feature additions without tests. I'm going to close this PR , but I would love to solve it differently this year. |
Need to expose flavor parameters to support different set of assets depending on --flavor xxx (#21682)
Need to expose platform parameters to support different set of assets dependeint on --target-platform xxx (#8230)