dotenv
dotenv copied to clipboard
use in test flutter charge enviroments?
Any idea about how to use this with Unit tests. I am getting file not found
You can set env variables before running tests using dot env like this
DotEnv().env = {"yourEnvVar": value};
DotEnv().env["yourEnvVar"] ///value
New syntax for setting up your test environment:
dotenv.testLoad(mergeWith: {"KEY": "value"});
Then you can load a variable like this:
dotenv.env["KEY"]!