Environmental Variable Issue #2671
-
If you are looking for help, please confirm the following...
Which mobile framework are you using?Flutter (Dart) Steps to reproduceExpected resultsIt should get the Key value from the Codemagic env variables. Actual resultsIt is not able to load the variables Build id (optional)No response |
Beta Was this translation helpful? Give feedback.
Answered by
dam-ease
Aug 7, 2024
Replies: 2 comments 1 reply
-
Facing the same issue!! environment variables are a pain, confused!! ;-; |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hello @VikasAgrawal-04. One way to do this is:
You can also checkout this for more ways of handling environment variables. Please let me know if this helps. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
dam-ease
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @VikasAgrawal-04.
I see you are trying to access the Environment Variables in your codebase.
One way to do this is:
--dart-define
to your scripts. E.g--dart-define=NAME=$NAME
String.fromEnvironment
method. Example:String.fromEnvironment('NAME')
You can also checkout this for more ways of handling environment variables. Please let me know if this helps.