-
Notifications
You must be signed in to change notification settings - Fork 8
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
Multiple dotenv_path s #42
Comments
Hi. Thank you for proposal. Could you explain more how it solves your issue? You expect to create 2 .env files with exact set of variables but in a different places? |
Thanks for the fast response! Yes, that's exactly the thing I would like to have in there. |
Hm, not quite sure that I understand the problem. Have you tried package flutter_config to pass variables to iOS and Android from the .env file? Or dart defines? I just can't figure out how multiple paths solves the issue) |
I'll give you an example: The thing with |
Agreed, but you can generate .env with my package, and then use flutter_config to pass it's values to native layers (Android/iOS) Is it possible to solve it with dart defines? I can assume you need just this value on the native layers, so in theory much easier solution will be pass it directly into the native layer with defines, rather than define env config yaml to generate .env and then read it on natives Just trying to see the full picture |
If it's small info (and just a few keys) you can pass it during the build phase. Values could be taken from CI/CD env variables. And then it can be accessed in the android Gradle to inject into xml and in the iOS pre-build script to inject into plist if needed |
Yes, of course. totally understandable 🙂
Not really, since we have three stages in the app with different build configs and build config should also provide all secrets. Having the possibility to define multiple |
And since |
Oh, I thought it is - https://github.com/ByneappLLC/flutter_config/blob/master/doc/ANDROID.md#usage-in-gradle
What about instead of allowing multiple dot env paths, I add a possibility to override it with extension? Will it solve your problem? |
another option - sh script to run flutter with dart-defines and values from .env, I was thinking to create a package for this, but not quite sure if it's possible to make it in a way when it will be easy to install and use though |
Oh, yes. An extension would definitely help us. This would mean that we would have to run the generator two times with different extension in order to have two |
yes. I was just thinking that it will solve not just your case. For instance, if someone needs to have 2 different env files with a different set of variables, they can use extensions to define what env path is in each and define what variables should be exported there |
Good point! I like the idea! |
It would be very nice to have the option to define multiple
dotenv_path
in the YAML. This is very useful for providing fields to many native layers. But currently it is only possible to provide a.env
file for either the Android or the iOS Project, sincedotenv_path
cannot be defined multiple times.The text was updated successfully, but these errors were encountered: