-
Notifications
You must be signed in to change notification settings - Fork 90
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
How to use Environment Variables in Flutter #20
Comments
This morning I will focus on reading this first article to understand if the error is in the use of the API key. https://medium.com/flutter-community/use-environment-variables-in-ci-cd-for-flutter-apps-cbd6d9ac82c |
@miguelmartins17 good plan. 👍 |
@nelsonic Where should I put the summary information of what I understood about the first article, should be shared in the |
This link can be useful for learning: |
@nelsonic What should we add here to improve the issue to provide more information about the environment variables? |
Miguel, what we need is an example written in our own words for how to use Environment Variables in Flutter/Dart. If you feel that the links you have shared above do a good job of explaining how to use Environment Variables in Flutter then summarise the instructions. |
@nelsonic Sure, I'll work on it. |
Is this an exercise, or are you looking for a potential implementation? On Flutter, since it's compiled code, the environment variables are compiled into the app statically. That means anyone who gets hold of the app (or the .apk file) can extract these keys. There's not really any way around this for real. But maybe you want to use personal tokens that the app's users can use for a short time and that have to be renewed? That way you can at least gradually increase the controls imposed on which users can access what, and you avoid exposing any service account keys directly to anyone who can find a tool that can analyse the app. |
Regarding environment variables in Flutter, even though no way is actually safe because the client gets a hold of the apk file, I had an idea that seems a bit better. So I made this package called envify which builds environment variables directly into the source code instead of using them in the runtime as an asset. In my experience, So check that out pls ✌️. |
Just bumped into this issue from google search and ended-up trying to learn more about this project. Not even sure if this is still active 😏 ... Have you ever thought of loading env variables from an external service? Git, microservice or other? Wouldn't it be great to be able to change those variables without having to release a new version of the app? |
@GoncaloPT good Google detective work. 🔍 👍 😉 |
Sure @nelsonic. |
As a
developer
building an Open Source cross-platform mobile app using FlutterI want to use environment variables in my Flutter App
So that all my code can be open on GitHub without exposing any sensitive API keys.
Todo:
Related to: dwyl/learn-flutter#37 Giphy API key.
The text was updated successfully, but these errors were encountered: