-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support flavors on web #59388
Comments
Hi @jld3103 |
My only idea was to create separate icons and manifests and use a single index.html file which loads a dynamically generated javascript file which contains the selected flavor. This flavor also needs to be acessible in the dart code. It could use a js interface for that. I'm not sure if that's a possible solution, but it feels a bit to hacky. |
@jld3103 You can better ideas if you ask this one Stackoverflow or somewhere else Please see https://flutter.dev/community for resources and asking questions like this, |
I'm not asking for help to implement it, but rather for flutter to support it. If flavors are supported on Android and iOS and developers want to port their app to web it will not go well. I mean without official support I now have to craft something custom for my app. |
We have no plans to support flavors on the web. As an alternative you might consider using dart-defines or different entrypoints.
Its not really clear why you need flavors for this. Can you file an issue for the problem you are trying to solve, instead of a request for a specific solution |
My current workflow contains a script that creates two apps with |
But what is the relevant code? Are you replacing constants? or...? |
Don't have time rn, but here is the script: https://github.com/Viktoriaschule/App/blob/master/scripts/bin/create_app.dart |
I don't really have time to figure out your command line tool. Please file a new bug with the problems you want solved rather than the solution you want implemented |
Until Flutter implements flavors for the web builds for directing web builds to different Firebase projects, here is a workaround using deploy targets. The workaround works like this (see link above for instructions on how to set it up): iOS and AndroidFor iOS and Android, to target these firebase instances I use Flutter flavors:
Web (Local web hosting server)
CTL-C to stop the local web server Web (Firebase web hosting server)For the Web, to target these firebase instances I use firebase deploy targets:
|
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Use case
I have two apps that are basically the same modular app with different features loaded. Currently I have to separate apps that import the same package which handles all the modular things. I figured out that flavors would be perfect to make it simpler, but flavors don't work on web.
Proposal
Flavors should be implemented for web. I know this is harder than on Android or iOS, because the web has no concept of flavors, but still this feature is needed to by developers that use flavors on Android and iOS and want to expand to web.
The text was updated successfully, but these errors were encountered: